Sfoglia il codice sorgente

Do not crash when run on non-2 MPI world

Samuel Thibault 5 anni fa
parent
commit
52b14e65b6
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10 1
      mpi/tests/sendrecv_bench.c

+ 10 - 1
mpi/tests/sendrecv_bench.c

@@ -95,7 +95,16 @@ int main(int argc, char **argv)
 	starpu_mpi_comm_rank(MPI_COMM_WORLD, &rank);
 	starpu_mpi_comm_size(MPI_COMM_WORLD, &worldsize);
 
-	STARPU_ASSERT_MSG(worldsize == 2, "We need two prcesses.");
+	if (worldsize != 2)
+	{
+		if (rank == 0)
+			FPRINTF(stderr, "We need 2 processes.\n");
+
+		starpu_mpi_shutdown();
+		if (!mpi_init)
+			MPI_Finalize();
+		return STARPU_TEST_SKIPPED;
+	}
 
 
 	if (rank == 0)