Explorar o código

Fix tags shared by several tasks: when submitting another task, it should not reset the 'done' property, as the tag is already signaled and should be kept as such

Samuel Thibault %!s(int64=13) %!d(string=hai) anos
pai
achega
2e4e7d6a40
Modificáronse 2 ficheiros con 5 adicións e 3 borrados
  1. 2 1
      src/core/dependencies/tags.c
  2. 3 2
      src/core/jobs.c

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

@@ -233,7 +233,8 @@ void _starpu_tag_declare(starpu_tag_t id, struct _starpu_job *job)
 
 	/* the tag is now associated to a job */
 	_starpu_spin_lock(&tag->lock);
-	tag->state = STARPU_ASSOCIATED;
+	if (tag->state != STARPU_DONE)
+		tag->state = STARPU_ASSOCIATED;
 	_starpu_spin_unlock(&tag->lock);
 }
 

+ 3 - 2
src/core/jobs.c

@@ -240,7 +240,7 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 
 	if (regenerate)
 	{
-		STARPU_ASSERT(detach && !destroy && !task->synchronous);
+		STARPU_ASSERT_MSG(detach && !destroy && !task->synchronous, "Regenerated task must be detached, and not have detroy=1 or synchronous=1");
 
 		/* We reuse the same job structure */
 		int ret = _starpu_submit_job(j);
@@ -277,7 +277,8 @@ static unsigned _starpu_not_all_tag_deps_are_fulfilled(struct _starpu_job *j)
 	else
 	{
 		/* existing deps (if any) are fulfilled */
-		tag->state = STARPU_READY;
+		if (tag->state != STARPU_DONE)
+			tag->state = STARPU_READY;
 		/* already prepare for next run */
 		tag_successors->ndeps_completed = 0;
 		ret = 0;