Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix mismatched alloc/free.
[simgrid.git] / src / smpi / colls / smpi_default_selector.cpp
index aa44938..d6126c7 100644 (file)
@@ -74,9 +74,8 @@ int Coll_reduce_scatter_default::reduce_scatter(void *sendbuf, void *recvbuf, in
     count += recvcounts[i];
   }
   void *tmpbuf = static_cast<void*>(smpi_get_tmp_sendbuffer(count*datatype->get_extent()));
-  int ret = MPI_SUCCESS;
 
-  ret = Coll_reduce_default::reduce(sendbuf, tmpbuf, count, datatype, op, 0, comm);
+  int ret = Coll_reduce_default::reduce(sendbuf, tmpbuf, count, datatype, op, 0, comm);
   if(ret==MPI_SUCCESS)
     ret = Colls::scatterv(tmpbuf, recvcounts, displs, datatype, recvbuf, recvcounts[rank], datatype, 0, comm);
   xbt_free(displs);
@@ -238,10 +237,7 @@ int Coll_reduce_default::reduce(void *sendbuf, void *recvbuf, int count, MPI_Dat
     int index = 0;
     for (int src = 0; src < size; src++) {
       if (src != root) {
-        if (not smpi_process()->replaying())
-          tmpbufs[index] = xbt_malloc(count * dataext);
-         else
-           tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
+        tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
         requests[index] =
           Request::irecv_init(tmpbufs[index], count, datatype, src, system_tag, comm);
         index++;