Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce the use of simcall_process_sleep() -> this_actor::sleep_for()
[simgrid.git] / src / smpi / colls / reduce / reduce-arrival-pattern-aware.cpp
index 8f0b202..1ff8bd4 100644 (file)
@@ -68,8 +68,7 @@ int Coll_reduce_arrival_pattern_aware::reduce(const void *buf, void *rbuf,
     already_received[i] = 0;
   }
 
-  char *tmp_buf;
-  tmp_buf = (char *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   Request::sendrecv(buf, count, datatype, rank, tag, rbuf, count, datatype, rank,
                tag, comm, &status);
@@ -86,11 +85,10 @@ int Coll_reduce_arrival_pattern_aware::reduce(const void *buf, void *rbuf,
 
         for (i = 1; i < size; i++) {
           if (already_received[i] == 0) {
-            Request::iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
-                             MPI_STATUSES_IGNORE);
-            simcall_process_sleep(0.0001);
+            Request::iprobe(i, MPI_ANY_TAG, comm, &flag_array[i], MPI_STATUSES_IGNORE);
+            simgrid::s4u::this_actor::sleep_for(0.0001);
+          }
             }
-        }
 
         header_index = 0;
         /* recv 1-byte message */