Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bf50872
src: Initial changes for transmission-side multiplexing
philipmarshall21 May 7, 2024
cc8b0e7
src: Add initial NIC selection logic for multiplexing
philipmarshall21 May 7, 2024
2068d75
src: Add nic_idx paramater to where needed in Fortran files
philipmarshall21 May 8, 2024
0cb61b1
src: Pass NIC index to transport layer functions
philipmarshall21 May 8, 2024
cf73762
src: Continue passing NIC index where needed
philipmarshall21 May 17, 2024
168131b
src: More fixes
philipmarshall21 Jun 3, 2024
4e08aef
src: Fix shmem_transport_put_quiet
philipmarshall21 Jun 5, 2024
f7e20dc
src: Experiment with changes to shmem_transport_probe
philipmarshall21 Jun 11, 2024
8134b97
src: Work on support with bounce buffers
philipmarshall21 Jun 24, 2024
3b01d15
src: Make shmem_transport_probe take a NIC index
philipmarshall21 Jun 25, 2024
aad2e23
Undo changes to shmem_transport_probe
philipmarshall21 Jun 26, 2024
b68a86a
Merge branch 'pr-1126' into bcm_pr-1126_TxMuxing
bcmIntc Mar 5, 2026
b1cd581
Fix build errors after merge: add missing nic_idx arguments
bcmIntc Mar 5, 2026
373a1f8
Fix issues found in double-check review
bcmIntc Mar 5, 2026
41fd729
Fix shmem_transport_fini shutdown segfaults
bcmIntc Mar 5, 2026
7bffeb2
Restore single-endpoint mode compatibility with per-NIC design
bcmIntc Mar 5, 2026
2c8bf11
Add --enable-ofi-tx-load-balancing configure option
bcmIntc Mar 18, 2026
4df0dfc
Fix for no TXLB HWLOC case
bcmIntc Mar 20, 2026
965d93c
Add round-robin and random TX load balancing NIC selection modes
bcmIntc Mar 23, 2026
904a6e1
Remove 2 instances of nic_idx hard-coding to 0 in shmem_internal_set_…
bcmIntc Mar 23, 2026
83f8d13
transport_ofi: fix NIC selection bugs, leaks, and NULL dereferences
bcmIntc Mar 23, 2026
7507073
ofi: split TX LB flag, use local rank for NIC assignment
bcmIntc Mar 31, 2026
748f78f
Added assertions to validate nic_adx.
bcmIntc Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ AS_IF([test "$with_hwloc" != "no"], [
OPAL_3RDPARTY_WITH([hwloc], [hwloc], [package_hwloc])
_OPAL_CONFIG_HWLOC_EXTERNAL(
[external_hwloc_happy=1
shmem_hwloc_found=yes
opal_hwloc_mode="external"
AC_DEFINE([USE_HWLOC], [1], [Enable hwloc. Default behavior is to automatically enable hwloc if installation can be found])],
[AS_IF([test -n "$with_hwloc"],
Expand Down Expand Up @@ -340,6 +341,27 @@ AC_ARG_ENABLE([ofi-hmem],
AS_IF([test "$enable_ofi_hmem" = "yes"],
[AC_DEFINE([USE_FI_HMEM], [1], [If defined, the OFI transport will enable FI_HMEM.])])

AC_ARG_ENABLE([ofi-tx-load-balancing-round-robin],
[AS_HELP_STRING([--enable-ofi-tx-load-balancing-round-robin],
[Enable OFI transmit load balancing across available NICs using round-robin selection. Requires --with-hwloc. Mutually exclusive with --enable-ofi-tx-load-balancing-random. (default: disabled)])])

AC_ARG_ENABLE([ofi-tx-load-balancing-random],
[AS_HELP_STRING([--enable-ofi-tx-load-balancing-random],
[Enable OFI transmit load balancing across available NICs using random selection. Requires --with-hwloc. Mutually exclusive with --enable-ofi-tx-load-balancing-round-robin. (default: disabled)])])

AS_IF([test "$enable_ofi_tx_load_balancing_round_robin" = "yes" -a "$enable_ofi_tx_load_balancing_random" = "yes"],
[AC_MSG_ERROR([--enable-ofi-tx-load-balancing-round-robin and --enable-ofi-tx-load-balancing-random are mutually exclusive])])

AS_IF([test "$enable_ofi_tx_load_balancing_round_robin" = "yes"],
[AS_IF([test "$shmem_hwloc_found" != "yes"],
[AC_MSG_ERROR([--enable-ofi-tx-load-balancing-round-robin requires hwloc; ensure hwloc is installed and --with-hwloc is not disabled])])
AC_DEFINE([USE_OFI_TX_LOAD_BALANCING_ROUND_ROBIN], [1], [If defined, the OFI transport will use round-robin selection among available NICs for transmit operations.])])

AS_IF([test "$enable_ofi_tx_load_balancing_random" = "yes"],
[AS_IF([test "$shmem_hwloc_found" != "yes"],
[AC_MSG_ERROR([--enable-ofi-tx-load-balancing-random requires hwloc; ensure hwloc is installed and --with-hwloc is not disabled])])
AC_DEFINE([USE_OFI_TX_LOAD_BALANCING_RANDOM], [1], [If defined, the OFI transport will use random selection among available NICs for transmit operations.])])

PKG_INSTALLDIR()

dnl check for programs
Expand Down
105 changes: 74 additions & 31 deletions src/atomic_c.c4

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions src/atomic_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ FC_SHMEM_SWAP(fortran_integer_t *target,
SHMEM_ERR_CHECK_SYMMETRIC(target, SIZEOF_FORTRAN_INTEGER);

shmem_internal_swap(SHMEM_CTX_DEFAULT, target, value, &newval, SIZEOF_FORTRAN_INTEGER,
*pe, SHM_INTERNAL_FORTRAN_INTEGER);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_FORTRAN_INTEGER, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return newval;
}

Expand All @@ -64,8 +64,8 @@ FC_SHMEM_INT4_SWAP(int32_t *target,
SHMEM_ERR_CHECK_SYMMETRIC(target, 4);

shmem_internal_swap(SHMEM_CTX_DEFAULT, target, value, &newval, 4,
*pe, SHM_INTERNAL_INT32);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_INT32, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return newval;
}

Expand All @@ -87,8 +87,8 @@ FC_SHMEM_INT8_SWAP(int64_t *target,
SHMEM_ERR_CHECK_SYMMETRIC(target, 8);

shmem_internal_swap(SHMEM_CTX_DEFAULT, target, value, &newval, 8,
*pe, SHM_INTERNAL_INT64);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_INT64, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return newval;
}

Expand All @@ -112,8 +112,8 @@ FC_SHMEM_REAL4_SWAP(float *target,
shmem_internal_assert(sizeof(float) == 4);

shmem_internal_swap(SHMEM_CTX_DEFAULT, target, value, &newval, 4,
*pe, SHM_INTERNAL_FLOAT);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_FLOAT, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return newval;
}

Expand All @@ -137,8 +137,8 @@ FC_SHMEM_REAL8_SWAP(double *target,
shmem_internal_assert(sizeof(double) == 8);

shmem_internal_swap(SHMEM_CTX_DEFAULT, target, value, &newval, 8,
*pe, SHM_INTERNAL_DOUBLE);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_DOUBLE, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return newval;
}

Expand All @@ -163,8 +163,8 @@ FC_SHMEM_INT4_CSWAP(int32_t *target,

shmem_internal_cswap(SHMEM_CTX_DEFAULT, target, value, &newval, cond,
4,
*pe, SHM_INTERNAL_INT32);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_INT32, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return newval;
}

Expand All @@ -189,8 +189,8 @@ FC_SHMEM_INT8_CSWAP(int64_t *target,

shmem_internal_cswap(SHMEM_CTX_DEFAULT, target, value, &newval, cond,
8,
*pe, SHM_INTERNAL_INT64);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_INT64, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return newval;
}

Expand All @@ -212,8 +212,8 @@ FC_SHMEM_INT4_FADD(int32_t *target,
SHMEM_ERR_CHECK_SYMMETRIC(target, 4);

shmem_internal_fetch_atomic(SHMEM_CTX_DEFAULT, target, value, &oldval, 4,
*pe, SHM_INTERNAL_SUM, SHM_INTERNAL_INT32);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_SUM, SHM_INTERNAL_INT32, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return oldval;
}

Expand All @@ -235,8 +235,8 @@ FC_SHMEM_INT8_FADD(int64_t *target,
SHMEM_ERR_CHECK_SYMMETRIC(target, 8);

shmem_internal_fetch_atomic(SHMEM_CTX_DEFAULT, target, value, &oldval, 8,
*pe, SHM_INTERNAL_SUM, SHM_INTERNAL_INT64);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_SUM, SHM_INTERNAL_INT64, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return oldval;
}

Expand All @@ -256,8 +256,8 @@ FC_SHMEM_INT4_FINC(int32_t *target,
SHMEM_ERR_CHECK_SYMMETRIC(target, 4);

shmem_internal_fetch_atomic(SHMEM_CTX_DEFAULT, target, &tmp, &oldval, 4,
*pe, SHM_INTERNAL_SUM, SHM_INTERNAL_INT32);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_SUM, SHM_INTERNAL_INT32, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return oldval;
}

Expand All @@ -277,8 +277,8 @@ FC_SHMEM_INT8_FINC(int64_t *target,
SHMEM_ERR_CHECK_SYMMETRIC(target, 8);

shmem_internal_fetch_atomic(SHMEM_CTX_DEFAULT, target, &tmp, &oldval, 8,
*pe, SHM_INTERNAL_SUM, SHM_INTERNAL_INT64);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
*pe, SHM_INTERNAL_SUM, SHM_INTERNAL_INT64, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);
return oldval;
}

Expand Down Expand Up @@ -373,8 +373,8 @@ FC_SHMEM_INT4_FETCH(int32_t *source,
SHMEM_ERR_CHECK_PE(*pe);
SHMEM_ERR_CHECK_SYMMETRIC(source, 4);

shmem_internal_atomic_fetch(SHMEM_CTX_DEFAULT, &val, (void *) source, 4, *pe, SHM_INTERNAL_INT32);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
shmem_internal_atomic_fetch(SHMEM_CTX_DEFAULT, &val, (void *) source, 4, *pe, SHM_INTERNAL_INT32, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);

return val;
}
Expand All @@ -394,8 +394,8 @@ FC_SHMEM_INT8_FETCH(int64_t *source,
SHMEM_ERR_CHECK_PE(*pe);
SHMEM_ERR_CHECK_SYMMETRIC(source, 8);

shmem_internal_atomic_fetch(SHMEM_CTX_DEFAULT, &val, (void *) source, 8, *pe, SHM_INTERNAL_INT64);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
shmem_internal_atomic_fetch(SHMEM_CTX_DEFAULT, &val, (void *) source, 8, *pe, SHM_INTERNAL_INT64, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);

return val;
}
Expand All @@ -417,8 +417,8 @@ FC_SHMEM_REAL4_FETCH(float *source,

shmem_internal_assert(sizeof(float) == 4);

shmem_internal_atomic_fetch(SHMEM_CTX_DEFAULT, &val, (void *) source, 4, *pe, SHM_INTERNAL_INT32);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
shmem_internal_atomic_fetch(SHMEM_CTX_DEFAULT, &val, (void *) source, 4, *pe, SHM_INTERNAL_INT32, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);

return val;
}
Expand All @@ -440,8 +440,8 @@ FC_SHMEM_REAL8_FETCH(double *source,

shmem_internal_assert(sizeof(double) == 8);

shmem_internal_atomic_fetch(SHMEM_CTX_DEFAULT, &val, (void *) source, 8, *pe, SHM_INTERNAL_INT64);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT);
shmem_internal_atomic_fetch(SHMEM_CTX_DEFAULT, &val, (void *) source, 8, *pe, SHM_INTERNAL_INT64, 0);
shmem_internal_get_wait(SHMEM_CTX_DEFAULT, 0);

return val;
}
Expand Down
44 changes: 35 additions & 9 deletions src/atomic_nbi_c.c4
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ SHMEM_DEFINE_FOR_BITWISE_AMO(`SHMEM_PROF_DEF_CTX_FETCH_XOR_NBI')
SHMEM_ERR_CHECK_PE(pe); \
SHMEM_ERR_CHECK_CTX(ctx); \
SHMEM_ERR_CHECK_SYMMETRIC(target, sizeof(TYPE)); \
\
size_t nic_idx = 0; \
SHMEM_GET_TRANSMIT_NIC_IDX(nic_idx); \
shmem_internal_swap_nbi(ctx, target, &value, fetch, \
sizeof(TYPE), pe, ITYPE); \
sizeof(TYPE), pe, ITYPE, \
nic_idx); \
}


Expand All @@ -137,8 +141,11 @@ SHMEM_DEFINE_FOR_BITWISE_AMO(`SHMEM_PROF_DEF_CTX_FETCH_XOR_NBI')
SHMEM_ERR_CHECK_PE(pe); \
SHMEM_ERR_CHECK_CTX(ctx); \
SHMEM_ERR_CHECK_SYMMETRIC(target, sizeof(TYPE)); \
\
size_t nic_idx = 0; \
SHMEM_GET_TRANSMIT_NIC_IDX(nic_idx); \
shmem_internal_cswap_nbi(ctx, target, &value, fetch, &cond, \
sizeof(TYPE), pe, ITYPE); \
sizeof(TYPE), pe, ITYPE, nic_idx); \
}


Expand All @@ -151,9 +158,12 @@ SHMEM_DEFINE_FOR_BITWISE_AMO(`SHMEM_PROF_DEF_CTX_FETCH_XOR_NBI')
SHMEM_ERR_CHECK_PE(pe); \
SHMEM_ERR_CHECK_CTX(ctx); \
SHMEM_ERR_CHECK_SYMMETRIC(target, sizeof(TYPE)); \
\
size_t nic_idx = 0; \
SHMEM_GET_TRANSMIT_NIC_IDX(nic_idx); \
shmem_internal_fetch_atomic_nbi(ctx, target, &tmp, fetch, \
sizeof(TYPE), pe, SHM_INTERNAL_SUM, \
ITYPE); \
ITYPE, nic_idx); \
}


Expand All @@ -165,9 +175,13 @@ SHMEM_DEFINE_FOR_BITWISE_AMO(`SHMEM_PROF_DEF_CTX_FETCH_XOR_NBI')
SHMEM_ERR_CHECK_PE(pe); \
SHMEM_ERR_CHECK_CTX(ctx); \
SHMEM_ERR_CHECK_SYMMETRIC(target, sizeof(TYPE)); \
\
size_t nic_idx = 0; \
SHMEM_GET_TRANSMIT_NIC_IDX(nic_idx); \
shmem_internal_fetch_atomic_nbi(ctx, target, &value, fetch, \
sizeof(TYPE), pe, \
SHM_INTERNAL_SUM, ITYPE); \
SHM_INTERNAL_SUM, ITYPE, \
nic_idx); \
}


Expand All @@ -179,8 +193,11 @@ SHMEM_DEFINE_FOR_BITWISE_AMO(`SHMEM_PROF_DEF_CTX_FETCH_XOR_NBI')
SHMEM_ERR_CHECK_PE(pe); \
SHMEM_ERR_CHECK_CTX(ctx); \
SHMEM_ERR_CHECK_SYMMETRIC(source, sizeof(TYPE)); \
shmem_internal_atomic_fetch_nbi(ctx, fetch, source, \
sizeof(TYPE), pe, ITYPE); \
\
size_t nic_idx = 0; \
SHMEM_GET_TRANSMIT_NIC_IDX(nic_idx); \
shmem_internal_atomic_fetch_nbi(ctx, fetch, (void *) source, \
sizeof(TYPE), pe, ITYPE, nic_idx); \
}


Expand All @@ -192,9 +209,12 @@ SHMEM_DEFINE_FOR_BITWISE_AMO(`SHMEM_PROF_DEF_CTX_FETCH_XOR_NBI')
SHMEM_ERR_CHECK_PE(pe); \
SHMEM_ERR_CHECK_CTX(ctx); \
SHMEM_ERR_CHECK_SYMMETRIC(target, sizeof(TYPE)); \
\
size_t nic_idx = 0; \
SHMEM_GET_TRANSMIT_NIC_IDX(nic_idx); \
shmem_internal_fetch_atomic_nbi(ctx, target, &value, fetch, \
sizeof(TYPE), pe, SHM_INTERNAL_BXOR,\
ITYPE); \
ITYPE, nic_idx); \
}


Expand All @@ -206,9 +226,12 @@ SHMEM_DEFINE_FOR_BITWISE_AMO(`SHMEM_PROF_DEF_CTX_FETCH_XOR_NBI')
SHMEM_ERR_CHECK_PE(pe); \
SHMEM_ERR_CHECK_CTX(ctx); \
SHMEM_ERR_CHECK_SYMMETRIC(target, sizeof(TYPE)); \
\
size_t nic_idx = 0; \
SHMEM_GET_TRANSMIT_NIC_IDX(nic_idx); \
shmem_internal_fetch_atomic_nbi(ctx, target, &value, fetch, \
sizeof(TYPE), pe, SHM_INTERNAL_BAND,\
ITYPE); \
ITYPE, nic_idx); \
}


Expand All @@ -220,9 +243,12 @@ SHMEM_DEFINE_FOR_BITWISE_AMO(`SHMEM_PROF_DEF_CTX_FETCH_XOR_NBI')
SHMEM_ERR_CHECK_PE(pe); \
SHMEM_ERR_CHECK_CTX(ctx); \
SHMEM_ERR_CHECK_SYMMETRIC(target, sizeof(TYPE)); \
\
size_t nic_idx = 0; \
SHMEM_GET_TRANSMIT_NIC_IDX(nic_idx); \
shmem_internal_fetch_atomic_nbi(ctx, target, &value, fetch, \
sizeof(TYPE), pe, SHM_INTERNAL_BOR, \
ITYPE); \
ITYPE, nic_idx); \
}

/* Function prototype for v1.4 routines with the default context: */
Expand Down
Loading
Loading