Browse Source

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

Samuel Thibault 8 years ago
parent
commit
e68fa87e93
1 changed files with 10 additions and 0 deletions
  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();
 	struct _starpu_machine_config *config = (struct _starpu_machine_config *)_starpu_get_machine_config();
 	if(config->topology.nsched_ctxs == 1)
 	if(config->topology.nsched_ctxs == 1)
+	{
+		_starpu_sched_do_schedule(0);
 		_starpu_wait_for_no_ready_of_sched_ctx(0);
 		_starpu_wait_for_no_ready_of_sched_ctx(0);
+	}
 	else
 	else
 	{
 	{
 		int s;
 		int s;
@@ -956,6 +959,13 @@ int starpu_task_wait_for_no_ready(void)
 		{
 		{
 			if(config->sched_ctxs[s].id != STARPU_NMAX_SCHED_CTXS)
 			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);
 				_starpu_wait_for_no_ready_of_sched_ctx(config->sched_ctxs[s].id);
 			}
 			}
 		}
 		}