Преглед изворни кода

fix: we must declare ghost dependencies when there is only one previous accessor

(cherry picked from commit d4e73b003db37fa87bfbee843c8fa1041c317e89)
PAW пре 6 година
родитељ
комит
8673f40662
1 измењених фајлова са 18 додато и 0 уклоњено
  1. 18 0
      src/core/dependencies/implicit_data_deps.c

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

@@ -324,6 +324,24 @@ struct starpu_task *_starpu_detect_implicit_data_deps_with_handle(struct starpu_
 					l->prev = NULL;
 					handle->last_submitted_accessors.next = &handle->last_submitted_accessors;
 					handle->last_submitted_accessors.prev = &handle->last_submitted_accessors;
+
+					{
+						/* Declare all dependencies with ghost accessors */
+						struct _starpu_jobid_list *ghost_accessors_id = handle->last_submitted_ghost_accessors_id;
+						while (ghost_accessors_id)
+						{
+							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);
+
+							struct _starpu_jobid_list *prev = ghost_accessors_id;
+							ghost_accessors_id = ghost_accessors_id->next;
+							free(prev);
+						}
+						handle->last_submitted_ghost_accessors_id = NULL;
+					}
 				}
 				else if (handle->last_submitted_ghost_accessors_id)
 				{