Sfoglia il codice sorgente

control_task was replaced with exclude_from_dag + hypervisor_tag commented

Andra Hugo 12 anni fa
parent
commit
bc2478ce2d
3 ha cambiato i file con 9 aggiunte e 13 eliminazioni
  1. 1 5
      include/starpu_task.h
  2. 1 1
      src/core/jobs.c
  3. 7 7
      src/core/task.c

+ 1 - 5
include/starpu_task.h

@@ -204,10 +204,7 @@ struct starpu_task
 	/* Scheduling context */
 	unsigned sched_ctx;
 
-	/* flag to differentiate tasks needed by starpu management purposes
-	 from the ones provided by the appl*/
-	unsigned control_task;
-
+  /* Helps the hypervisor monitor the execution of this task */
 	int hypervisor_tag;
 
 	/* Number of flops computed by this tag, used by resource reallocation for contexts */
@@ -244,7 +241,6 @@ struct starpu_task
 	.starpu_private = NULL,				\
 	.magic = 42,                  			\
 	.sched_ctx = 0,					\
-	.control_task = 0,				\
 	.hypervisor_tag = 0,				\
 	.flops = 0.0,					\
 	.already_pushed = 0,				\

+ 1 - 1
src/core/jobs.c

@@ -203,7 +203,7 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 	 * scheduler to process it : the task structure doesn't contain any valuable
 	 * data as it's not linked to an actual worker */
 	/* control task should not execute post_exec_hook */
-	if(j->task_size == 1 && task->cl != NULL && !task->control_task)
+	if(j->task_size == 1 && task->cl != NULL && !j->exclude_from_dag)
 	{
 		_starpu_sched_post_exec_hook(task);
 #ifdef STARPU_USE_SCHED_CTX_HYPERVISOR

+ 7 - 7
src/core/task.c

@@ -371,7 +371,12 @@ int starpu_task_submit(struct starpu_task *task)
 	unsigned nsched_ctxs = _starpu_get_nsched_ctxs();
 	unsigned set_sched_ctx = STARPU_NMAX_SCHED_CTXS;
 
-	if (task->sched_ctx == 0 && nsched_ctxs != 1 && !task->control_task)
+	/* internally, StarPU manipulates a struct _starpu_job * which is a wrapper around a
+	* task structure, it is possible that this job structure was already
+	* allocated. */
+	struct _starpu_job *j = _starpu_get_job_associated_to_task(task);
+
+	if (task->sched_ctx == 0 && nsched_ctxs != 1 && !j->exclude_from_dag)
 	{
 		set_sched_ctx = starpu_task_get_context();
 		if (set_sched_ctx != STARPU_NMAX_SCHED_CTXS)
@@ -394,11 +399,6 @@ int starpu_task_submit(struct starpu_task *task)
 	_starpu_task_check_deprecated_fields(task);
 	_starpu_codelet_check_deprecated_fields(task->cl);
 
-	/* internally, StarPU manipulates a struct _starpu_job * which is a wrapper around a
-	* task structure, it is possible that this job structure was already
-	* allocated. */
-	struct _starpu_job *j = _starpu_get_job_associated_to_task(task);
-
 	if (task->cl)
 	{
 		unsigned i;
@@ -496,7 +496,7 @@ int starpu_task_submit(struct starpu_task *task)
 
 int _starpu_task_submit_internally(struct starpu_task *task)
 {
-	task->control_task = 1;
+	_starpu_exclude_task_from_dag(task);
 	return starpu_task_submit(task);
 }