Browse Source

Call post_exec scheduler hook before releasing dependencies, so the scheduler has a chance to work on the tasks which were depending on this task

Samuel Thibault 8 years ago
parent
commit
8ad603c5a1
1 changed files with 24 additions and 24 deletions
  1. 24 24
      src/core/jobs.c

+ 24 - 24
src/core/jobs.c

@@ -336,6 +336,30 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 		_starpu_release_task_enforce_sequential_consistency(j);
 	}
 
+	/* If the job was executed on a combined worker there is no need for the
+	 * 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->cl->where != STARPU_NOWHERE && !j->internal
+#ifdef STARPU_OPENMP
+	/* If this is a continuation, we do not execute the post_exec_hook. The
+	 * post_exec_hook will be run only when the continued task fully
+	 * completes.
+	 *
+	 * Note: If needed, a specific hook could be added to handle stopped
+	 * tasks */
+	&& !continuation
+#endif
+			)
+	{
+		_starpu_sched_post_exec_hook(task);
+#ifdef STARPU_USE_SC_HYPERVISOR
+		int workerid = starpu_worker_get_id();
+		_starpu_sched_ctx_post_exec_task_cb(workerid, task, data_size, j->footprint);
+#endif //STARPU_USE_SC_HYPERVISOR
+
+	}
+
 	/* Remove ourself from the graph before notifying dependencies */
 	if (_starpu_graph_record)
 		_starpu_graph_drop_job(j);
@@ -404,30 +428,6 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 		}
 	}
 
-	/* If the job was executed on a combined worker there is no need for the
-	 * 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->cl->where != STARPU_NOWHERE && !j->internal
-#ifdef STARPU_OPENMP
-	/* If this is a continuation, we do not execute the post_exec_hook. The
-	 * post_exec_hook will be run only when the continued task fully
-	 * completes.
-	 *
-	 * Note: If needed, a specific hook could be added to handle stopped
-	 * tasks */
-	&& !continuation
-#endif
-			)
-	{
-		_starpu_sched_post_exec_hook(task);
-#ifdef STARPU_USE_SC_HYPERVISOR
-		int workerid = starpu_worker_get_id();
-		_starpu_sched_ctx_post_exec_task_cb(workerid, task, data_size, j->footprint);
-#endif //STARPU_USE_SC_HYPERVISOR
-
-	}
-
 	/* Note: For now, we keep the TASK_DONE trace event for continuation,
 	 * however we could add a specific event for stopped tasks if needed.
 	 */