浏览代码

make use of _starpu_worker_may_execute_task instead of hardcoding it

Samuel Thibault 14 年之前
父节点
当前提交
67bca51106
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 1 2
      src/sched_policies/deque_queues.c
  2. 2 2
      src/sched_policies/fifo_queues.c

+ 1 - 2
src/sched_policies/deque_queues.c

@@ -83,7 +83,6 @@ struct starpu_task *_starpu_deque_pop_task(struct starpu_deque_jobq_s *deque_que
 struct starpu_job_list_s *_starpu_deque_pop_every_task(struct starpu_deque_jobq_s *deque_queue, pthread_mutex_t *sched_mutex, int workerid)
 struct starpu_job_list_s *_starpu_deque_pop_every_task(struct starpu_deque_jobq_s *deque_queue, pthread_mutex_t *sched_mutex, int workerid)
 {
 {
 	struct starpu_job_list_s *new_list, *old_list;
 	struct starpu_job_list_s *new_list, *old_list;
-	uint32_t where = starpu_worker_get_type(workerid);
 
 
 	/* block until some task is available in that queue */
 	/* block until some task is available in that queue */
 	PTHREAD_MUTEX_LOCK(sched_mutex);
 	PTHREAD_MUTEX_LOCK(sched_mutex);
@@ -109,7 +108,7 @@ struct starpu_job_list_s *_starpu_deque_pop_every_task(struct starpu_deque_jobq_
 		{
 		{
 			next_job = starpu_job_list_next(i);
 			next_job = starpu_job_list_next(i);
 
 
-			if (i->task->cl->where & where)
+			if (_starpu_worker_may_execute_task(workerid, i->task))
 			{
 			{
 				/* this elements can be moved into the new list */
 				/* this elements can be moved into the new list */
 				new_list_size++;
 				new_list_size++;

+ 2 - 2
src/sched_policies/fifo_queues.c

@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <errno.h>
 #include <common/utils.h>
 #include <common/utils.h>
 #include <core/task.h>
 #include <core/task.h>
+#include <core/workers.h>
 
 
 struct starpu_fifo_taskq_s *_starpu_create_fifo(void)
 struct starpu_fifo_taskq_s *_starpu_create_fifo(void)
 {
 {
@@ -101,7 +102,6 @@ struct starpu_task *_starpu_fifo_pop_every_task(struct starpu_fifo_taskq_s *fifo
 {
 {
 	struct starpu_task_list *old_list;
 	struct starpu_task_list *old_list;
 	unsigned size;
 	unsigned size;
-	uint32_t where = starpu_worker_get_type(workerid);
 
 
 	struct starpu_task *new_list = NULL;
 	struct starpu_task *new_list = NULL;
 	struct starpu_task *new_list_tail = NULL;
 	struct starpu_task *new_list_tail = NULL;
@@ -122,7 +122,7 @@ struct starpu_task *_starpu_fifo_pop_every_task(struct starpu_fifo_taskq_s *fifo
 		{
 		{
 			next_task = task->next;
 			next_task = task->next;
 
 
-			if (task->cl->where & where)
+			if (_starpu_worker_may_execute_task(workerid, task))
 			{
 			{
 				/* this elements can be moved into the new list */
 				/* this elements can be moved into the new list */
 				new_list_size++;
 				new_list_size++;