Explorar el Código

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 hace 15 años
padre
commit
abb0b07d97
Se han modificado 2 ficheros con 2 adiciones y 3 borrados
  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)
 		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);
 }
 

+ 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. */
 int _starpu_submit_job(starpu_job_t j, unsigned do_not_increment_nsubmitted)
 {
+	j->terminated = 0;
+
 	if (!do_not_increment_nsubmitted)
 		_starpu_increment_nsubmitted_tasks();