Skip to content

Commit 382a90f

Browse files
committed
ch4/ofi: Improve code for tracking striping and hashing
The code for decrementing the number of striping or hashing enabled communicators was difficult to read. Make it simpler.
1 parent df0e740 commit 382a90f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,12 @@ int MPIDI_OFI_mpi_comm_free_hook(MPIR_Comm * comm)
191191
MPIR_FUNC_ENTER;
192192

193193
/* If we enabled striping or hashing, decrement the counter. */
194-
MPIDI_OFI_global.num_comms_enabled_striping -=
195-
(MPIDI_OFI_COMM(comm).enable_striping != 0 ? 1 : 0);
196-
MPIDI_OFI_global.num_comms_enabled_hashing -=
197-
(MPIDI_OFI_COMM(comm).enable_hashing != 0 ? 1 : 0);
194+
if (MPIDI_OFI_COMM(comm).enable_striping) {
195+
MPIDI_OFI_global.num_comms_enabled_striping--;
196+
}
197+
if (MPIDI_OFI_COMM(comm).enable_hashing) {
198+
MPIDI_OFI_global.num_comms_enabled_hashing--;
199+
}
198200

199201
MPL_free(MPIDI_OFI_COMM(comm).pref_nic);
200202

0 commit comments

Comments
 (0)