浏览代码

port r11354 and 11355 from 1.1: There is no need to signal workers in non-blocking mode

Samuel Thibault 11 年之前
父节点
当前提交
19ed150528

+ 4 - 1
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -357,7 +357,9 @@ static int push_task_on_best_worker(struct starpu_task *task, int best_workerid,
 	{
 		STARPU_PTHREAD_MUTEX_LOCK(sched_mutex);
 		ret =_starpu_fifo_push_sorted_task(dt->queue_array[best_workerid], task);
+#ifndef STARPU_NON_BLOCKING_DRIVERS
 		STARPU_PTHREAD_COND_SIGNAL(sched_cond);
+#endif
 		starpu_push_task_end(task);
 		STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 	}
@@ -367,8 +369,9 @@ static int push_task_on_best_worker(struct starpu_task *task, int best_workerid,
 		starpu_task_list_push_back (&dt->queue_array[best_workerid]->taskq, task);
 		dt->queue_array[best_workerid]->ntasks++;
 		dt->queue_array[best_workerid]->nprocessed++;
-		
+#ifndef STARPU_NON_BLOCKING_DRIVERS
 		STARPU_PTHREAD_COND_SIGNAL(sched_cond);
+#endif
 		starpu_push_task_end(task);
 		STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 	}

+ 4 - 0
src/sched_policies/eager_central_priority_policy.c

@@ -142,6 +142,7 @@ static int _starpu_priority_push_task(struct starpu_task *task)
 	if(workers->init_iterator)
 		workers->init_iterator(workers, &it);
 	
+#ifndef STARPU_NON_BLOCKING_DRIVERS
 	while(workers->has_next(workers, &it))
 	{
 		worker = workers->get_next(workers, &it);
@@ -152,6 +153,7 @@ static int _starpu_priority_push_task(struct starpu_task *task)
 		if (starpu_wakeup_worker(worker, sched_cond, sched_mutex))
 		    break; // wake up a single worker
 	}
+#endif
 
 #endif
 	return 0;
@@ -224,6 +226,7 @@ static struct starpu_task *_starpu_priority_pop_task(unsigned sched_ctx_id)
 		if(workers->init_iterator)
 			workers->init_iterator(workers, &it);
 		
+#ifndef STARPU_NON_BLOCKING_DRIVERS
 		while(workers->has_next(workers, &it))
 		{
 			worker = workers->get_next(workers, &it);
@@ -237,6 +240,7 @@ static struct starpu_task *_starpu_priority_pop_task(unsigned sched_ctx_id)
 				STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 			}
 		}
+#endif
 	
 	}
 

+ 4 - 0
src/sched_policies/parallel_eager.c

@@ -165,6 +165,7 @@ static int push_task_peager_policy(struct starpu_task *task)
                 workers->init_iterator(workers, &it);
 
 
+#ifndef STARPU_NON_BLOCKING_DRIVERS
 	while(workers->has_next(workers, &it))
 	{
 		worker = workers->get_next(workers, &it);
@@ -183,6 +184,7 @@ static int push_task_peager_policy(struct starpu_task *task)
 			STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 		}
 	}
+#endif
 
 	return ret_val;
 }
@@ -273,7 +275,9 @@ static struct starpu_task *pop_task_peager_policy(unsigned sched_ctx_id)
 
 				_starpu_fifo_push_task(data->local_fifo[local_worker], alias);
 
+#ifndef STARPU_NON_BLOCKING_DRIVERS
 				STARPU_PTHREAD_COND_SIGNAL(sched_cond);
+#endif
 				STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 
 			}

+ 3 - 1
src/sched_policies/stack_queues.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2012  Université de Bordeaux 1
+ * Copyright (C) 2010-2013  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -70,7 +70,9 @@ void _starpu_stack_push_task(struct _starpu_stack_jobq *stack_queue, starpu_pthr
 	stack_queue->njobs++;
 	stack_queue->nprocessed++;
 
+#ifndef STARPU_NON_BLOCKING_DRIVERS
 	STARPU_PTHREAD_COND_SIGNAL(sched_cond);
+#endif
 	STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 }
 

+ 2 - 0
src/sched_policies/work_stealing_policy.c

@@ -383,7 +383,9 @@ int ws_push_task(struct starpu_task *task)
 		starpu_pthread_mutex_t *sched_mutex;
 		starpu_pthread_cond_t *sched_cond;
 		starpu_worker_get_sched_condition(worker, &sched_mutex, &sched_cond);
+#ifndef STARPU_NON_BLOCKING_DRIVERS
 		STARPU_PTHREAD_COND_SIGNAL(sched_cond);
+#endif
 		STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 	}