Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
activate commute flag for MPI_Op, adds smpi_op_is_commute to test it (-1 FIXME !)
authorAugustin Degomme <degomme@idpann.imag.fr>
Mon, 10 Jun 2013 12:50:10 +0000 (14:50 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Mon, 10 Jun 2013 14:07:24 +0000 (16:07 +0200)
src/smpi/private.h
src/smpi/smpi_mpi_dt.c

index 642ddee..1f7d45d 100644 (file)
@@ -135,6 +135,7 @@ void smpi_datatype_commit(MPI_Datatype* datatype);
 
 void smpi_empty_status(MPI_Status * status);
 MPI_Op smpi_op_new(MPI_User_function * function, int commute);
+int smpi_op_is_commute(MPI_Op op);
 void smpi_op_destroy(MPI_Op op);
 void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len,
                    MPI_Datatype * datatype);
index 59512b6..6041b85 100644 (file)
@@ -1005,6 +1005,7 @@ void smpi_datatype_commit(MPI_Datatype *datatype)
 
 typedef struct s_smpi_mpi_op {
   MPI_User_function *func;
+  int is_commute;
 } s_smpi_mpi_op_t;
 
 #define MAX_OP(a, b)  (b) = (a) < (b) ? (b) : (a)
@@ -1326,7 +1327,7 @@ static void maxloc_func(void *a, void *b, int *length,
 
 
 #define CREATE_MPI_OP(name, func)                             \
-  static s_smpi_mpi_op_t mpi_##name = { &(func) /* func */ }; \
+  static s_smpi_mpi_op_t mpi_##name = { &(func) /* func */, TRUE }; \
 MPI_Op name = &mpi_##name;
 
 CREATE_MPI_OP(MPI_MAX, max_func);
@@ -1345,13 +1346,17 @@ CREATE_MPI_OP(MPI_MINLOC, minloc_func);
 MPI_Op smpi_op_new(MPI_User_function * function, int commute)
 {
   MPI_Op op;
-
-  //FIXME: add commute param
   op = xbt_new(s_smpi_mpi_op_t, 1);
   op->func = function;
+  op-> is_commute = commute;
   return op;
 }
 
+int smpi_op_is_commute(MPI_Op op)
+{
+  return op-> is_commute;
+}
+
 void smpi_op_destroy(MPI_Op op)
 {
   xbt_free(op);