浏览代码

Submit reduction tasks after data_cpy might have set its dependency on them

Samuel Thibault 13 年之前
父节点
当前提交
24693b03ac
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      src/datawizard/reduction.c

+ 4 - 6
src/datawizard/reduction.c

@@ -244,6 +244,10 @@ void _starpu_data_end_reduction_mode(starpu_data_handle_t handle)
 			}
 		}
 
+		if (empty)
+			/* The handle was empty, we just need to copy the reduced value. */
+			_starpu_data_cpy(handle, replicate_array[0], 1, NULL, 0, 1, last_replicate_deps[0]);
+
 		/* Let's submit all the reduction tasks. */
 		unsigned i;
 		for (i = 0; i < redux_task_idx; i++)
@@ -251,12 +255,6 @@ void _starpu_data_end_reduction_mode(starpu_data_handle_t handle)
 			int ret = starpu_task_submit(redux_tasks[i]);
 			STARPU_ASSERT(ret == 0);
 		}
-
-
-		if (empty)
-			/* The handle was empty, we just need to copy the reduced value. */
-			_starpu_data_cpy(handle, replicate_array[0], 1, NULL, 0, 1, last_replicate_deps[0]);
-
 #else
 		if (empty) {
 			struct starpu_task *redux_task = starpu_task_create();