Ver código fonte

ws/lws: Fix case where we do not actually manage to steal a task

Samuel Thibault 4 anos atrás
pai
commit
99708951ec
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      src/sched_policies/work_stealing_policy.c

+ 2 - 2
src/sched_policies/work_stealing_policy.c

@@ -353,7 +353,7 @@ static struct starpu_task *ws_pick_task(struct _starpu_work_stealing_data *ws, i
 	else
 	else
 		task = _starpu_prio_deque_pop_task_for_worker(&data_source->queue, target, &skipped);
 		task = _starpu_prio_deque_pop_task_for_worker(&data_source->queue, target, &skipped);
 
 
-	if (!data_source->queue.ntasks)
+	if (task && !data_source->queue.ntasks)
 	{
 	{
 		STARPU_ASSERT(ws->per_worker[source].notask == 0);
 		STARPU_ASSERT(ws->per_worker[source].notask == 0);
 		ws->per_worker[source].notask = 1;
 		ws->per_worker[source].notask = 1;
@@ -400,7 +400,7 @@ static struct starpu_task *ws_pick_task(struct _starpu_work_stealing_data *ws, i
 	else
 	else
 		task = _starpu_prio_deque_pop_task_for_worker(&ws->per_worker[source].queue, target, &skipped);
 		task = _starpu_prio_deque_pop_task_for_worker(&ws->per_worker[source].queue, target, &skipped);
 
 
-	if (!ws->per_worker[source].queue.ntasks)
+	if (task && !ws->per_worker[source].queue.ntasks)
 	{
 	{
 		STARPU_ASSERT(ws->per_worker[source].notask == 0);
 		STARPU_ASSERT(ws->per_worker[source].notask == 0);
 		ws->per_worker[source].notask = 1;
 		ws->per_worker[source].notask = 1;