Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
generalize mark_as_deleted call
authorAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 6 Apr 2021 15:06:17 +0000 (17:06 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 6 Apr 2021 18:07:16 +0000 (20:07 +0200)
src/smpi/bindings/smpi_pmpi_group.cpp
src/smpi/bindings/smpi_pmpi_info.cpp
src/smpi/bindings/smpi_pmpi_op.cpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/bindings/smpi_pmpi_type.cpp

index ea9898f..a3d3798 100644 (file)
@@ -18,8 +18,10 @@ int PMPI_Group_free(MPI_Group * group)
 {
   CHECK_NULL(1, MPI_ERR_ARG, group)
   CHECK_MPI_NULL(1, MPI_GROUP_NULL, MPI_ERR_GROUP, *group)
-  if(*group != MPI_COMM_WORLD->group() && *group != MPI_GROUP_EMPTY)
+  if(*group != MPI_COMM_WORLD->group() && *group != MPI_GROUP_EMPTY){
+    (*group)->mark_as_deleted();
     simgrid::smpi::Group::unref(*group);
+  }
   *group = MPI_GROUP_NULL;
   return MPI_SUCCESS;
 }
index fe4ae45..0cacf3c 100644 (file)
@@ -27,6 +27,7 @@ int PMPI_Info_set( MPI_Info info, const char *key, const char *value){
 int PMPI_Info_free( MPI_Info *info){
   CHECK_NULL(1, MPI_ERR_ARG, info)
   CHECK_INFO(1, *info)
+  (*info)->mark_as_deleted();
   simgrid::smpi::Info::unref(*info);
   *info=MPI_INFO_NULL;
   return MPI_SUCCESS;
index a6200c1..653cfd7 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "private.hpp"
 #include "smpi_op.hpp"
+#include "smpi_comm.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
 
@@ -24,6 +25,7 @@ int PMPI_Op_free(MPI_Op * op)
   CHECK_MPI_NULL(1, MPI_OP_NULL, MPI_ERR_OP, *op)
   if((*op)->is_predefined())
     return MPI_ERR_OP;
+  (*op)->mark_as_deleted();
   simgrid::smpi::Op::unref(op);
   *op = MPI_OP_NULL;
   return MPI_SUCCESS;
index 14d2bd2..fb30222 100644 (file)
@@ -163,6 +163,7 @@ int PMPI_Request_free(MPI_Request * request)
 
   smpi_bench_end();
   if (*request != MPI_REQUEST_NULL) {
+    (*request)->mark_as_deleted();
     simgrid::smpi::Request::unref(request);
     *request = MPI_REQUEST_NULL;
     retval = MPI_SUCCESS;
index aac1aed..04208cb 100644 (file)
@@ -17,6 +17,7 @@ int PMPI_Type_free(MPI_Datatype * datatype)
   if (*datatype == MPI_DATATYPE_NULL || (*datatype)->flags() & DT_FLAG_PREDEFINED) {
     return MPI_ERR_TYPE;
   } else {
+    (*datatype)->mark_as_deleted();
     simgrid::smpi::Datatype::unref(*datatype);
     *datatype=MPI_DATATYPE_NULL;
     return MPI_SUCCESS;