浏览代码

mpi_lu example: modifications towards the new API

Nathalie Furmento 15 年之前
父节点
当前提交
a5f704ef6b
共有 2 个文件被更改,包括 9 次插入6 次删除
  1. 8 5
      mpi/examples/mpi_lu/plu_example.c
  2. 1 1
      mpi/examples/mpi_lu/pxlu.c

+ 8 - 5
mpi/examples/mpi_lu/plu_example.c

@@ -65,7 +65,7 @@ static TYPE **(tmp_21_block[2]);
 
 int get_block_rank(unsigned i, unsigned j);
 
-static void parse_args(int argc, char **argv, int rank)
+static void parse_args(int argc, char **argv)
 {
 	int i;
 	for (i = 1; i < argc; i++) {
@@ -399,6 +399,7 @@ int main(int argc, char **argv)
 	int world_size;
 	int thread_support;
 
+#if 0
 	/*
 	 *	Initialization
 	 */
@@ -413,19 +414,21 @@ int main(int argc, char **argv)
 	
 	MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 	MPI_Comm_size(MPI_COMM_WORLD, &world_size);
+#endif
 
 	starpu_srand48((long int)time(NULL));
 
-	parse_args(argc, argv, rank);
-
-	STARPU_ASSERT(p*q == world_size);
+	parse_args(argc, argv);
 
 	starpu_init(NULL);
 
 	/* We disable sequential consistency in this example */
 	starpu_data_set_default_sequential_consistency_flag(0);
 
-	starpu_mpi_initialize();
+	starpu_mpi_initialize_extended(1, &rank, &world_size);
+
+	STARPU_ASSERT(p*q == world_size);
+
 	starpu_helper_cublas_init();
 
 	int barrier_ret = MPI_Barrier(MPI_COMM_WORLD);

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

@@ -856,7 +856,7 @@ double STARPU_PLU(plu_main)(unsigned _nblocks, int _rank, int _world_size)
 		}
 	}
 
-	int barrier_ret = MPI_Barrier(MPI_COMM_WORLD);
+	int barrier_ret = starpu_mpi_barrier(MPI_COMM_WORLD);
 	STARPU_ASSERT(barrier_ret == MPI_SUCCESS);
 
 	/* schedule the codelet */