Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add template for copyright header.
[simgrid.git] / src / smpi / colls / scatter-ompi.c
index c65b6f9511f374f45a7677ca94327fac11df7b72..9d30811ccb66f535cec134149b58a7787d62c0e7 100644 (file)
@@ -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);