Forráskód Böngészése

Bug fix: partially revert commit 2488. There was actually 2 modifications in
that commit, we maintain a list of ghost deps and we don't recompute the length
of the list of readers all the time: the latter optimization seems to break
asynchronous data requests so we remove it for now.

Cédric Augonnet 15 éve
szülő
commit
0bd8b67548

+ 9 - 6
src/core/dependencies/implicit_data_deps.c

@@ -83,7 +83,15 @@ void _starpu_detect_implicit_data_deps_with_handle(struct starpu_task *pre_sync_
 				/* Count the readers */
 				unsigned nreaders = 0;
 				struct starpu_task_list *l;
-				struct starpu_task *task_array[handle->last_submitted_readers_count];
+				l = handle->last_submitted_readers;
+				while (l)
+				{
+					nreaders++;
+					l = l->next;
+				}
+
+				struct starpu_task *task_array[nreaders];
+
 				unsigned i = 0;
 				l = handle->last_submitted_readers;
 				while (l)
@@ -95,9 +103,6 @@ void _starpu_detect_implicit_data_deps_with_handle(struct starpu_task *pre_sync_
 					l = l->next;
 					free(prev);
 				}
-
-				handle->last_submitted_readers_count = 0;
-
 #ifdef STARPU_USE_FXT
 				/* Declare all dependencies with ghost readers */
 				starpu_job_t post_sync_job = _starpu_get_job_associated_to_task(post_sync_task);
@@ -133,8 +138,6 @@ void _starpu_detect_implicit_data_deps_with_handle(struct starpu_task *pre_sync_
 			link->next = handle->last_submitted_readers;
 			handle->last_submitted_readers = link;
 
-			handle->last_submitted_readers_count++;
-
 			/* This task depends on the previous writer if any */
 			if (handle->last_submitted_writer)
 			{

+ 0 - 1
src/datawizard/coherency.h

@@ -132,7 +132,6 @@ struct starpu_data_state_t {
 	 * sequential_consistency flag is enabled. */
 	starpu_access_mode last_submitted_mode;
 	struct starpu_task *last_submitted_writer;
-	unsigned last_submitted_readers_count;
 	struct starpu_task_list *last_submitted_readers;
 
 #ifdef STARPU_USE_FXT

+ 0 - 1
src/datawizard/interfaces/data_interface.c

@@ -49,7 +49,6 @@ static void _starpu_register_new_data(starpu_data_handle handle,
 	PTHREAD_MUTEX_INIT(&handle->sequential_consistency_mutex, NULL);
 	handle->last_submitted_mode = STARPU_R;
 	handle->last_submitted_writer = NULL;
-	handle->last_submitted_readers_count = 0;
 	handle->last_submitted_readers = NULL;
 	handle->post_sync_tasks = NULL;
 	handle->post_sync_tasks_cnt = 0;