X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/44a38683bc1680820d3c51bf3d02d462a575ead0..7e5c2f3a409fb782e912f80867b8573a54e0dc09:/src/smpi/colls/scatter-ompi.c diff --git a/src/smpi/colls/scatter-ompi.c b/src/smpi/colls/scatter-ompi.c index dbc223f715..9d30811ccb 100644 --- a/src/smpi/colls/scatter-ompi.c +++ b/src/smpi/colls/scatter-ompi.c @@ -20,7 +20,6 @@ #include "colls_private.h" #include "coll_tuned_topo.h" -#define MCA_COLL_BASE_TAG_SCATTER 111 int smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount, @@ -101,7 +100,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount, } total_send = scount; } else if (!(vrank % 2)) { - /* non-root, non-leaf nodes, allocte temp buffer for recv + /* non-root, non-leaf nodes, allocate temp buffer for recv * the most we need is rcount*size/2 */ tempbuf = (char *) malloc(rtrue_extent + (rcount*size - 1) * rextent); if (NULL == tempbuf) { @@ -123,7 +122,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount, if (rank != root) { /* recv from parent on non-root */ smpi_mpi_recv(ptmp, rcount*size, rdtype, bmtree->tree_prev, - MCA_COLL_BASE_TAG_SCATTER, comm, &status); + COLL_TAG_SCATTER, comm, &status); /* local copy to rbuf */ err = smpi_datatype_copy(ptmp, scount, sdtype, rbuf, rcount, rdtype); @@ -140,19 +139,21 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount, smpi_mpi_send(ptmp + total_send*sextent, mycount, sdtype, bmtree->tree_next[i], - MCA_COLL_BASE_TAG_SCATTER, + COLL_TAG_SCATTER, comm); total_send += mycount; } - if (NULL != tempbuf) - free(tempbuf); + } else { /* recv from parent on leaf nodes */ smpi_mpi_recv(ptmp, rcount, rdtype, bmtree->tree_prev, - MCA_COLL_BASE_TAG_SCATTER, comm, &status); + COLL_TAG_SCATTER, comm, &status); } + + if (NULL != tempbuf) + free(tempbuf); //!FIXME : store the tree, as done in ompi, instead of calculating it each time ? xbt_free(bmtree); @@ -209,7 +210,7 @@ smpi_coll_tuned_scatter_ompi_basic_linear(void *sbuf, int scount, if (rank != root) { smpi_mpi_recv(rbuf, rcount, rdtype, root, - MCA_COLL_BASE_TAG_SCATTER, + COLL_TAG_SCATTER, comm, MPI_STATUS_IGNORE); return MPI_SUCCESS; } @@ -234,7 +235,7 @@ smpi_coll_tuned_scatter_ompi_basic_linear(void *sbuf, int scount, } } else { smpi_mpi_send(ptmp, scount, sdtype, i, - MCA_COLL_BASE_TAG_SCATTER, + COLL_TAG_SCATTER, comm); } if (MPI_SUCCESS != err) {