소스 검색

mpi: Update towards new codelet/task interface which defines access modes for data handles into starpu_codelet and no longer in starpu_task

Nathalie Furmento 13 년 전
부모
커밋
381fa14704
5개의 변경된 파일35개의 추가작업 그리고 43개의 파일을 삭제
  1. 18 26
      mpi/examples/mpi_lu/pxlu.c
  2. 5 1
      mpi/examples/mpi_lu/pxlu_kernels.c
  3. 4 6
      mpi/tests/ring.c
  4. 4 6
      mpi/tests/ring_async.c
  5. 4 4
      mpi/tests/ring_async_implicit.c

+ 18 - 26
mpi/examples/mpi_lu/pxlu.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2011  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -267,8 +267,7 @@ static void create_task_11_real(unsigned k)
 	task->cl_arg = create_debug_info(k, k, k);
 
 	/* which sub-data is manipulated ? */
-	task->buffers[0].handle = STARPU_PLU(get_block_handle)(k, k);
-	task->buffers[0].mode = STARPU_RW;
+	task->handles[0] = STARPU_PLU(get_block_handle)(k, k);
 
 	struct callback_arg *arg = malloc(sizeof(struct callback_arg));
 		arg->k = k;
@@ -433,15 +432,13 @@ static void create_task_12_real(unsigned k, unsigned j)
 		tag_11_dep = TAG11_SAVE(k);
 	}
 
-	task->buffers[0].handle = diag_block; 
-	task->buffers[0].mode = STARPU_R;
-	task->buffers[1].handle = STARPU_PLU(get_block_handle)(k, j); 
-	task->buffers[1].mode = STARPU_RW;
+	task->handles[0] = diag_block; 
+	task->handles[1] = STARPU_PLU(get_block_handle)(k, j); 
 
 	STARPU_ASSERT(get_block_rank(k, j) == rank);
 
-	STARPU_ASSERT(task->buffers[0].handle != STARPU_POISON_PTR);
-	STARPU_ASSERT(task->buffers[1].handle != STARPU_POISON_PTR);
+	STARPU_ASSERT(task->handles[0] != STARPU_POISON_PTR);
+	STARPU_ASSERT(task->handles[1] != STARPU_POISON_PTR);
 
 	struct callback_arg *arg = malloc(sizeof(struct callback_arg));
 		arg->j = j;
@@ -606,13 +603,11 @@ static void create_task_21_real(unsigned k, unsigned i)
 		tag_11_dep = TAG11_SAVE(k);
 	}
 
-	task->buffers[0].handle = diag_block; 
-	task->buffers[0].mode = STARPU_R;
-	task->buffers[1].handle = STARPU_PLU(get_block_handle)(i, k);
-	task->buffers[1].mode = STARPU_RW;
+	task->handles[0] = diag_block; 
+	task->handles[1] = STARPU_PLU(get_block_handle)(i, k);
 
-	STARPU_ASSERT(task->buffers[0].handle != STARPU_POISON_PTR);
-	STARPU_ASSERT(task->buffers[1].handle != STARPU_POISON_PTR);
+	STARPU_ASSERT(task->handles[0] != STARPU_POISON_PTR);
+	STARPU_ASSERT(task->handles[1] != STARPU_POISON_PTR);
 
 	struct callback_arg *arg = malloc(sizeof(struct callback_arg));
 		arg->i = i;
@@ -725,21 +720,18 @@ static void create_task_22_real(unsigned k, unsigned i, unsigned j)
 
 
 #warning temporary fix :/
-	//task->buffers[0].handle = block21;
-	task->buffers[0].handle = block12;
-	task->buffers[0].mode = STARPU_R;
+	//task->handles[0] = block21;
+	task->handles[0] = block12;
 
-	//task->buffers[1].handle = block12;
-	task->buffers[1].handle = block21;
-	task->buffers[1].mode = STARPU_R;
+	//task->handles[1] = block12;
+	task->handles[1] = block21;
 
 	/* produced by TAG22(k-1, i, j) */
-	task->buffers[2].handle = STARPU_PLU(get_block_handle)(i, j);
-	task->buffers[2].mode = STARPU_RW;
+	task->handles[2] = STARPU_PLU(get_block_handle)(i, j);
 
-	STARPU_ASSERT(task->buffers[0].handle != STARPU_POISON_PTR);
-	STARPU_ASSERT(task->buffers[1].handle != STARPU_POISON_PTR);
-	STARPU_ASSERT(task->buffers[2].handle != STARPU_POISON_PTR);
+	STARPU_ASSERT(task->handles[0] != STARPU_POISON_PTR);
+	STARPU_ASSERT(task->handles[1] != STARPU_POISON_PTR);
+	STARPU_ASSERT(task->handles[2] != STARPU_POISON_PTR);
 
 	if (!no_prio &&  (i == k + 1) && (j == k +1) ) {
 		task->priority = STARPU_MAX_PRIO;

+ 5 - 1
mpi/examples/mpi_lu/pxlu_kernels.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -114,6 +114,7 @@ struct starpu_codelet STARPU_PLU(cl22) = {
 	.cuda_func = STARPU_PLU(cublas_u22),
 #endif
 	.nbuffers = 3,
+	.modes = {STARPU_R, STARPU_R, STARPU_RW},
 	.model = &STARPU_PLU(model_22)
 };
 
@@ -221,6 +222,7 @@ struct starpu_codelet STARPU_PLU(cl12) = {
 	.cuda_func = STARPU_PLU(cublas_u12),
 #endif
 	.nbuffers = 2,
+	.modes = {STARPU_R, STARPU_RW},
 	.model = &STARPU_PLU(model_12)
 };
 
@@ -329,6 +331,7 @@ struct starpu_codelet STARPU_PLU(cl21) = {
 	.cuda_func = STARPU_PLU(cublas_u21),
 #endif
 	.nbuffers = 2,
+	.modes = {STARPU_R, STARPU_RW},
 	.model = &STARPU_PLU(model_21)
 };
 
@@ -434,6 +437,7 @@ struct starpu_codelet STARPU_PLU(cl11) = {
 	.cuda_func = STARPU_PLU(cublas_u11),
 #endif
 	.nbuffers = 1,
+	.modes = {STARPU_RW},
 	.model = &STARPU_PLU(model_11)
 };
 

+ 4 - 6
mpi/tests/ring.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -40,7 +40,8 @@ static struct starpu_codelet increment_cl =
 	.cuda_func = increment_cuda,
 #endif
 	.cpu_func = increment_cpu,
-	.nbuffers = 1
+	.nbuffers = 1,
+	.modes = {STARPU_RW}
 };
 
 void increment_token(void)
@@ -48,10 +49,7 @@ void increment_token(void)
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &increment_cl;
-
-	task->buffers[0].handle = token_handle;
-	task->buffers[0].mode = STARPU_RW;
-
+	task->handles[0] = token_handle;
 	task->synchronous = 1;
 
 	starpu_task_submit(task);

+ 4 - 6
mpi/tests/ring_async.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -40,7 +40,8 @@ static struct starpu_codelet increment_cl =
 	.cuda_func = increment_cuda,
 #endif
 	.cpu_func = increment_cpu,
-	.nbuffers = 1
+	.nbuffers = 1,
+	.modes = {STARPU_RW}
 };
 
 void increment_token(void)
@@ -48,10 +49,7 @@ void increment_token(void)
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &increment_cl;
-
-	task->buffers[0].handle = token_handle;
-	task->buffers[0].mode = STARPU_RW;
-
+	task->handles[0] = token_handle;
 	task->synchronous = 1;
 
 	starpu_task_submit(task);

+ 4 - 4
mpi/tests/ring_async_implicit.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -40,7 +40,8 @@ static struct starpu_codelet increment_cl =
 	.cuda_func = increment_cuda,
 #endif
 	.cpu_func = increment_cpu,
-	.nbuffers = 1
+	.nbuffers = 1,
+	.modes = {STARPU_RW}
 };
 
 void increment_token(void)
@@ -48,8 +49,7 @@ void increment_token(void)
 	struct starpu_task *task = starpu_task_create();
 
 	task->cl = &increment_cl;
-	task->buffers[0].handle = token_handle;
-	task->buffers[0].mode = STARPU_RW;
+	task->handles[0] = token_handle;
 
 	starpu_task_submit(task);
 }