Browse Source

We must not reset the j->terminated flag until the job is actually reused,
otherwise it is not possible to enforce dependencies with (synchronous) tasks
that have already been executed.

Cédric Augonnet 15 years ago
parent
commit
abb0b07d97
2 changed files with 2 additions and 3 deletions
  1. 0 3
      src/core/jobs.c
  2. 2 0
      src/core/task.c

+ 0 - 3
src/core/jobs.c

@@ -84,9 +84,6 @@ void _starpu_wait_job(starpu_job_t j)
 	while (!j->terminated)
 	while (!j->terminated)
 		pthread_cond_wait(&j->sync_cond, &j->sync_mutex);
 		pthread_cond_wait(&j->sync_cond, &j->sync_mutex);
 
 
-	/* reset the job state so that it can be reused again */
-	j->terminated = 0;
-
 	PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 	PTHREAD_MUTEX_UNLOCK(&j->sync_mutex);
 }
 }
 
 

+ 2 - 0
src/core/task.c

@@ -148,6 +148,8 @@ starpu_job_t _starpu_get_job_associated_to_task(struct starpu_task *task)
  * already counted. */
  * already counted. */
 int _starpu_submit_job(starpu_job_t j, unsigned do_not_increment_nsubmitted)
 int _starpu_submit_job(starpu_job_t j, unsigned do_not_increment_nsubmitted)
 {
 {
+	j->terminated = 0;
+
 	if (!do_not_increment_nsubmitted)
 	if (!do_not_increment_nsubmitted)
 		_starpu_increment_nsubmitted_tasks();
 		_starpu_increment_nsubmitted_tasks();