ソースを参照

mpi/examples: do not set NULL as MPI_Status parameter for MPI receptions

Nathalie Furmento 5 年 前
コミット
6fc877b79b
共有2 個のファイルを変更した4 個の追加2 個の削除を含む
  1. 2 1
      mpi/examples/complex/mpi_complex.c
  2. 2 1
      mpi/examples/user_datatype/user_datatype.c

+ 2 - 1
mpi/examples/complex/mpi_complex.c

@@ -112,11 +112,12 @@ int main(int argc, char **argv)
 	}
 	else if (rank == 1)
 	{
+		MPI_Status status;
 		starpu_data_handle_t xhandle;
 		double xreal = 14.0;
 		double ximaginary = 18.0;
 		starpu_complex_data_register(&xhandle, STARPU_MAIN_RAM, &xreal, &ximaginary, 1);
-		starpu_mpi_recv(xhandle, 0, 10, MPI_COMM_WORLD, NULL);
+		starpu_mpi_recv(xhandle, 0, 10, MPI_COMM_WORLD, &status);
 		starpu_data_unregister(xhandle);
 		FPRINTF(stderr, "[received] real %f imaginary %f\n", xreal, ximaginary);
 		STARPU_ASSERT_MSG(xreal == 4 && ximaginary == 8, "Incorrect received value\n");

+ 2 - 1
mpi/examples/user_datatype/user_datatype.c

@@ -92,10 +92,11 @@ int main(int argc, char **argv)
 	}
 	else if (rank == 1)
 	{
+		MPI_Status status;
 		struct starpu_my_data myx = {.d = 11 , .c = 'a'};
 		starpu_data_handle_t handlex;
 		starpu_my_data_register(&handlex, STARPU_MAIN_RAM, &myx);
-		starpu_mpi_recv(handlex, 0, 10, MPI_COMM_WORLD, NULL);
+		starpu_mpi_recv(handlex, 0, 10, MPI_COMM_WORLD, &status);
 		starpu_data_unregister(handlex);
 		FPRINTF(stderr, "[starpu mpi] myx.d=%d myx.c=%c\n", myx.d, myx.c);
 		STARPU_ASSERT_MSG(myx.d == 98 && myx.c == 'z', "Incorrect received value\n");