X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9dcbaf12eae0cdee463970e9c8716a6bf70dd1e0..d504ff630c68bc8bf3e42a22ddcff4ebc62dbe51:/src/smpi/smpi_mpi_dt.c diff --git a/src/smpi/smpi_mpi_dt.c b/src/smpi/smpi_mpi_dt.c index 59512b6edd..6041b85688 100644 --- a/src/smpi/smpi_mpi_dt.c +++ b/src/smpi/smpi_mpi_dt.c @@ -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);