Browse Source

Set coordinates and iteration loops for MPI examples

Samuel Thibault 8 years ago
parent
commit
265cfa6687

+ 4 - 1
mpi/examples/matrix_decomposition/mpi_cholesky_codelets.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010, 2014-2015  Université de Bordeaux
+ * Copyright (C) 2009, 2010, 2014-2015, 2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -99,6 +99,7 @@ void dw_cholesky(float ***matA, unsigned ld, int rank, int nodes, double *timing
 			}
 			if (data_handles[x][y])
 			{
+				starpu_data_set_coordinates(data_handles[x][y], 2, x, y);
 				starpu_mpi_data_register(data_handles[x][y], (y*nblocks)+x, mpi_rank);
 			}
 		}
@@ -109,6 +110,8 @@ void dw_cholesky(float ***matA, unsigned ld, int rank, int nodes, double *timing
 
 	for (k = 0; k < nblocks; k++)
 	{
+		starpu_set_iteration(k);
+
 		int prio = STARPU_DEFAULT_PRIO;
 		if (!noprio) prio = STARPU_MAX_PRIO;
 

+ 3 - 0
mpi/examples/matrix_mult/mm.c

@@ -144,6 +144,7 @@ static void register_matrices()
 		 * Note: StarPU-MPI is an autonomous layer built on top of StarPU, hence the two separate
 		 * registration steps.
 		 */
+		starpu_data_set_coordinates(A_h[b_row], 2, 0, b_row);
 		starpu_mpi_data_register(A_h[b_row], tag++, 0);
 	}
 
@@ -152,6 +153,7 @@ static void register_matrices()
 				mr,
 				(comm_rank == 0)?(uintptr_t)(B+b_col*BS):0, N, BS, N,
 				sizeof(double));
+		starpu_data_set_coordinates(B_h[b_col], 2, b_col, 0);
 		starpu_mpi_data_register(B_h[b_col], tag++, 0);
 	}
 
@@ -161,6 +163,7 @@ static void register_matrices()
 					mr,
 					(comm_rank == 0)?(uintptr_t)(C+b_row*BS*N+b_col*BS):0, N, BS, BS,
 					sizeof(double));
+			starpu_data_set_coordinates(C_h[b_row*NB+b_col], 2, b_col, b_row);
 			starpu_mpi_data_register(C_h[b_row*NB+b_col], tag++, 0);
 		}
 	}

+ 2 - 1
mpi/examples/mpi_lu/plu_example.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011, 2013, 2015  Université de Bordeaux
+ * Copyright (C) 2010-2011, 2013, 2015, 2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -249,6 +249,7 @@ static void init_matrix(int rank)
 				starpu_matrix_data_register(handleptr, STARPU_MAIN_RAM,
 					(uintptr_t)*blockptr, size/nblocks,
 					size/nblocks, size/nblocks, sizeof(TYPE));
+				starpu_data_set_coordinates(*handleptr, 2, j, i);
 			}
 			else {
 				*blockptr = STARPU_POISON_PTR;

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

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011, 2013  Université de Bordeaux
+ * Copyright (C) 2010-2011, 2013, 2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -174,6 +174,7 @@ static void init_matrix(int rank)
 					size/nblocks, size/nblocks, sizeof(TYPE));
 				*blockptr = STARPU_POISON_PTR;
 			}
+			starpu_data_set_coordinates(*handleptr, 2, j, i);
 			starpu_mpi_data_register(*handleptr, j+i*nblocks, block_rank);
 		}
 	}

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

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011, 2013-2014  Université de Bordeaux
+ * Copyright (C) 2010-2011, 2013-2014, 2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -206,6 +206,7 @@ static void init_matrix(int rank)
 					0, size/nblocks,
 					size/nblocks, size/nblocks, sizeof(TYPE));
 			}
+			starpu_data_set_coordinates(*handleptr, 2, j, i);
 			starpu_mpi_data_register(*handleptr, j+i*nblocks, block_rank);
 		}
 	}

+ 3 - 1
mpi/examples/mpi_lu/pxlu.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011, 2014  Université de Bordeaux
+ * Copyright (C) 2010, 2011, 2014, 2017  Université de Bordeaux
  * Copyright (C) 2010, 2012, 2013  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -833,6 +833,8 @@ double STARPU_PLU(plu_main)(unsigned _nblocks, int _rank, int _world_size)
 
 	for (k = 0; k < nblocks; k++)
 	{
+		starpu_set_iteration(k);
+
 		create_task_11(k);
 
 		for (i = k+1; i<nblocks; i++)

+ 3 - 1
mpi/examples/mpi_lu/pxlu_implicit.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011, 2013-2015  Université de Bordeaux
+ * Copyright (C) 2010-2011, 2013-2015, 2017  Université de Bordeaux
  * Copyright (C) 2010, 2012, 2013  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -131,6 +131,8 @@ double STARPU_PLU(plu_main)(unsigned _nblocks, int _rank, int _world_size)
 
 	for (k = 0; k < nblocks; k++)
 	{
+		starpu_set_iteration(k);
+
 		create_task_11(k);
 
 		for (i = k+1; i<nblocks; i++)

+ 6 - 1
mpi/examples/stencil/stencil5.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2013, 2015-2016              Université Bordeaux
+ * Copyright (C) 2011, 2013, 2015-2017              Université Bordeaux
  * Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -166,6 +166,7 @@ int main(int argc, char **argv)
 			}
 			if (data_handles[x][y])
 			{
+				starpu_data_set_coordinates(data_handles[x][y], 2, x, y);
 				starpu_mpi_data_register(data_handles[x][y], (y*X)+x, mpi_rank);
 			}
 		}
@@ -174,6 +175,8 @@ int main(int argc, char **argv)
 	/* First computation with initial distribution */
 	for(loop=0 ; loop<niter; loop++)
 	{
+		starpu_set_iteration(loop);
+
 		for (x = 1; x < X-1; x++)
 		{
 			for (y = 1; y < Y-1; y++)
@@ -213,6 +216,8 @@ int main(int argc, char **argv)
 	/* Second computation with new distribution */
 	for(loop=0 ; loop<niter; loop++)
 	{
+		starpu_set_iteration(niter + loop);
+
 		for (x = 1; x < X-1; x++)
 		{
 			for (y = 1; y < Y-1; y++)

+ 4 - 1
mpi/examples/stencil/stencil5_lb.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2013, 2015-2016              Université Bordeaux
+ * Copyright (C) 2011, 2013, 2015-2017              Université Bordeaux
  * Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -227,6 +227,7 @@ int main(int argc, char **argv)
 			}
 			if (data_nodes[x][y].data_handle)
 			{
+				starpu_data_set_coordinates(data_nodes[x][y].data_handle, 2, x, y);
 				starpu_mpi_data_register(data_nodes[x][y].data_handle, (y*X)+x, data_nodes[x][y].node);
 			}
 		}
@@ -235,6 +236,8 @@ int main(int argc, char **argv)
 	/* First computation with initial distribution */
 	for(loop=0 ; loop<niter; loop++)
 	{
+		starpu_set_iteration(loop);
+
 		for (x = 1; x < X-1; x++)
 		{
 			for (y = 1; y < Y-1; y++)