ソースを参照

Fix taking specific_nodes into account

Samuel Thibault 7 年 前
コミット
34587dcad5
共有2 個のファイルを変更した14 個の追加9 個の削除を含む
  1. 3 2
      src/datawizard/coherency.c
  2. 11 7
      tests/datawizard/specific_node.c

+ 3 - 2
src/datawizard/coherency.c

@@ -1145,7 +1145,6 @@ void _starpu_fetch_task_input_tail(struct starpu_task *task, struct _starpu_job
 
 	int profiling = starpu_profiling_status_get();
 
-	struct _starpu_data_descr *descrs = _STARPU_JOB_GET_ORDERED_BUFFERS(j);
 	unsigned nbuffers = STARPU_TASK_GET_NBUFFERS(task);
 
 	unsigned local_memory_node = worker->memory_node;
@@ -1157,7 +1156,9 @@ void _starpu_fetch_task_input_tail(struct starpu_task *task, struct _starpu_job
 	{
 		starpu_data_handle_t handle = STARPU_TASK_GET_HANDLE(task, index);
 		enum starpu_data_access_mode mode = STARPU_TASK_GET_MODE(task, index);
-		int node = descrs[index].node;
+		int node = -1;
+		if (task->cl->specific_nodes)
+			node = STARPU_CODELET_GET_NODE(task->cl, index);
 		if (node == -1)
 			node = local_memory_node;
 

+ 11 - 7
tests/datawizard/specific_node.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2012,2017                                Inria
- * Copyright (C) 2010-2011,2013-2014,2016                 Université de Bordeaux
+ * Copyright (C) 2010-2011,2013-2014,2016, 2018                 Université de Bordeaux
  * Copyright (C) 2011-2013,2015,2017                      CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -30,9 +30,7 @@
  * the GPU
  */
 
-starpu_data_handle_t data_handle;
-
-unsigned data;
+unsigned data, data2;
 
 void specific_kernel(void *descr[], void *arg)
 {
@@ -48,10 +46,10 @@ static struct starpu_codelet specific_cl =
 	.cpu_funcs = {specific_kernel},
 	.cuda_funcs = {specific_kernel},
 	.opencl_funcs = {specific_kernel},
-	.nbuffers = 1,
-	.modes = {STARPU_RW},
+	.nbuffers = 2,
+	.modes = {STARPU_RW, STARPU_RW},
 	.specific_nodes = 1,
-	.nodes = {STARPU_MAIN_RAM},
+	.nodes = {STARPU_MAIN_RAM, -1},
 };
 
 void cpu_codelet_unsigned_inc(void *descr[], void *arg)
@@ -89,6 +87,8 @@ struct starpu_opencl_program opencl_program;
 
 int main(void)
 {
+	starpu_data_handle_t data_handle, data_handle2;
+
 #ifdef STARPU_QUICK_CHECK
 	unsigned ntasks = 10;
 #else
@@ -108,10 +108,13 @@ int main(void)
 #endif
 
 	data = 0;
+	data2 = 0;
 
 	/* Create a void data which will be used as an exclusion mechanism. */
 	starpu_variable_data_register(&data_handle, STARPU_MAIN_RAM, (uintptr_t) &data, sizeof(data));
 
+	starpu_variable_data_register(&data_handle2, STARPU_MAIN_RAM, (uintptr_t) &data2, sizeof(data2));
+
 	unsigned i;
 	for (i = 0; i < ntasks; i++)
 	{
@@ -121,6 +124,7 @@ int main(void)
 		else
 			task->cl = &cl;
 		task->handles[0] = data_handle;
+		task->handles[1] = data_handle2;
 
 		ret = starpu_task_submit(task);
 		if (ret == -ENODEV) goto enodev;