Sfoglia il codice sorgente

Comments on 'soon' notification

Samuel Thibault 5 anni fa
parent
commit
e02244c166

+ 4 - 0
src/core/dependencies/cg.c

@@ -286,6 +286,8 @@ void _starpu_notify_cg(void *pred STARPU_ATTRIBUTE_UNUSED, struct _starpu_cg *cg
 	}
 }
 
+/* Called when a job has just started, so we can notify tasks which were waiting
+ * only for this one when they can expect to start */
 /* Note: in case of a tag, it must be already locked */
 void _starpu_notify_job_ready_soon_cg(void *pred STARPU_ATTRIBUTE_UNUSED, struct _starpu_cg *cg, _starpu_notify_job_start_data *data)
 {
@@ -389,6 +391,8 @@ void _starpu_notify_cg_list(void *pred, struct _starpu_cg_list *successors)
 	_starpu_spin_unlock(&successors->lock);
 }
 
+/* Called when a job has just started, so we can notify tasks which were waiting
+ * only for this one when they can expect to start */
 /* Caller just has to promise that the list will not disappear.
  * _starpu_notify_cg_list protects the list itself.
  * No job lock should be held, since we might want to immediately call the callback of an empty task.

+ 8 - 0
src/core/dependencies/dependencies.c

@@ -81,10 +81,18 @@ static void __starpu_job_notify_start(struct _starpu_job *j, double delay)
 	/* TODO: check data notification */
 }
 
+/* Called when the last dependency of this job has just started, so we know that
+ * this job will be released after the given delay. */
 void _starpu_job_notify_ready_soon(struct _starpu_job *j, _starpu_notify_job_start_data *data)
 {
 	struct starpu_task *task = j->task;
+
+	/* Notify that this task will start after the given delay */
 	notify_ready_soon_func(notify_ready_soon_func_data, task, data->delay);
+
+
+	/* Notify some known transitions as well */
+
 	if (!task->cl || task->cl->where == STARPU_NOWHERE || task->where == STARPU_NOWHERE)
 		/* This task will immediately terminate, so transition this */
 		__starpu_job_notify_start(_starpu_get_job_associated_to_task(task), data->delay);

+ 2 - 0
src/core/dependencies/tags.c

@@ -266,6 +266,8 @@ void _starpu_notify_tag_dependencies(struct _starpu_tag *tag)
 	_starpu_spin_unlock(&tag->lock);
 }
 
+/* Called when a job has just started, so we can notify tasks which were waiting
+ * only for this one when they can expect to start */
 void _starpu_notify_job_start_tag_dependencies(struct _starpu_tag *tag, _starpu_notify_job_start_data *data)
 {
 	_starpu_notify_job_start_cg_list(tag, &tag->tag_successors, data);

+ 2 - 0
src/core/dependencies/task_deps.c

@@ -66,6 +66,8 @@ void _starpu_notify_task_dependencies(struct _starpu_job *j)
 	_starpu_notify_cg_list(j, &j->job_successors);
 }
 
+/* Called when a job has just started, so we can notify tasks which were waiting
+ * only for this one when they can expect to start */
 void _starpu_notify_job_start_tasks(struct _starpu_job *j, _starpu_notify_job_start_data *data)
 {
 	_starpu_notify_job_start_cg_list(j, &j->job_successors, data);