X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e7c0c67af63b3979a597a66e5e1c8b0435fc6e19..e2093200437e2b32ece25429c4ce43c2ba1ffde5:/src/smpi/colls/allreduce-smp-binomial-pipeline.c?ds=sidebyside diff --git a/src/smpi/colls/allreduce-smp-binomial-pipeline.c b/src/smpi/colls/allreduce-smp-binomial-pipeline.c index 05ecfd6cf8..68c99f5bcf 100644 --- a/src/smpi/colls/allreduce-smp-binomial-pipeline.c +++ b/src/smpi/colls/allreduce-smp-binomial-pipeline.c @@ -29,18 +29,6 @@ int allreduce_smp_binomial_pipeline_segment_size = 4096; This code assume commutative and associative reduce operator (MPI_SUM, MPI_MAX, etc). */ -#ifndef MPICH2 -extern void *MPIR_ToPointer(); - -struct MPIR_OP { - MPI_User_function *op; - int commute, permanent; -}; - -#else -extern MPI_User_function *MPIR_Op_table[]; -#endif - /* This fucntion performs all-reduce operation as follow. ** in a pipeline fashion ** 1) binomial_tree reduce inside each SMP node @@ -55,19 +43,11 @@ int smpi_coll_tuned_allreduce_smp_binomial_pipeline(void *send_buf, { int comm_size, rank; void *tmp_buf; - int tag = 50; + int tag = COLL_TAG_ALLREDUCE; int mask, src, dst; MPI_Status status; int num_core = NUM_CORE; - MPI_User_function *uop; -#ifndef MPICH2 - struct MPIR_OP *op_ptr = MPIR_ToPointer(op); - uop = (MPI_User_function *) op_ptr->op; -#else - uop = MPIR_Op_table[op % 16 - 1]; -#endif - comm_size = smpi_comm_size(comm); rank = smpi_comm_rank(comm); MPI_Aint extent; @@ -111,7 +91,7 @@ int smpi_coll_tuned_allreduce_smp_binomial_pipeline(void *send_buf, if (src < comm_size) { recv_offset = phase * pcount * extent; smpi_mpi_recv(tmp_buf, pcount, dtype, src, tag, comm, &status); - (*uop) (tmp_buf, (char *)recv_buf + recv_offset, &pcount, &dtype); + smpi_op_apply(op, tmp_buf, (char *)recv_buf + recv_offset, &pcount, &dtype); } } else { send_offset = phase * pcount * extent; @@ -135,7 +115,7 @@ int smpi_coll_tuned_allreduce_smp_binomial_pipeline(void *send_buf, if (src < comm_size) { recv_offset = (phase - 1) * pcount * extent; smpi_mpi_recv(tmp_buf, pcount, dtype, src, tag, comm, &status); - (*uop) (tmp_buf, (char *)recv_buf + recv_offset, &pcount, &dtype); + smpi_op_apply(op, tmp_buf, (char *)recv_buf + recv_offset, &pcount, &dtype); } } else { dst = (inter_rank & (~mask)) * num_core;