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
+5 -1
View File
@@ -129,7 +129,11 @@ void Backend::destroy_remaining_ctxs() {
}
}
Backend::~Backend() { CHECK_HIP(hipFree(print_lock)); }
Backend::~Backend() {
CHECK_HIP(hipFree(print_lock));
if (backend_comm != MPI_COMM_NULL)
NET_CHECK(MPI_Comm_free(&backend_comm));
}
void Backend::dump_stats() {
printf("PE %d\n", my_pe);