Quellcode durchsuchen

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 vor 14 Jahren
Ursprung
Commit
2e4e7d6a40
2 geänderte Dateien mit 5 neuen und 3 gelöschten Zeilen
  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 */
 	/* the tag is now associated to a job */
 	_starpu_spin_lock(&tag->lock);
 	_starpu_spin_lock(&tag->lock);
-	tag->state = STARPU_ASSOCIATED;
+	if (tag->state != STARPU_DONE)
+		tag->state = STARPU_ASSOCIATED;
 	_starpu_spin_unlock(&tag->lock);
 	_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)
 	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 */
 		/* We reuse the same job structure */
 		int ret = _starpu_submit_job(j);
 		int ret = _starpu_submit_job(j);
@@ -277,7 +277,8 @@ static unsigned _starpu_not_all_tag_deps_are_fulfilled(struct _starpu_job *j)
 	else
 	else
 	{
 	{
 		/* existing deps (if any) are fulfilled */
 		/* existing deps (if any) are fulfilled */
-		tag->state = STARPU_READY;
+		if (tag->state != STARPU_DONE)
+			tag->state = STARPU_READY;
 		/* already prepare for next run */
 		/* already prepare for next run */
 		tag_successors->ndeps_completed = 0;
 		tag_successors->ndeps_completed = 0;
 		ret = 0;
 		ret = 0;