X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4d19d0578ec78430847de4271258e1d23ca67675..d0ffc37686edcc803601f76ab51fdfed5fc2f241:/src/smpi/colls/allreduce-smp-binomial.c diff --git a/src/smpi/colls/allreduce-smp-binomial.c b/src/smpi/colls/allreduce-smp-binomial.c index c73a6c6dab..77a5abcefe 100644 --- a/src/smpi/colls/allreduce-smp-binomial.c +++ b/src/smpi/colls/allreduce-smp-binomial.c @@ -1,4 +1,4 @@ -#include "colls.h" +#include "colls_private.h" /* IMPLEMENTED BY PITCH PATARASUK Non-topoloty-specific (however, number of cores/node need to be changed) all-reduce operation designed for smp clusters @@ -32,26 +32,16 @@ int smpi_coll_tuned_allreduce_smp_binomial(void *send_buf, void *recv_buf, { int comm_size, rank; void *tmp_buf; - int tag = 50; + int tag = COLL_TAG_ALLREDUCE; int mask, src, dst; int num_core = NUM_CORE; MPI_Status status; - /* - #ifdef MPICH2_REDUCTION - MPI_User_function * uop = MPIR_Op_table[op % 16 - 1]; - #else - MPI_User_function *uop; - struct MPIR_OP *op_ptr; - op_ptr = MPIR_ToPointer(op); - uop = op_ptr->op; - #endif - */ comm_size=smpi_comm_size(comm); rank=smpi_comm_rank(comm); MPI_Aint extent, lb; smpi_datatype_extent(dtype, &lb, &extent); - tmp_buf = (void *) malloc(count * extent); + tmp_buf = (void *) xbt_malloc(count * extent); /* compute intra and inter ranking */ int intra_rank, inter_rank; @@ -73,7 +63,7 @@ int smpi_coll_tuned_allreduce_smp_binomial(void *send_buf, void *recv_buf, src = (inter_rank * num_core) + (intra_rank | mask); if (src < comm_size) { smpi_mpi_recv(tmp_buf, count, dtype, src, tag, comm, &status); - star_reduction(op, tmp_buf, recv_buf, &count, &dtype); + smpi_op_apply(op, tmp_buf, recv_buf, &count, &dtype); } } else { dst = (inter_rank * num_core) + (intra_rank & (~mask)); @@ -92,7 +82,7 @@ int smpi_coll_tuned_allreduce_smp_binomial(void *send_buf, void *recv_buf, src = (inter_rank | mask) * num_core; if (src < comm_size) { smpi_mpi_recv(tmp_buf, count, dtype, src, tag, comm, &status); - star_reduction(op, tmp_buf, recv_buf, &count, &dtype); + smpi_op_apply(op, tmp_buf, recv_buf, &count, &dtype); } } else { dst = (inter_rank & (~mask)) * num_core;