}
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) {
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);