Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
support MPI_Op_commutative call, as it was already implemented internally
authordegomme <augustin.degomme@unibas.ch>
Sun, 26 Mar 2017 20:48:14 +0000 (22:48 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Mon, 27 Mar 2017 21:20:56 +0000 (23:20 +0200)
include/smpi/smpi.h
src/smpi/smpi_mpi.cpp
src/smpi/smpi_pmpi.cpp
teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/coll/testlist

index c57139b..d7421ac 100644 (file)
@@ -440,6 +440,7 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Type_contiguous, (int count, MPI_Datatype old_type
 MPI_CALL(XBT_PUBLIC(int), MPI_Testall, (int count, MPI_Request* requests, int* flag, MPI_Status* statuses));
 MPI_CALL(XBT_PUBLIC(int), MPI_Op_create, (MPI_User_function * function, int commute, MPI_Op * op));
 MPI_CALL(XBT_PUBLIC(int), MPI_Op_free, (MPI_Op * op));
+MPI_CALL(XBT_PUBLIC(int), MPI_Op_commutative, (MPI_Op op, int *commute));
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Group_free, (MPI_Group * group));
 MPI_CALL(XBT_PUBLIC(int), MPI_Group_size, (MPI_Group group, int *size));
index 3099f4f..a2cc22a 100644 (file)
@@ -119,6 +119,7 @@ WRAPPED_PMPI_CALL(int,MPI_Keyval_create,(MPI_Copy_function* copy_fn, MPI_Delete_
 WRAPPED_PMPI_CALL(int,MPI_Keyval_free,(int* keyval) ,(keyval))
 WRAPPED_PMPI_CALL(int,MPI_Op_create,(MPI_User_function * function, int commute, MPI_Op * op),(function, commute, op))
 WRAPPED_PMPI_CALL(int,MPI_Op_free,(MPI_Op * op),(op))
+WRAPPED_PMPI_CALL(int,MPI_Op_commutative,(MPI_Op op, int *commute), (op, commute))
 WRAPPED_PMPI_CALL(int,MPI_Pack_size,(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) ,(incount, datatype, comm, size))
 WRAPPED_PMPI_CALL(int,MPI_Pack,(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) ,(inbuf, incount, type, outbuf, outcount, position, comm))
 WRAPPED_PMPI_CALL(int,MPI_Probe,(int source, int tag, MPI_Comm comm, MPI_Status* status) ,(source, tag, comm, status))
index d14354c..64ff2a3 100644 (file)
@@ -270,6 +270,17 @@ int PMPI_Op_free(MPI_Op * op)
   }
 }
 
+int PMPI_Op_commutative(MPI_Op op, int* commute){
+  if (op == MPI_OP_NULL) {
+    return MPI_ERR_OP;
+  } else if (commute==nullptr){
+    return MPI_ERR_ARG;
+  } else {
+    *commute = op->is_commutative();
+    return MPI_SUCCESS;
+  }
+}
+
 int PMPI_Group_free(MPI_Group * group)
 {
   if (group == nullptr) {
index 5a82de5..4ead9de 100644 (file)
@@ -80,7 +80,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
 #  add_executable(opband opband.c)
 #  add_executable(opbor opbor.c)
 #  add_executable(opbxor opbxor.c)
-#  add_executable(op_commutative op_commutative.c)
+  add_executable(op_commutative op_commutative.c)
 #  add_executable(opland opland.c)
 #  add_executable(oplor oplor.c)
 #  add_executable(oplxor oplxor.c)
@@ -172,7 +172,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
 #  target_link_libraries(opband  simgrid mtest_c)
 #  target_link_libraries(opbor  simgrid mtest_c)
 #  target_link_libraries(opbxor  simgrid mtest_c)
-#  target_link_libraries(op_commutative  simgrid mtest_c)
+  target_link_libraries(op_commutative  simgrid mtest_c)
 #  target_link_libraries(opland  simgrid mtest_c)
 #  target_link_libraries(oplor  simgrid mtest_c)
 #  target_link_libraries(oplxor  simgrid mtest_c)
index a3ac761..6158b7a 100644 (file)
@@ -12,7 +12,7 @@ allred6 7
 reduce_mpich 5
 reduce_mpich 10
 reduce_local 2 mpiversion=2.2
-#op_commutative 2
+op_commutative 2
 red3 10
 red4 10
 alltoall1 8