X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9e6224ecd95ff7b6452fe9b2c088138877797542..8d067e4979cf07df41563994973b58dbcddbfc99:/src/smpi/colls/scatter-ompi.c diff --git a/src/smpi/colls/scatter-ompi.c b/src/smpi/colls/scatter-ompi.c index 7cce8aee4b..9d30811ccb 100644 --- a/src/smpi/colls/scatter-ompi.c +++ b/src/smpi/colls/scatter-ompi.c @@ -100,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) { @@ -145,13 +145,15 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount, total_send += mycount; } - if (NULL != tempbuf) - free(tempbuf); + } else { /* recv from parent on leaf nodes */ smpi_mpi_recv(ptmp, rcount, rdtype, bmtree->tree_prev, 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);