Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Call cleanup_attr<Comm> before marking Comm as deleted.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 4 Jun 2021 19:47:14 +0000 (21:47 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 4 Jun 2021 19:47:14 +0000 (21:47 +0200)
The MPI_Comm may be used by the attr cleanup callbacks.

src/smpi/mpi/smpi_comm.cpp

index 2959855..452439f 100644 (file)
@@ -65,8 +65,10 @@ void Comm::destroy(Comm* comm)
     Comm::destroy(smpi_process()->comm_world());
     return;
   }
-  if(comm != MPI_COMM_WORLD)
+  if (comm != MPI_COMM_WORLD && not comm->deleted()) {
+    comm->cleanup_attr<Comm>();
     comm->mark_as_deleted();
+  }
   Comm::unref(comm);
 }