|
@@ -1,6 +1,6 @@
|
|
|
|
|
|
*
|
|
|
- * Copyright (C) 2010-2013 Université de Bordeaux
|
|
|
+ * Copyright (C) 2010-2014 Université de Bordeaux
|
|
|
* Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
|
|
|
* Copyright (C) 2014 Inria
|
|
|
*
|
|
@@ -86,6 +86,8 @@ void _starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, s
|
|
|
struct starpu_task *dep_task = task_array[i];
|
|
|
|
|
|
struct _starpu_job *dep_job;
|
|
|
+ struct _starpu_cg *back_cg = NULL;
|
|
|
+
|
|
|
dep_job = _starpu_get_job_associated_to_task(dep_task);
|
|
|
|
|
|
STARPU_ASSERT_MSG(dep_job != job, "A task must not depend on itself.");
|
|
@@ -97,6 +99,13 @@ void _starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, s
|
|
|
STARPU_ASSERT_MSG(!dep_job->submitted || !dep_job->task->regenerate, "For regenerated tasks, dependencies have to be set before first submission");
|
|
|
} else
|
|
|
STARPU_ASSERT_MSG(dep_job->terminated <= 1, "Task dependencies have to be set before termination (terminated %u)", dep_job->terminated);
|
|
|
+ if (dep_job->task->regenerate)
|
|
|
+ {
|
|
|
+
|
|
|
+ back_cg = create_cg_task(1, dep_job);
|
|
|
+
|
|
|
+ dep_job->job_successors.ndeps_completed++;
|
|
|
+ }
|
|
|
STARPU_PTHREAD_MUTEX_UNLOCK(&dep_job->sync_mutex);
|
|
|
|
|
|
_STARPU_TRACE_TASK_DEPS(dep_job, job);
|
|
@@ -110,6 +119,8 @@ void _starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, s
|
|
|
#endif
|
|
|
|
|
|
_starpu_task_add_succ(dep_job, cg);
|
|
|
+ if (dep_job->task->regenerate)
|
|
|
+ _starpu_task_add_succ(job, back_cg);
|
|
|
}
|
|
|
}
|
|
|
|