Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Pack_size is meant to return the upper bound of the size.
authorAugustin Degomme <adegomme@gmail.com>
Fri, 2 Apr 2021 22:19:17 +0000 (00:19 +0200)
committerAugustin Degomme <adegomme@gmail.com>
Sat, 3 Apr 2021 00:40:51 +0000 (02:40 +0200)
Thanks agier

src/smpi/bindings/smpi_pmpi_type.cpp

index d7061c2..7155047 100644 (file)
@@ -338,6 +338,6 @@ int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size)
   CHECK_NEGATIVE(1, MPI_ERR_COUNT, incount)
   CHECK_TYPE(2, datatype)
   CHECK_COMM(3)
-  *size=incount*datatype->get_extent();
+  *size = incount * std::max<long>(datatype->size(), datatype->get_extent());
   return MPI_SUCCESS;
 }