Jerry D wrote:
Fortran: Enable coarray tests for multi image use [PR88076]
Change some of regression tests to run on single and multiple images.
Add some new tests.
PR fortran/88076
gcc/testsuite/ChangeLog:
* gfortran.dg/coarray/alloc_comp_4.f90: Make multi image
compatible.
* gfortran.dg/coarray/atomic_2.f90: Same.
* gfortran.dg/coarray/caf.exp: Also test caf_shmem and choose
I think this should be split into two parts – one part will be changing
the testcases to handle more than 1 image – and the second part that needs
to land with or after 13/13 is to actually enable it.
Regarding the first part: I or someone else still has to review those
changes.
Regarding the second part:
--- a/gcc/testsuite/gfortran.dg/coarray/caf.exp
+++ b/gcc/testsuite/gfortran.dg/coarray/caf.exp
@@ -70,6 +70,12 @@ proc dg-compile-aux-modules { args } {
}
}
+if { [getenv GFORTRAN_NUM_IMAGES] == "" } {
+ # Some caf_shmem tests need at least 8 images. This is also to limit the
+ # number of images on big machines preventing overload w/o any benefit.
+ setenv GFORTRAN_NUM_IMAGES 8
+}
+
FYI only: When doing remote testing, DejaGNU does not properly forward
environment variables. I assume it also works somewhat gracefully when
it is unset.
+ foreach flags $option_list {
+ verbose "Testing $nshort (libcaf_shmem), $flags" 1
+ set gfortran_aux_module_flags "-fcoarray=lib $flags -lcaf_shmem"
+ dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}
+ cleanup-modules ""
+ }
As mentioned in 13/13, the current implementation seems to assume that
POSIX threads are available; additionally, -lpthread or -pthread might
be needed for linking. In any case, it seems as if some check is
required whether caf_shmem is actually available; otherwise, the shmem
tests have to be skipped.
Tobias