Skip to content

Commit 0bc89e1

Browse files
committed
ch4/ofi: Remove unused globals for striping and hashing
There is no use for these global variables tracking the number of communicators with striping or hashing enabled. ThreadSanitizer correctly flagged their accesses as racey. Remove them.
1 parent 54e8cdc commit 0bc89e1

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

src/mpid/ch4/netmod/ofi/ofi_comm.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ static int update_multi_nic_hints(MPIR_Comm * comm)
2929
else
3030
MPIDI_OFI_COMM(comm).enable_striping = MPIR_CVAR_CH4_OFI_ENABLE_MULTI_NIC_STRIPING;
3131

32-
/* If striping was on and we disabled it here, decrement the global counter. */
33-
if (was_enabled_striping > 0 && MPIDI_OFI_COMM(comm).enable_striping == 0)
34-
MPIDI_OFI_global.num_comms_enabled_striping--;
35-
/* If striping was off and we enabled it here, increment the global counter. */
36-
else if (was_enabled_striping <= 0 && MPIDI_OFI_COMM(comm).enable_striping != 0)
37-
MPIDI_OFI_global.num_comms_enabled_striping++;
38-
3932
if (MPIDI_OFI_COMM(comm).enable_striping) {
4033
MPIDI_OFI_global.stripe_threshold = MPIR_CVAR_CH4_OFI_MULTI_NIC_STRIPING_THRESHOLD;
4134
}
@@ -60,13 +53,6 @@ static int update_multi_nic_hints(MPIR_Comm * comm)
6053
!comm->hints[MPIR_COMM_HINT_NO_ANY_SOURCE])) {
6154
MPIDI_OFI_COMM(comm).enable_hashing = 0;
6255
}
63-
64-
/* If hashing was on and we disabled it here, decrement the global counter. */
65-
if (was_enabled_hashing > 0 && MPIDI_OFI_COMM(comm).enable_hashing == 0)
66-
MPIDI_OFI_global.num_comms_enabled_hashing--;
67-
/* If hashing was off and we enabled it here, increment the global counter. */
68-
else if (was_enabled_hashing <= 0 && MPIDI_OFI_COMM(comm).enable_hashing != 0)
69-
MPIDI_OFI_global.num_comms_enabled_hashing++;
7056
}
7157
}
7258

@@ -145,8 +131,6 @@ int MPIDI_OFI_mpi_comm_commit_pre_hook(MPIR_Comm * comm)
145131
MPIDI_OFI_COMM(comm).conn_id = -1;
146132

147133
/* Initialize the multi-nic optimization values */
148-
MPIDI_OFI_global.num_comms_enabled_striping = 0;
149-
MPIDI_OFI_global.num_comms_enabled_hashing = 0;
150134
MPIDI_OFI_COMM(comm).enable_striping = 0;
151135
MPIDI_OFI_COMM(comm).enable_hashing = 0;
152136
MPIDI_OFI_COMM(comm).pref_nic = NULL;
@@ -192,12 +176,6 @@ int MPIDI_OFI_mpi_comm_free_hook(MPIR_Comm * comm)
192176
int mpi_errno = MPI_SUCCESS;
193177
MPIR_FUNC_ENTER;
194178

195-
/* If we enabled striping or hashing, decrement the counter. */
196-
MPIDI_OFI_global.num_comms_enabled_striping -=
197-
(MPIDI_OFI_COMM(comm).enable_striping != 0 ? 1 : 0);
198-
MPIDI_OFI_global.num_comms_enabled_hashing -=
199-
(MPIDI_OFI_COMM(comm).enable_hashing != 0 ? 1 : 0);
200-
201179
MPL_free(MPIDI_OFI_COMM(comm).pref_nic);
202180

203181
MPIR_FUNC_EXIT;

src/mpid/ch4/netmod/ofi/ofi_init.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,6 @@ int MPIDI_OFI_init_local(int *tag_bits)
644644
/* Initialize RMA keys allocator */
645645
MPIDI_OFI_mr_key_allocator_init();
646646

647-
MPIDI_OFI_global.num_comms_enabled_striping = 0;
648-
MPIDI_OFI_global.num_comms_enabled_hashing = 0;
649-
650647
mpi_errno = ofi_pvar_init();
651648
MPIR_ERR_CHECK(mpi_errno);
652649

src/mpid/ch4/netmod/ofi/ofi_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,6 @@ typedef struct {
489489
MPIDI_OFI_per_vci_t per_vci[MPIDI_CH4_MAX_VCIS];
490490
int num_vcis;
491491
int num_nics;
492-
int num_comms_enabled_striping; /* Number of active communicators with striping enabled */
493-
int num_comms_enabled_hashing; /* Number of active communicators with hashingenabled */
494492
bool am_bufs_registered; /* whether active message buffers are GPU registered */
495493

496494
/* Window/RMA Globals */

0 commit comments

Comments
 (0)