Browse Source

implicit deps: Use generic code for multiple dependencies, so that ghosts deps get added the same as the only non-ghost dep

Samuel Thibault 5 years ago
parent
commit
043bfdfe1a
1 changed files with 3 additions and 18 deletions
  1. 3 18
      src/core/dependencies/implicit_data_deps.c

+ 3 - 18
src/core/dependencies/implicit_data_deps.c

@@ -273,7 +273,8 @@ struct starpu_task *_starpu_detect_implicit_data_deps_with_handle(struct starpu_
 			_STARPU_DEP_DEBUG("dependency\n");
 			_STARPU_DEP_DEBUG("dependency\n");
 
 
 			if ((l != &handle->last_submitted_accessors && l->next != &handle->last_submitted_accessors)
 			if ((l != &handle->last_submitted_accessors && l->next != &handle->last_submitted_accessors)
-					|| (handle->last_submitted_ghost_accessors_id && handle->last_submitted_ghost_accessors_id->next))
+					|| (handle->last_submitted_ghost_accessors_id && handle->last_submitted_ghost_accessors_id->next)
+					|| (l != &handle->last_submitted_accessors && handle->last_submitted_ghost_accessors_id))
 			{
 			{
 				/* Several previous accessors */
 				/* Several previous accessors */
 
 
@@ -315,7 +316,7 @@ struct starpu_task *_starpu_detect_implicit_data_deps_with_handle(struct starpu_
 			else
 			else
 			{
 			{
 				struct _starpu_jobid_list *ghost_accessors_id = handle->last_submitted_ghost_accessors_id;
 				struct _starpu_jobid_list *ghost_accessors_id = handle->last_submitted_ghost_accessors_id;
-				/* At most one previous accessor and one ghost */
+				/* At most one previous accessor or one ghost */
 				if (l != &handle->last_submitted_accessors)
 				if (l != &handle->last_submitted_accessors)
 				{
 				{
 					/* One accessor, make it the sync task,
 					/* One accessor, make it the sync task,
@@ -326,22 +327,6 @@ struct starpu_task *_starpu_detect_implicit_data_deps_with_handle(struct starpu_
 					l->prev = NULL;
 					l->prev = NULL;
 					handle->last_submitted_accessors.next = &handle->last_submitted_accessors;
 					handle->last_submitted_accessors.next = &handle->last_submitted_accessors;
 					handle->last_submitted_accessors.prev = &handle->last_submitted_accessors;
 					handle->last_submitted_accessors.prev = &handle->last_submitted_accessors;
-
-#ifndef STARPU_USE_FXT
-					if (_starpu_bound_recording)
-#endif
-					if (ghost_accessors_id)
-					{
-						/* And add a dependency for the ghost */
-						unsigned long id = ghost_accessors_id->id;
-						_STARPU_TRACE_GHOST_TASK_DEPS(id, _starpu_get_job_associated_to_task(pre_sync_task));
-						_starpu_add_ghost_dependency(handle, id, pre_sync_task);
-						_STARPU_DEP_DEBUG("dep ID%lu -> %p\n", id, pre_sync_task);
-
-						STARPU_ASSERT(!ghost_accessors_id->next);
-						handle->last_submitted_ghost_accessors_id = NULL;
-						free(ghost_accessors_id);
-					}
 				}
 				}
 				else if (ghost_accessors_id)
 				else if (ghost_accessors_id)
 				{
 				{