Prechádzať zdrojové kódy

Fix tracing nready and nsubmitted after r15808 broke it

Samuel Thibault 9 rokov pred
rodič
commit
203b3db100
3 zmenil súbory, kde vykonal 15 pridanie a 1 odobranie
  1. 2 0
      src/core/jobs.c
  2. 12 1
      src/core/sched_policy.c
  3. 1 0
      src/core/sched_policy.h

+ 2 - 0
src/core/jobs.c

@@ -693,6 +693,7 @@ struct starpu_task *_starpu_pop_local_task(struct _starpu_worker *worker)
 			/* Next ordered task is there, return it */
 			worker->current_ordered_task = (worker->current_ordered_task + 1) % worker->local_ordered_tasks_size;
 			worker->current_ordered_task_order++;
+			_starpu_pop_task_end(task);
 			return task;
 		}
 	}
@@ -700,6 +701,7 @@ struct starpu_task *_starpu_pop_local_task(struct _starpu_worker *worker)
 	if (!starpu_task_list_empty(&worker->local_tasks))
 		task = starpu_task_list_pop_front(&worker->local_tasks);
 
+	_starpu_pop_task_end(task);
 	return task;
 }
 

+ 12 - 1
src/core/sched_policy.c

@@ -572,12 +572,22 @@ int _starpu_push_task_to_workers(struct starpu_task *task)
  */
 int starpu_push_task_end(struct starpu_task *task)
 {
-	_STARPU_TRACE_JOB_POP(task, task->priority > 0);
 	_starpu_profiling_set_task_push_end_time(task);
 	task->scheduled = 1;
 	return 0;
 }
 
+/* This is called right after the scheduler has pushed a task to a queue
+ * but just before releasing mutexes: we need the task to still be alive!
+ */
+int _starpu_pop_task_end(struct starpu_task *task)
+{
+	if (!task)
+		return 0;
+	_STARPU_TRACE_JOB_POP(task, task->priority > 0);
+	return 0;
+}
+
 /*
  * Given a handle that needs to be converted in order to be used on the given
  * node, returns a task that takes care of the conversion.
@@ -789,6 +799,7 @@ pick:
 				if (sched_ctx->sched_policy && sched_ctx->sched_policy->pop_task)
 				{
 					task = sched_ctx->sched_policy->pop_task(sched_ctx->id);
+					_starpu_pop_task_end(task);
 				}
 			}
 			

+ 1 - 0
src/core/sched_policy.h

@@ -44,6 +44,7 @@ struct starpu_task *_starpu_pop_task(struct _starpu_worker *worker);
 /* pop every task that can be executed on the worker */
 struct starpu_task *_starpu_pop_every_task(struct _starpu_sched_ctx *sched_ctx);
 void _starpu_sched_post_exec_hook(struct starpu_task *task);
+int _starpu_pop_task_end(struct starpu_task *task);
 
 void _starpu_wait_on_sched_event(void);