From 43b577583e25d33749faf4938a2119ceb5c02833 Mon Sep 17 00:00:00 2001 From: Miro ILIAS Date: Thu, 27 Aug 2015 12:56:28 +0200 Subject: [PATCH] tweak the fc_mpi test to use both the module mpi.F90 and include mpif.h --- test/fc_mpi/src/CMakeLists.txt | 2 +- test/fc_mpi/src/{example.f90 => example.F90} | 6 +++++- test/test.py | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) rename test/fc_mpi/src/{example.f90 => example.F90} (85%) diff --git a/test/fc_mpi/src/CMakeLists.txt b/test/fc_mpi/src/CMakeLists.txt index 00b794f..693f675 100644 --- a/test/fc_mpi/src/CMakeLists.txt +++ b/test/fc_mpi/src/CMakeLists.txt @@ -1,5 +1,5 @@ if (MPI_FOUND) - add_executable(example example.f90) + add_executable(example example.F90) else() message(FATAL "MPI not found!") endif() diff --git a/test/fc_mpi/src/example.f90 b/test/fc_mpi/src/example.F90 similarity index 85% rename from test/fc_mpi/src/example.f90 rename to test/fc_mpi/src/example.F90 index 0f636ca..5c5d6f3 100644 --- a/test/fc_mpi/src/example.f90 +++ b/test/fc_mpi/src/example.F90 @@ -1,8 +1,12 @@ program example +#if defined USE_MPI_MODULE use mpi - implicit none +#else + implicit none +#include "mpif.h" +#endif integer :: ierr, rank, num_ranks logical :: test_ok diff --git a/test/test.py b/test/test.py index 526bb39..9fe97fd 100644 --- a/test/test.py +++ b/test/test.py @@ -158,7 +158,12 @@ def test_fc_int64(): @skip_on_windows -def test_fc_mpi(): +def test_fc_mpi_module(): + configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=mpif90 --extra-fc-flags="-D USE_MPI_MODULE"', 'mpirun -np 2') + + +@skip_on_windows +def test_fc_mpi_include(): configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=mpif90', 'mpirun -np 2') # ------------------------------------------------------------------------------