Pārlūkot izejas kodu

mpi: update applications to use starpu_mpi_data_register instead of both starpu_data_set_tag and starpu_data_set_rank

Nathalie Furmento 11 gadi atpakaļ
vecāks
revīzija
12ffd4005e

+ 2 - 3
mpi/examples/matrix_decomposition/mpi_cholesky_codelets.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2014  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014  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
@@ -98,8 +98,7 @@ void dw_cholesky(float ***matA, unsigned ld, int rank, int nodes, double *timing
 			}
 			if (data_handles[x][y])
 			{
-				starpu_data_set_rank(data_handles[x][y], mpi_rank);
-				starpu_data_set_tag(data_handles[x][y], (y*nblocks)+x);
+				starpu_mpi_data_register(data_handles[x][y], (y*nblocks)+x, mpi_rank);
 			}
 		}
 	}

+ 2 - 3
mpi/examples/mpi_lu/plu_implicit_example.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011, 2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014  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
@@ -174,8 +174,7 @@ static void init_matrix(int rank)
 					size/nblocks, size/nblocks, sizeof(TYPE));
 				*blockptr = STARPU_POISON_PTR;
 			}
-			starpu_data_set_rank(*handleptr, block_rank);
-			starpu_data_set_tag(*handleptr, j+i*nblocks);
+			starpu_mpi_data_register(*handleptr, j+i*nblocks, block_rank);
 		}
 	}
 

+ 2 - 3
mpi/examples/mpi_lu/plu_outofcore_example.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011, 2013  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014  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
@@ -206,8 +206,7 @@ static void init_matrix(int rank)
 					0, size/nblocks,
 					size/nblocks, size/nblocks, sizeof(TYPE));
 			}
-			starpu_data_set_rank(*handleptr, block_rank);
-			starpu_data_set_tag(*handleptr, j+i*nblocks);
+			starpu_mpi_data_register(*handleptr, j+i*nblocks, block_rank);
 		}
 	}
 

+ 2 - 3
mpi/examples/stencil/stencil5.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014  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
@@ -134,8 +134,7 @@ int main(int argc, char **argv)
 			}
 			if (data_handles[x][y])
 			{
-				starpu_data_set_rank(data_handles[x][y], mpi_rank);
-				starpu_data_set_tag(data_handles[x][y], (y*X)+x);
+				starpu_mpi_data_register(data_handles[x][y], (y*X)+x, mpi_rank);
 			}
 		}
 	}

+ 2 - 3
mpi/tests/insert_task.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014  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
@@ -96,8 +96,7 @@ int main(int argc, char **argv)
 			}
 			if (data_handles[x][y])
 			{
-				starpu_data_set_rank(data_handles[x][y], mpi_rank);
-				starpu_data_set_tag(data_handles[x][y], (y*X)+x);
+				starpu_mpi_data_register(data_handles[x][y], (y*X)+x, mpi_rank);
 			}
 		}
 	}

+ 2 - 3
mpi/tests/insert_task_block.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014  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
@@ -115,8 +115,7 @@ int main(int argc, char **argv)
 			}
 			if (data_handles[x][y])
 			{
-				starpu_data_set_rank(data_handles[x][y], mpi_rank);
-				starpu_data_set_tag(data_handles[x][y], (y*BLOCKS)+x);
+				starpu_mpi_data_register(data_handles[x][y], (y*BLOCKS)+x, mpi_rank);
 			}
 		}
 	}

+ 2 - 3
mpi/tests/insert_task_compute.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2013, 2014  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
@@ -56,8 +56,7 @@ int test(int rank, int node, int *before, int *after, int task_insert)
 		if (rank <= 1)
 			FPRINTF_MPI("before computation x[%d] = %d\n", i, x[i]);
 		starpu_variable_data_register(&data_handles[i], STARPU_MAIN_RAM, (uintptr_t)&x[i], sizeof(int));
-		starpu_data_set_rank(data_handles[i], i);
-		starpu_data_set_tag(data_handles[i], i);
+		starpu_mpi_data_register(data_handles[i], i, i);
 	}
 
 	if (task_insert)

+ 5 - 9
mpi/tests/insert_task_owner.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014  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
@@ -84,20 +84,16 @@ int main(int argc, char **argv)
 	if (rank == 0)
 	{
 		starpu_variable_data_register(&data_handlesx0, STARPU_MAIN_RAM, (uintptr_t)&x0, sizeof(x0));
-		starpu_data_set_rank(data_handlesx0, rank);
-		starpu_data_set_tag(data_handlesx0, 0);
+		starpu_mpi_data_register(data_handlesx0, 0, rank);
 		starpu_variable_data_register(&data_handlesx1, -1, (uintptr_t)NULL, sizeof(int));
-		starpu_data_set_rank(data_handlesx1, 1);
-		starpu_data_set_tag(data_handlesx1, 1);
+		starpu_mpi_data_register(data_handlesx1, 1, 1);
 	}
 	else if (rank == 1)
 	{
 		starpu_variable_data_register(&data_handlesx1, STARPU_MAIN_RAM, (uintptr_t)&x1, sizeof(x1));
-		starpu_data_set_rank(data_handlesx1, rank);
-		starpu_data_set_tag(data_handlesx1, 1);
+		starpu_mpi_data_register(data_handlesx1, 1, rank);
 		starpu_variable_data_register(&data_handlesx0, -1, (uintptr_t)NULL, sizeof(int));
-		starpu_data_set_rank(data_handlesx0, 0);
-		starpu_data_set_tag(data_handlesx0, 0);
+		starpu_mpi_data_register(data_handlesx0, 0, 0);
 	}
 
 	node = starpu_data_get_rank(data_handlesx1);

+ 3 - 5
mpi/tests/insert_task_owner2.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014  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
@@ -87,11 +87,9 @@ int main(int argc, char **argv)
 
 	for(i=0 ; i<3 ; i++)
 	{
-		starpu_data_set_rank(data_handles[i], 0);
-		starpu_data_set_tag(data_handles[i], i);
+		starpu_mpi_data_register(data_handles[i], i, 0);
 	}
-	starpu_data_set_rank(data_handles[3], 1);
-	starpu_data_set_tag(data_handles[3], 3);
+	starpu_mpi_data_register(data_handles[3], 3, 1);
 
 	err = starpu_mpi_task_insert(MPI_COMM_WORLD, &mycodelet,
 				     STARPU_R, data_handles[0], STARPU_RW, data_handles[1],

+ 3 - 5
mpi/tests/insert_task_owner_data.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014  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
@@ -67,10 +67,8 @@ int main(int argc, char **argv)
 		starpu_variable_data_register(&data_handles[1], -1, (uintptr_t)NULL, sizeof(x[1]));
 	}
 
-	starpu_data_set_rank(data_handles[0], 0);
-	starpu_data_set_tag(data_handles[0], 0);
-	starpu_data_set_rank(data_handles[1], 1);
-	starpu_data_set_tag(data_handles[1], 1);
+	starpu_mpi_data_register(data_handles[0], 0, 0);
+	starpu_mpi_data_register(data_handles[1], 1, 1);
 
 	err = starpu_mpi_task_insert(MPI_COMM_WORLD, &mycodelet,
 				     STARPU_RW, data_handles[0], STARPU_RW, data_handles[1],

+ 2 - 3
mpi/tests/insert_task_sent_cache.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014  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
@@ -75,8 +75,7 @@ void test_cache(int rank, int size, char *enabled, size_t *comm_amount)
 			//FPRINTF(stderr, "[%d] Neighbour of data[%d][%d]\n", rank, x, y);
 			starpu_vector_data_register(&data_handles[i], -1, (uintptr_t)NULL, N, sizeof(unsigned));
 		}
-		starpu_data_set_rank(data_handles[i], mpi_rank);
-		starpu_data_set_tag(data_handles[i], i);
+		starpu_mpi_data_register(data_handles[i], i, mpi_rank);
 	}
 
 	for(i = 0; i < 5; i++)

+ 3 - 5
mpi/tests/mpi_reduction.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013  Université de Bordeaux 1
- * Copyright (C) 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013, 2014  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
@@ -125,13 +125,11 @@ int main(int argc, char **argv)
 		}
 		if (handles[x])
 		{
-			starpu_data_set_rank(handles[x], mpi_rank);
-			starpu_data_set_tag(handles[x], x);
+			starpu_mpi_data_register(handles[x], x, mpi_rank);
 		}
 	}
 
-	starpu_data_set_rank(dot_handle, 0);
-	starpu_data_set_tag(dot_handle, nb_elements+1);
+	starpu_mpi_data_register(dot_handle, nb_elements+1, 0);
 	starpu_data_set_reduction_methods(dot_handle, &redux_codelet, &init_codelet);
 
 	for (i = 0; i < loops; i++)

+ 2 - 3
mpi/tests/mpi_scatter_gather.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014  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
@@ -160,8 +160,7 @@ int main(int argc, char **argv)
 			}
 			if (data_handles[x+y*nblocks])
 			{
-				starpu_data_set_rank(data_handles[x+y*nblocks], mpi_rank);
-				starpu_data_set_tag(data_handles[x+y*nblocks], (y*nblocks)+x);
+				starpu_mpi_data_register(data_handles[x+y*nblocks], (y*nblocks)+x, mpi_rank);
 			}
 		}
 	}

+ 2 - 3
mpi/tests/user_defined_datatype.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013, 2014  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
@@ -34,8 +34,7 @@ void test_handle_irecv_isend_detached(starpu_data_handle_t *handles, int nb_hand
 
 	for(i=0 ; i<nb_handles ; i++)
 	{
-		starpu_data_set_rank(handles[i], 1);
-		starpu_data_set_tag(handles[i], i+tag);
+		starpu_mpi_data_register(handles[i], i+tag, 1);
 	}
 
 	for(i=0 ; i<nb_handles ; i++)