Просмотр исходного кода

Add starpu_mpi_barrier basic test

Philippe SWARTVAGHER лет назад: 5
Родитель
Сommit
60fa4ce612
2 измененных файлов с 40 добавлено и 0 удалено
  1. 2 0
      mpi/tests/Makefile.am
  2. 38 0
      mpi/tests/mpi_barrier.c

+ 2 - 0
mpi/tests/Makefile.am

@@ -132,6 +132,7 @@ starpu_mpi_TESTS +=				\
 	mpi_earlyrecv2				\
 	mpi_earlyrecv2_sync			\
 	mpi_irecv				\
+	mpi_barrier				\
 	mpi_redux				\
 	ring					\
 	ring_sync				\
@@ -174,6 +175,7 @@ noinst_PROGRAMS =				\
 	mpi_earlyrecv2				\
 	mpi_earlyrecv2_sync			\
 	mpi_irecv				\
+	mpi_barrier				\
 	mpi_isend_detached			\
 	mpi_irecv_detached			\
 	mpi_detached_tag			\

+ 38 - 0
mpi/tests/mpi_barrier.c

@@ -0,0 +1,38 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2019                                     Inria
+ *
+ * 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
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#include <starpu_mpi.h>
+#include "helper.h"
+
+
+int main(int argc, char **argv)
+{
+	int ret, mpi_init;
+	MPI_Status status;
+
+	MPI_INIT_THREAD(&argc, &argv, MPI_THREAD_SERIALIZED, &mpi_init);
+
+	ret = starpu_mpi_init_conf(&argc, &argv, mpi_init, MPI_COMM_WORLD, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_mpi_init_conf");
+
+	starpu_mpi_barrier(MPI_COMM_WORLD);
+
+	starpu_mpi_shutdown();
+	if (!mpi_init)
+		MPI_Finalize();
+
+	return 0;
+}