Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions src/modules/transport/ibgda/ibgda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4105,6 +4105,7 @@ int nvshmemt_ibgda_finalize(nvshmem_transport_t transport) {
INFO(ibgda_state->log_level, "ibv_dealloc_pd failed for device %d Err: %d:%s.\n", i,
errno, strerror(errno));
}
device->common_device.pd = NULL;
}

if (device->common_device.context) {
Expand All @@ -4117,6 +4118,7 @@ int nvshmemt_ibgda_finalize(nvshmem_transport_t transport) {
NVSHMEMI_WARN_PRINT("ibv_close_device failed for device %d Err: %d:%s.\n", i, errno,
strerror(errno));
}
device->common_device.context = NULL;
}
status = 0;
// NVSHMEMI_NZ_ERROR_JMP(status, NVSHMEMX_ERROR_INTERNAL, out,
Expand Down
6 changes: 6 additions & 0 deletions src/modules/transport/ibrc/ibrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,33 +732,39 @@ int nvshmemt_ibrc_finalize(nvshmem_transport_t transport) {
status = ftable.dereg_mr(((struct ibrc_device *)state->devices)[dev_id].bpool_mr);
NVSHMEMI_NZ_ERROR_JMP(status, NVSHMEMX_ERROR_INTERNAL, out,
"ibv_dereg_mr failed \n");
((struct ibrc_device *)state->devices)[dev_id].bpool_mr = NULL;
}
if (((struct ibrc_device *)state->devices)[dev_id].send_cq) {
status = ftable.destroy_cq(((struct ibrc_device *)state->devices)[dev_id].send_cq);
NVSHMEMI_NZ_ERROR_JMP(status, NVSHMEMX_ERROR_INTERNAL, out,
"ibv_destroy_cq failed \n");
((struct ibrc_device *)state->devices)[dev_id].send_cq = NULL;
}
if (((struct ibrc_device *)state->devices)[dev_id].recv_cq) {
status = ftable.destroy_cq(((struct ibrc_device *)state->devices)[dev_id].recv_cq);
NVSHMEMI_NZ_ERROR_JMP(status, NVSHMEMX_ERROR_INTERNAL, out,
"ibv_destroy_cq failed \n");
((struct ibrc_device *)state->devices)[dev_id].recv_cq = NULL;
}
if (((struct ibrc_device *)state->devices)[dev_id].srq) {
status = ftable.destroy_srq(((struct ibrc_device *)state->devices)[dev_id].srq);
NVSHMEMI_NZ_ERROR_JMP(status, NVSHMEMX_ERROR_INTERNAL, out,
"ibv_destroy_srq failed \n");
((struct ibrc_device *)state->devices)[dev_id].srq = NULL;
}
if (((struct ibrc_device *)state->devices)[dev_id].common_device.pd) {
status = ftable.dealloc_pd(
((struct ibrc_device *)state->devices)[dev_id].common_device.pd);
NVSHMEMI_NZ_ERROR_JMP(status, NVSHMEMX_ERROR_INTERNAL, out,
"ibv_dealloc_pd failed \n");
((struct ibrc_device *)state->devices)[dev_id].pd = NULL;
}
if (((struct ibrc_device *)state->devices)[dev_id].common_device.context) {
status = ftable.close_device(
((struct ibrc_device *)state->devices)[dev_id].common_device.context);
NVSHMEMI_NZ_ERROR_JMP(status, NVSHMEMX_ERROR_INTERNAL, out,
"ibv_close_device failed \n");
((struct ibrc_device *)state->devices)[dev_id].context = NULL;
}
}
free(state->devices);
Expand Down