Sfoglia il codice sorgente

modular: Fix taking ntasks threshold and exp_len threshold independently

Samuel Thibault 6 anni fa
parent
commit
d4b057305b

+ 2 - 3
src/sched_policies/component_fifo.c

@@ -99,11 +99,10 @@ static int fifo_push_local_task(struct starpu_sched_component * component, struc
 	else
 		exp_len = fifo->exp_len;
 
-	if((data->ntasks_threshold != 0) && (data->exp_len_threshold != 0.0) &&
-			((fifo->ntasks >= data->ntasks_threshold) || (exp_len >= data->exp_len_threshold)))
+	if ((data->ntasks_threshold != 0 && fifo->ntasks >= data->ntasks_threshold) || (data->exp_len_threshold != 0.0 && exp_len >= data->exp_len_threshold))
 	{
 		static int warned;
-		if(task->predicted > data->exp_len_threshold && !warned)
+		if(data->exp_len_threshold != 0.0 && task->predicted > data->exp_len_threshold && !warned)
 		{
 			_STARPU_DISP("Warning : a predicted task length (%lf) exceeds the expected length threshold (%lf) of a prio component queue, you should reconsider the value of this threshold. This message will not be printed again for further thresholds exceeding.\n",task->predicted,data->exp_len_threshold);
 			warned = 1;

+ 2 - 3
src/sched_policies/component_prio.c

@@ -118,11 +118,10 @@ static int prio_push_local_task(struct starpu_sched_component * component, struc
 	else
 		exp_len = prio->exp_len;
 
-	if((data->ntasks_threshold != 0) && (data->exp_len_threshold != 0.0) &&
-			((prio->ntasks >= data->ntasks_threshold) || (exp_len >= data->exp_len_threshold)))
+	if ((data->ntasks_threshold != 0 && prio->ntasks >= data->ntasks_threshold) || (data->exp_len_threshold != 0.0 && exp_len >= data->exp_len_threshold))
 	{
 		static int warned;
-		if(task->predicted > data->exp_len_threshold && !warned)
+		if(data->exp_len_threshold != 0.0 && task->predicted > data->exp_len_threshold && !warned)
 		{
 			_STARPU_DISP("Warning : a predicted task length (%lf) exceeds the expected length threshold (%lf) of a prio component queue, you should reconsider the value of this threshold. This message will not be printed again for further thresholds exceeding.\n",task->predicted,data->exp_len_threshold);
 			warned = 1;