From: Augustin Degomme Date: Sat, 6 Mar 2021 13:36:26 +0000 (+0100) Subject: "Implement" MPI_Type_get_extent_x, MPI_Type_get_true_extent_x, and MPI_Status_set_ele... X-Git-Tag: v3.27~241 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/89c8abeef58a617ed6df1073ed6e571a318f2e2d "Implement" MPI_Type_get_extent_x, MPI_Type_get_true_extent_x, and MPI_Status_set_elements_x --- diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 023320d293..5166603730 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -473,7 +473,9 @@ 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_extent_x, (MPI_Datatype datatype, MPI_Count* lb, MPI_Count* 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_get_true_extent_x, (MPI_Datatype datatype, MPI_Count* lb, MPI_Count* extent)); MPI_CALL(XBT_PUBLIC int, MPI_Type_extent, (MPI_Datatype datatype, MPI_Aint* extent)); MPI_CALL(XBT_PUBLIC int, MPI_Type_lb, (MPI_Datatype datatype, MPI_Aint* disp)); MPI_CALL(XBT_PUBLIC int, MPI_Type_ub, (MPI_Datatype datatype, MPI_Aint* disp)); @@ -786,6 +788,7 @@ MPI_CALL(XBT_PUBLIC int, MPI_Grequest_start, MPI_CALL(XBT_PUBLIC int, MPI_Grequest_complete, (MPI_Request request)); MPI_CALL(XBT_PUBLIC int, MPI_Status_set_cancelled, (MPI_Status * status, int flag)); MPI_CALL(XBT_PUBLIC int, MPI_Status_set_elements, (MPI_Status * status, MPI_Datatype datatype, int count)); +MPI_CALL(XBT_PUBLIC int, MPI_Status_set_elements_x, (MPI_Status * status, MPI_Datatype datatype, MPI_Count count)); MPI_CALL(XBT_PUBLIC int, MPI_Type_create_subarray, (int ndims, const int* array_of_sizes, const int* array_of_subsizes, const int* array_of_starts, int order, MPI_Datatype oldtype, MPI_Datatype* newtype)); diff --git a/src/smpi/bindings/smpi_mpi.cpp b/src/smpi/bindings/smpi_mpi.cpp index f4570686ab..a28cd5f3de 100644 --- a/src/smpi/bindings/smpi_mpi.cpp +++ b/src/smpi/bindings/smpi_mpi.cpp @@ -267,8 +267,10 @@ WRAPPED_PMPI_CALL(int,MPI_Type_get_attr ,(MPI_Datatype type, int type_keyval, vo WRAPPED_PMPI_CALL(int,MPI_Type_get_contents,(MPI_Datatype datatype, int max_integers, int max_addresses, int max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses, MPI_Datatype *array_of_datatypes),(datatype, max_integers, max_addresses,max_datatypes, array_of_integers, array_of_addresses, array_of_datatypes)) WRAPPED_PMPI_CALL(int,MPI_Type_get_envelope,( MPI_Datatype datatype, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner),(datatype, num_integers, num_addresses, num_datatypes, combiner)) WRAPPED_PMPI_CALL(int,MPI_Type_get_extent,(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent),(datatype, lb, extent)) +WRAPPED_PMPI_CALL(int,MPI_Type_get_extent_x,(MPI_Datatype datatype, MPI_Count * lb, MPI_Count * extent),(datatype, lb, extent)) WRAPPED_PMPI_CALL(int,MPI_Type_get_name,(MPI_Datatype datatype, char * name, int* len),(datatype,name,len)) WRAPPED_PMPI_CALL(int,MPI_Type_get_true_extent,(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent),(datatype, lb, extent)) +WRAPPED_PMPI_CALL(int,MPI_Type_get_true_extent_x,(MPI_Datatype datatype, MPI_Count * lb, MPI_Count * extent),(datatype, lb, extent)) WRAPPED_PMPI_CALL(int,MPI_Type_hindexed,(int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklens, indices, old_type, newtype)) WRAPPED_PMPI_CALL(int,MPI_Type_hvector,(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklen, stride, old_type, newtype)) WRAPPED_PMPI_CALL(int,MPI_Type_indexed,(int count, const int* blocklens, const int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklens, indices, old_type, newtype)) @@ -339,6 +341,7 @@ WRAPPED_PMPI_CALL(int, MPI_Cancel,(MPI_Request* request) ,(request)) WRAPPED_PMPI_CALL(int, MPI_Test_cancelled,(const MPI_Status* status, int* flag) ,(status, flag)) WRAPPED_PMPI_CALL(int, MPI_Status_set_cancelled,(MPI_Status *status,int flag),(status,flag)) WRAPPED_PMPI_CALL(int, MPI_Status_set_elements,( MPI_Status *status, MPI_Datatype datatype, int count),( status, datatype, count)) +WRAPPED_PMPI_CALL(int, MPI_Status_set_elements_x,( MPI_Status *status, MPI_Datatype datatype, MPI_Count count),( status, datatype, count)) WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int, MPI_File_open,(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh),(comm, filename, amode, info, fh)) WRAPPED_PMPI_CALL_ERRHANDLER(int, MPI_File_close,(MPI_File *fh), (fh), (*fh)) WRAPPED_PMPI_CALL(int, MPI_File_delete,(const char *filename, MPI_Info info), (filename, info)) diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 3853f99fbf..709d3a8efc 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -762,7 +762,15 @@ int PMPI_Status_set_elements(MPI_Status* status, MPI_Datatype datatype, int coun return MPI_ERR_ARG; } simgrid::smpi::Status::set_elements(status,datatype, count); - return MPI_SUCCESS; + return MPI_SUCCESS; +} + +int PMPI_Status_set_elements_x(MPI_Status* status, MPI_Datatype datatype, MPI_Count count){ + if(status==MPI_STATUS_IGNORE){ + return MPI_ERR_ARG; + } + simgrid::smpi::Status::set_elements(status,datatype, static_cast(count)); + return MPI_SUCCESS; } int PMPI_Grequest_start( MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request){ diff --git a/src/smpi/bindings/smpi_pmpi_type.cpp b/src/smpi/bindings/smpi_pmpi_type.cpp index 251396ca94..4133b58481 100644 --- a/src/smpi/bindings/smpi_pmpi_type.cpp +++ b/src/smpi/bindings/smpi_pmpi_type.cpp @@ -46,11 +46,25 @@ int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent return datatype->extent(lb, extent); } +int PMPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count * lb, MPI_Count * extent) +{ + MPI_Aint tmplb, tmpext; + int ret = PMPI_Type_get_extent(datatype, &tmplb, &tmpext); + *lb = static_cast(tmplb); + *extent = static_cast(tmpext); + return ret; +} + int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent) { return PMPI_Type_get_extent(datatype, lb, extent); } +int PMPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count * lb, MPI_Count * extent) +{ + return PMPI_Type_get_extent_x(datatype, lb, extent); +} + int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent) { CHECK_MPI_NULL(1, MPI_DATATYPE_NULL, MPI_ERR_TYPE, datatype)