From: Augustin Degomme Date: Mon, 10 Jun 2013 12:50:10 +0000 (+0200) Subject: activate commute flag for MPI_Op, adds smpi_op_is_commute to test it (-1 FIXME !) X-Git-Tag: v3_9_90~299 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d504ff630c68bc8bf3e42a22ddcff4ebc62dbe51?hp=0b7eb8f8385af2b5e0e5e3f6659d6214a503a9af activate commute flag for MPI_Op, adds smpi_op_is_commute to test it (-1 FIXME !) --- diff --git a/src/smpi/private.h b/src/smpi/private.h index 642ddee771..1f7d45d14a 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -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); 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);