aboutsummaryrefslogtreecommitdiff
path: root/test cases/frameworks/17 mpi
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <10931741+scivision@users.noreply.github.com>2019-04-05 16:48:20 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-04-05 23:48:20 +0300
commit42a04f7e230d3b8d4f5c46ffccf01ca7dfb94ef2 (patch)
tree18590baff0a379bb5d12f7197df045942ef364ad /test cases/frameworks/17 mpi
parent4e939bcf8ad7e52853877f39b582ce0ed7cdd423 (diff)
downloadmeson-42a04f7e230d3b8d4f5c46ffccf01ca7dfb94ef2.zip
meson-42a04f7e230d3b8d4f5c46ffccf01ca7dfb94ef2.tar.gz
meson-42a04f7e230d3b8d4f5c46ffccf01ca7dfb94ef2.tar.bz2
BUGFIX: Microsoft MPI is only compatible with Intel Fortran
Diffstat (limited to 'test cases/frameworks/17 mpi')
-rwxr-xr-xtest cases/frameworks/17 mpi/is_broken_ubuntu.py9
-rw-r--r--test cases/frameworks/17 mpi/main.f9051
-rw-r--r--test cases/frameworks/17 mpi/meson.build22
3 files changed, 38 insertions, 44 deletions
diff --git a/test cases/frameworks/17 mpi/is_broken_ubuntu.py b/test cases/frameworks/17 mpi/is_broken_ubuntu.py
deleted file mode 100755
index 27651ba..0000000
--- a/test cases/frameworks/17 mpi/is_broken_ubuntu.py
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env python3
-
-# Any exception causes return value to be not zero, which is sufficient.
-
-import sys
-
-fc = open('/etc/apt/sources.list').read()
-if 'artful' not in fc and 'bionic' not in fc and 'cosmic' not in fc:
- sys.exit(1)
diff --git a/test cases/frameworks/17 mpi/main.f90 b/test cases/frameworks/17 mpi/main.f90
index d379e96..b5666e8 100644
--- a/test cases/frameworks/17 mpi/main.f90
+++ b/test cases/frameworks/17 mpi/main.f90
@@ -1,21 +1,30 @@
-program mpitest
- implicit none
- include 'mpif.h'
- logical :: flag
- integer :: ier
- call MPI_Init(ier)
- if (ier /= 0) then
- print *, 'Unable to initialize MPI: ', ier
- stop 1
- endif
- call MPI_Initialized(flag, ier)
- if (ier /= 0) then
- print *, 'Unable to check MPI initialization state: ', ier
- stop 1
- endif
- call MPI_Finalize(ier)
- if (ier /= 0) then
- print *, 'Unable to finalize MPI: ', ier
- stop 1
- endif
-end program mpitest
+use, intrinsic :: iso_fortran_env, only: stderr=>error_unit
+use mpi
+
+implicit none
+
+logical :: flag
+integer :: ier
+
+call MPI_Init(ier)
+
+if (ier /= 0) then
+ write(stderr,*) 'Unable to initialize MPI', ier
+ stop 1
+endif
+
+call MPI_Initialized(flag, ier)
+if (ier /= 0) then
+ write(stderr,*) 'Unable to check MPI initialization state: ', ier
+ stop 1
+endif
+
+call MPI_Finalize(ier)
+if (ier /= 0) then
+ write(stderr,*) 'Unable to finalize MPI: ', ier
+ stop 1
+endif
+
+print *, "OK: Fortran MPI"
+
+end program
diff --git a/test cases/frameworks/17 mpi/meson.build b/test cases/frameworks/17 mpi/meson.build
index 2d0e4d3..8af9374 100644
--- a/test cases/frameworks/17 mpi/meson.build
+++ b/test cases/frameworks/17 mpi/meson.build
@@ -26,21 +26,15 @@ if build_machine.system() != 'windows'
test('MPI C++', execpp)
endif
-# OpenMPI is broken with Fortran on Ubuntu Artful.
-# Remove this once the following bug has been fixed:
-#
-# https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1727474
-
-ubudetector = find_program('is_broken_ubuntu.py')
-uburesult = run_command(ubudetector)
-
-if uburesult.returncode() != 0 and add_languages('fortran', required : false)
- mpifort = dependency('mpi', language : 'fortran')
- # Mixing compilers (msvc/clang with gfortran) does not seem to work on Windows.
- if build_machine.system() != 'windows' or cc.get_id() == 'gnu'
+# One of few feasible ways to use MPI for Fortran on Windows is via Intel compilers.
+if build_machine.system() != 'windows' or cc.get_id() == 'intel'
+ if add_languages('fortran', required : false)
+ mpifort = dependency('mpi', language : 'fortran')
+
exef = executable('exef',
- 'main.f90',
- dependencies : [mpifort])
+ 'main.f90',
+ dependencies : [mpifort])
+
test('MPI Fortran', exef)
endif
endif