Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar is right here
authorAugustin Degomme <adegomme@users.noreply.github.com>
Mon, 8 Mar 2021 07:25:12 +0000 (08:25 +0100)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Mon, 8 Mar 2021 07:25:12 +0000 (08:25 +0100)
src/smpi/bindings/smpi_pmpi_type.cpp

index 4133b58..c82e82c 100644 (file)
@@ -50,8 +50,10 @@ int PMPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count * lb, MPI_Count * ex
 {
   MPI_Aint tmplb, tmpext;
   int ret = PMPI_Type_get_extent(datatype, &tmplb, &tmpext);
-  *lb = static_cast<MPI_Count>(tmplb);
-  *extent = static_cast<MPI_Count>(tmpext);
+  if(ret == MPI_SUCCESS){
+    *lb = static_cast<MPI_Count>(tmplb);
+    *extent = static_cast<MPI_Count>(tmpext);
+  }
   return ret;
 }