Explorar o código

Fix termination of programes not waiting for tasks, with graph_test scheduler

Samuel Thibault %!s(int64=8) %!d(string=hai) anos
pai
achega
e68fa87e93
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      src/core/task.c

+ 10 - 0
src/core/task.c

@@ -948,7 +948,10 @@ int starpu_task_wait_for_no_ready(void)
 
 	struct _starpu_machine_config *config = (struct _starpu_machine_config *)_starpu_get_machine_config();
 	if(config->topology.nsched_ctxs == 1)
+	{
+		_starpu_sched_do_schedule(0);
 		_starpu_wait_for_no_ready_of_sched_ctx(0);
+	}
 	else
 	{
 		int s;
@@ -956,6 +959,13 @@ int starpu_task_wait_for_no_ready(void)
 		{
 			if(config->sched_ctxs[s].id != STARPU_NMAX_SCHED_CTXS)
 			{
+				_starpu_sched_do_schedule(config->sched_ctxs[s].id);
+			}
+		}
+		for(s = 0; s < STARPU_NMAX_SCHED_CTXS; s++)
+		{
+			if(config->sched_ctxs[s].id != STARPU_NMAX_SCHED_CTXS)
+			{
 				_starpu_wait_for_no_ready_of_sched_ctx(config->sched_ctxs[s].id);
 			}
 		}