Sfoglia il codice sorgente

Fix confusion between _starpu_prio_deque_push_back_task and _starpu_prio_deque_push_task

They were making the prio and heft components act as a LIFO for tasks with
same priorities instead of FIFO.

Thanks Adrien Rémy for the fix!
Samuel Thibault 7 anni fa
parent
commit
9b2dd005c7

+ 3 - 3
src/sched_policies/component_heft.c

@@ -130,7 +130,7 @@ static int heft_progress_one(struct starpu_sched_component *component)
 		STARPU_COMPONENT_MUTEX_LOCK(mutex);
 		for (n = ntasks - 1; n < ntasks; n--)
 			if ((int) n != best_task)
-				_starpu_prio_deque_push_back_task(prio, tasks[n]);
+				_starpu_prio_deque_push_task(prio, tasks[n]);
 		STARPU_COMPONENT_MUTEX_UNLOCK(mutex);
 
 		/* And now find out which worker suits best for this task,
@@ -173,7 +173,7 @@ static int heft_progress_one(struct starpu_sched_component *component)
 		{
 			/* Could not push to child actually, push that one back too */
 			STARPU_COMPONENT_MUTEX_LOCK(mutex);
-			_starpu_prio_deque_push_back_task(prio, tasks[best_task]);
+			_starpu_prio_deque_push_task(prio, tasks[best_task]);
 			STARPU_COMPONENT_MUTEX_UNLOCK(mutex);
 			return 1;
 		}
@@ -198,7 +198,7 @@ static int heft_push_task(struct starpu_sched_component * component, struct star
 	starpu_pthread_mutex_t * mutex = &data->mutex;
 
 	STARPU_COMPONENT_MUTEX_LOCK(mutex);
-	_starpu_prio_deque_push_task(prio,task);
+	_starpu_prio_deque_push_back_task(prio,task);
 	STARPU_COMPONENT_MUTEX_UNLOCK(mutex);
 
 	heft_progress(component);

+ 2 - 2
src/sched_policies/component_prio.c

@@ -132,10 +132,10 @@ static int prio_push_local_task(struct starpu_sched_component * component, struc
 	else
 	{
 		if(is_pushback)
-			ret = _starpu_prio_deque_push_back_task(prio,task);
+			ret = _starpu_prio_deque_push_task(prio,task);
 		else
 		{
-			ret = _starpu_prio_deque_push_task(prio,task);
+			ret = _starpu_prio_deque_push_back_task(prio,task);
 			starpu_sched_component_prefetch_on_node(component, task);
 			STARPU_TRACE_SCHED_COMPONENT_PUSH_PRIO(component, prio->ntasks, exp_len);
 		}