Skip to content

Commit 80dc93c

Browse files
committed
ch4/ucx: check whether av is set in finalize
Only call ucp_disconnect_nb on the av that is set.
1 parent 7c592a6 commit 80dc93c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/mpid/ch4/netmod/ucx/ucx_init.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,13 @@ int MPIDI_UCX_mpi_finalize_hook(void)
290290
MPIDI_UCX_addr_t *av = &MPIDI_UCX_AV(MPIDIU_lpid_to_av(i));
291291
for (int vci_local = 0; vci_local < MPIDI_UCX_global.num_vcis; vci_local++) {
292292
for (int vci_remote = 0; vci_remote < MPIDI_UCX_global.num_vcis; vci_remote++) {
293-
ucp_request = ucp_disconnect_nb(av->dest[vci_local][vci_remote]);
294-
MPIDI_UCX_CHK_REQUEST(ucp_request);
295-
if (ucp_request != UCS_OK) {
296-
pending[p] = ucp_request;
297-
p++;
293+
if (av->dest[vci_local][vci_remote]) {
294+
ucp_request = ucp_disconnect_nb(av->dest[vci_local][vci_remote]);
295+
MPIDI_UCX_CHK_REQUEST(ucp_request);
296+
if (ucp_request != UCS_OK) {
297+
pending[p] = ucp_request;
298+
p++;
299+
}
298300
}
299301
}
300302
}

0 commit comments

Comments
 (0)