free MPI Communicators on destruction (#134)

make sure that all communicators that have been created during the
runtime of the application are correctly freed again, to avoid memory
leaks.
This commit is contained in:
Edgar Gabriel
2025-05-20 09:59:00 -05:00
committed by GitHub
parent 474112d03c
commit bce329abd6
6 changed files with 19 additions and 8 deletions
+4 -1
View File
@@ -63,7 +63,10 @@ MPITransport::MPITransport(MPI_Comm comm, Queue* q)
NET_CHECK(MPI_Comm_rank(ro_net_comm_world, &my_pe));
}
MPITransport::~MPITransport() {}
MPITransport::~MPITransport() {
if (ro_net_comm_world != MPI_COMM_NULL)
NET_CHECK(MPI_Comm_free(&ro_net_comm_world));
}
void MPITransport::threadProgressEngine() {
auto *bp{backend_proxy->get()};
+1 -1
View File
@@ -169,7 +169,7 @@ private:
std::vector<int> outstanding{};
MPI_Comm ro_net_comm_world{};
MPI_Comm ro_net_comm_world{MPI_COMM_NULL};
std::map<CommKey, MPI_Comm> comm_map{};