Переглянути джерело

lws: Fix spurious sleep in simgrid mode

If we fail to steal another worker because it is busy, we have to make sure
to come back trying to steal again, otherwise we would got to sleep and
possibly never wake up again.
Samuel Thibault 4 роки тому
батько
коміт
8774c8486c
1 змінених файлів з 5 додано та 0 видалено
  1. 5 0
      src/sched_policies/work_stealing_policy.c

+ 5 - 0
src/sched_policies/work_stealing_policy.c

@@ -610,6 +610,11 @@ static struct starpu_task *ws_pop_task(unsigned sched_ctx_id)
 	if (_starpu_worker_trylock(victim))
 	if (_starpu_worker_trylock(victim))
 	{
 	{
 		/* victim is busy, don't bother it, come back later */
 		/* victim is busy, don't bother it, come back later */
+#ifdef STARPU_SIMGRID
+		starpu_sleep(0.000001);
+		/* Make sure we come back and not block */
+		starpu_wake_worker_no_relax(workerid);
+#endif
 		return NULL;
 		return NULL;
 	}
 	}
 	if (ws->per_worker[victim].running && ws->per_worker[victim].queue.ntasks > 0)
 	if (ws->per_worker[victim].running && ws->per_worker[victim].queue.ntasks > 0)