Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
"Implement" MPI_Type_get_extent_x, MPI_Type_get_true_extent_x, and MPI_Status_set_ele...
authorAugustin Degomme <adegomme@users.noreply.github.com>
Sat, 6 Mar 2021 13:36:26 +0000 (14:36 +0100)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Sat, 6 Mar 2021 13:36:26 +0000 (14:36 +0100)
include/smpi/smpi.h
src/smpi/bindings/smpi_mpi.cpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/bindings/smpi_pmpi_type.cpp

index 023320d..5166603 100644 (file)
@@ -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));
index f457068..a28cd5f 100644 (file)
@@ -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))
index 3853f99..709d3a8 100644 (file)
@@ -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<int>(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){
index 251396c..4133b58 100644 (file)
@@ -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<MPI_Count>(tmplb);
+  *extent = static_cast<MPI_Count>(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)