From 1f32679abc2f9c0cae9e27951b643a0f70d71b3a Mon Sep 17 00:00:00 2001 From: degomme Date: Sat, 11 Feb 2017 00:26:30 +0100 Subject: [PATCH] Add MPI_Type_size_x call --- include/smpi/smpi.h | 1 + src/smpi/smpi_mpi.cpp | 1 + src/smpi/smpi_pmpi.cpp | 15 +++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index e151f89ff9..f27f87907a 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -396,6 +396,7 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Address, (void *location, MPI_Aint * address)); MPI_CALL(XBT_PUBLIC(int), MPI_Get_address, (void *location, MPI_Aint * address)); MPI_CALL(XBT_PUBLIC(int), MPI_Type_free, (MPI_Datatype * datatype)); MPI_CALL(XBT_PUBLIC(int), MPI_Type_size, (MPI_Datatype datatype, int *size)); +MPI_CALL(XBT_PUBLIC(int), MPI_Type_size_x, (MPI_Datatype datatype, MPI_Count *size)); MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_extent, (MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)); MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_true_extent, (MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)); MPI_CALL(XBT_PUBLIC(int), MPI_Type_extent, (MPI_Datatype datatype, MPI_Aint * extent)); diff --git a/src/smpi/smpi_mpi.cpp b/src/smpi/smpi_mpi.cpp index 415ffbcfe6..e7dd3fd28c 100644 --- a/src/smpi/smpi_mpi.cpp +++ b/src/smpi/smpi_mpi.cpp @@ -169,6 +169,7 @@ WRAPPED_PMPI_CALL(int,MPI_Type_lb,(MPI_Datatype datatype, MPI_Aint * disp),(data WRAPPED_PMPI_CALL(int,MPI_Type_set_attr ,(MPI_Datatype type, int type_keyval, void *attribute_val),( type, type_keyval, attribute_val)) WRAPPED_PMPI_CALL(int,MPI_Type_set_name,(MPI_Datatype datatype, char * name),(datatype, name)) WRAPPED_PMPI_CALL(int,MPI_Type_size,(MPI_Datatype datatype, int *size),(datatype, size)) +WRAPPED_PMPI_CALL(int,MPI_Type_size_x,(MPI_Datatype datatype, MPI_Count *size),(datatype, size)) WRAPPED_PMPI_CALL(int,MPI_Type_struct,(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) ,(count, blocklens, indices, old_types, newtype)) WRAPPED_PMPI_CALL(int,MPI_Type_ub,(MPI_Datatype datatype, MPI_Aint * disp),(datatype, disp)) WRAPPED_PMPI_CALL(int,MPI_Type_vector,(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklen, stride, old_type, newtype)) diff --git a/src/smpi/smpi_pmpi.cpp b/src/smpi/smpi_pmpi.cpp index 7a76e2ed4c..62ca0f186c 100644 --- a/src/smpi/smpi_pmpi.cpp +++ b/src/smpi/smpi_pmpi.cpp @@ -184,6 +184,21 @@ int PMPI_Type_size(MPI_Datatype datatype, int *size) return retval; } +int PMPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size) +{ + int retval = 0; + + if (datatype == MPI_DATATYPE_NULL) { + retval = MPI_ERR_TYPE; + } else if (size == nullptr) { + retval = MPI_ERR_ARG; + } else { + *size = static_cast(smpi_datatype_size(datatype)); + retval = MPI_SUCCESS; + } + return retval; +} + int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent) { int retval = 0; -- 2.20.1