Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
get_info calls actually must return a copy.
authorAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 6 Apr 2021 15:06:50 +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_comm.cpp
src/smpi/bindings/smpi_pmpi_file.cpp

index d00de2d..f54d7b4 100644 (file)
@@ -183,7 +183,7 @@ int PMPI_Comm_get_info(MPI_Comm comm, MPI_Info* info)
 {
   CHECK_COMM(1)
   CHECK_NULL(2, MPI_ERR_ARG, info)
-  *info = comm->info();
+  *info = new simgrid::smpi::Info(comm->info());
   return MPI_SUCCESS;
 }
 
index d1879a8..bda9227 100644 (file)
@@ -299,7 +299,7 @@ int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_D
 int PMPI_File_get_info(MPI_File  fh, MPI_Info* info)
 {
   CHECK_FILE(1, fh)
-  *info = fh->info();
+  *info = new simgrid::smpi::Info(fh->info());
   return MPI_SUCCESS;
 }