Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Parmap: process the whole dynar, don't force workers to fetch work
[simgrid.git] / src / xbt / parmap.c
index 4e79b71..8a86b36 100644 (file)
@@ -143,8 +143,9 @@ static void *xbt_parmap_worker_main(void *arg)
       XBT_DEBUG("Worker got a job");
 
       void* work = xbt_parmap_next(parmap);
       XBT_DEBUG("Worker got a job");
 
       void* work = xbt_parmap_next(parmap);
-      if (work != NULL) {
+      while (work != NULL) {
         parmap->fun(work);
         parmap->fun(work);
+        work = xbt_parmap_next(parmap);
       }
 
       XBT_DEBUG("Worker has finished");
       }
 
       XBT_DEBUG("Worker has finished");