From 3ac0bae5c2a2349ec8c42e6c8b14265e74741b69 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Sat, 3 Apr 2021 00:19:17 +0200 Subject: [PATCH] Pack_size is meant to return the upper bound of the size. Thanks agier --- src/smpi/bindings/smpi_pmpi_type.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/smpi/bindings/smpi_pmpi_type.cpp b/src/smpi/bindings/smpi_pmpi_type.cpp index d7061c29e1..7155047890 100644 --- a/src/smpi/bindings/smpi_pmpi_type.cpp +++ b/src/smpi/bindings/smpi_pmpi_type.cpp @@ -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(datatype->size(), datatype->get_extent()); return MPI_SUCCESS; } -- 2.20.1