diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/fortran/13 coarray | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/fortran/13 coarray')
-rw-r--r-- | meson/test cases/fortran/13 coarray/main.f90 | 10 | ||||
-rw-r--r-- | meson/test cases/fortran/13 coarray/meson.build | 24 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meson/test cases/fortran/13 coarray/main.f90 b/meson/test cases/fortran/13 coarray/main.f90 new file mode 100644 index 000000000..eee03ea03 --- /dev/null +++ b/meson/test cases/fortran/13 coarray/main.f90 @@ -0,0 +1,10 @@ +program main +implicit none + +if (this_image() == 1) print *, 'number of Fortran coarray images:', num_images() + +sync all ! semaphore, ensures message above is printed at top. + +print *, 'Process ', this_image() + +end program diff --git a/meson/test cases/fortran/13 coarray/meson.build b/meson/test cases/fortran/13 coarray/meson.build new file mode 100644 index 000000000..893cec941 --- /dev/null +++ b/meson/test cases/fortran/13 coarray/meson.build @@ -0,0 +1,24 @@ +project('Fortran coarray', 'fortran', + meson_version: '>=0.50') + +fc = meson.get_compiler('fortran') + +if ['pgi', 'flang'].contains(fc.get_id()) + error('MESON_SKIP_TEST: At least through PGI 19.10 and Flang 7.1 do not support Fortran Coarrays.') +endif + +# coarray is required because single-image fallback is an intrinsic feature +coarray = dependency('coarray') + +# check coarray, because user might not have all the library stack installed correctly +# for example, conflicting library/compiler versions on PATH +# this has to invoke a run of "sync all" to verify the MPI stack is functioning, +# particularly for dynamic linking +if fc.run('sync all; end', dependencies: coarray, name: 'Coarray link & run').returncode() != 0 + error('MESON_SKIP_TEST: coarray stack (including MPI) did not link correctly so that a simple test could run.') +endif + +exe = executable('hello', 'main.f90', + dependencies : coarray) + +test('Coarray hello world', exe, timeout: 10) |