Message ID | 56e2be4c-707c-9b09-e18b-1bf25e912296@codesourcery.com |
---|---|
State | New |
Headers | show |
Series | [Fortran] OpenMP – libgomp/testsuite – use 'stop' and 'dg-do run' | expand |
On Fri, Oct 25, 2019 at 06:17:26PM +0200, Tobias Burnus wrote: > This patch is about: libgomp/testsuite/libgomp.fortran/, only > > The two test cases I added recently use 'call abort()', which is > nowadays frowned on as that's a ventor extension. Hence, I change it to > 'stop'. > > Additionally, the 'fortran.exp' in the directory states: "For Fortran > we're doing torture testing, as Fortran has far more tests with arrays > etc. that testing just -O0 or -O2 is insufficient, that is typically not > the case for C/C++." > > The torture testing is only done if there is a "dg-do run"; without > dg-do, it also does run, but only with a single compile flag setting. > > I have only selectively added it; I think 'dg-do run' does not make > sense for: > * condinc*.f – only do uses '!$ include' > * omp_cond*.f* – only tests '!$' code, including comments. > Hence, I excluded those and only changed the others. (However, one can > still argue about the remaining ones – such as 'omp_hello.f' or tabs*.f*.) > > OK for the trunk? Add/remove for 'dg-do run' from additional test cases? > > Tobias > I think this patch and the openacc patch are fine. With openmp and openacc, I usually defer to Jakub, Thomas, and Cesar for their expertise with these standards. I do, however, recognize that everyone has limited amounts of time. If you have openmp/openacc patches I can cast an eye over them for formatting issues; otherwise, I'll leave it to your discretion on what a reasonable review timeout is prior to committing a change.
Hi Tobias! On 2019-10-25T18:17:26+0200, Tobias Burnus <tobias@codesourcery.com> wrote: > This patch is about: libgomp/testsuite/libgomp.fortran/, only > > The two test cases I added recently use 'call abort()', which is > nowadays frowned on as that's a ventor extension. Hence, I change it to > 'stop'. > > Additionally, the 'fortran.exp' in the directory states: "For Fortran > we're doing torture testing, as Fortran has far more tests with arrays > etc. that testing just -O0 or -O2 is insufficient, that is typically not > the case for C/C++." > > The torture testing is only done if there is a "dg-do run"; without > dg-do, it also does run, but only with a single compile flag setting. (It was me who suggested that task.) > I have only selectively added it; I think 'dg-do run' does not make > sense for: > * condinc*.f – only do uses '!$ include' > * omp_cond*.f* – only tests '!$' code, including comments. > Hence, I excluded those and only changed the others. (However, one can > still argue about the remaining ones – such as 'omp_hello.f' or tabs*.f*.) But why shouldn't these still be torture tested? Anyway -- as usual ;-) -- I'd prefer if any such rationale ("not doing torture testing because [...]") was put into the respective testsuite files, so that it's obvious to the next person reading that file. > --- a/libgomp/testsuite/libgomp.fortran/strassen.f90 > +++ b/libgomp/testsuite/libgomp.fortran/strassen.f90 > @@ -0,0 +1 @@ > +! { dg-do run } | ! { dg-options "-O2" } That's not a useful combination, is it? (Just noticed this one here; didn't verify all files suggested to be changed.) Not sure into which direction this should be fixed: continue to just test '-O2', or remove the '-O2' override. > --- a/libgomp/testsuite/libgomp.fortran/use_device_addr-1.f90 > +++ b/libgomp/testsuite/libgomp.fortran/use_device_addr-1.f90 > @@ -0,0 +1 @@ > +! { dg-do run } > --- a/libgomp/testsuite/libgomp.fortran/use_device_addr-2.f90 > +++ b/libgomp/testsuite/libgomp.fortran/use_device_addr-2.f90 > @@ -0,0 +1 @@ > +! { dg-do run } On powerpc64le-unknown-linux-gnu without offloading, I'm seeing (only) the '-O0' execution tests FAIL for both these, with 'STOP 1' message. Grüße Thomas
Hi! Generally, we need to consider the aim to test things sufficiently vs. the already way too long test time of libgomp.fortran testsuite which is not parallelized itself and often takes the longest time in the testsuite. The primary reason to do any option cycling in libgomp.fortran are tests involving variable length types where it matters matters quite a lot if it is -O0 or -O2 or -O3, e.g. with -O0 some temporaries need to be privatized when with optimization they don't, etc., though perhaps we could trim the list and just test -O0 -O2 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions -g and not the other ones. On Fri, Oct 25, 2019 at 06:17:26PM +0200, Tobias Burnus wrote: > diff --git a/libgomp/testsuite/libgomp.fortran/display-affinity-1.f90 b/libgomp/testsuite/libgomp.fortran/display-affinity-1.f90 > index 4811b6f801b..4e732e5427f 100644 > --- a/libgomp/testsuite/libgomp.fortran/display-affinity-1.f90 > +++ b/libgomp/testsuite/libgomp.fortran/display-affinity-1.f90 > @@ -0,0 +1 @@ > +! { dg-do run } In this testcase I don't see the value to cycle through, it is a test for library routines. > +++ b/libgomp/testsuite/libgomp.fortran/lastprivate1.f90 > +++ b/libgomp/testsuite/libgomp.fortran/lastprivate2.f90 > +++ b/libgomp/testsuite/libgomp.fortran/nestedfn4.f90 These are ok. > --- a/libgomp/testsuite/libgomp.fortran/omp_hello.f > +++ b/libgomp/testsuite/libgomp.fortran/omp_hello.f > @@ -0,0 +1 @@ > +C { dg-do run } Not worth it. > --- a/libgomp/testsuite/libgomp.fortran/omp_orphan.f > +++ b/libgomp/testsuite/libgomp.fortran/omp_orphan.f > @@ -0,0 +1 @@ > +C { dg-do run } > --- a/libgomp/testsuite/libgomp.fortran/omp_reduction.f > +++ b/libgomp/testsuite/libgomp.fortran/omp_reduction.f > @@ -0,0 +1 @@ > +C { dg-do run } > --- a/libgomp/testsuite/libgomp.fortran/omp_workshare1.f > +++ b/libgomp/testsuite/libgomp.fortran/omp_workshare1.f > @@ -0,0 +1 @@ > +C { dg-do run } > --- a/libgomp/testsuite/libgomp.fortran/omp_workshare2.f > +++ b/libgomp/testsuite/libgomp.fortran/omp_workshare2.f > @@ -0,0 +1 @@ > +C { dg-do run } Dunno, maybe, though not clear advantages of doing so. > +++ b/libgomp/testsuite/libgomp.fortran/pr25219.f90 > +++ b/libgomp/testsuite/libgomp.fortran/pr28390.f > +++ b/libgomp/testsuite/libgomp.fortran/pr35130.f90 > +++ b/libgomp/testsuite/libgomp.fortran/pr90779.f90 Ok. > --- a/libgomp/testsuite/libgomp.fortran/strassen.f90 > +++ b/libgomp/testsuite/libgomp.fortran/strassen.f90 > @@ -0,0 +1 @@ > +! { dg-do run } Not ok. This is quite an expensive test and it is intentionally run just at -O2. > --- a/libgomp/testsuite/libgomp.fortran/target-simd.f90 > +++ b/libgomp/testsuite/libgomp.fortran/target-simd.f90 > @@ -17 +17 @@ program test > - if (any (b - 5.0 *a > 10.0*epsilon(a))) call abort() > + if (any (b - 5.0 *a > 10.0*epsilon(a))) stop 1 > @@ -25 +25 @@ program test > - if (any (b - 2.0 *a > 10.0*epsilon(a))) call abort() > + if (any (b - 2.0 *a > 10.0*epsilon(a))) stop 2 The call abort -> stop changes are ok. I'm not really happy about the uppercase STOP in all the libgomp.fortran tests that are written completely in lowercase except these stops, but didn't get around to changing it yet. > +++ b/libgomp/testsuite/libgomp.fortran/task2.f90 > +++ b/libgomp/testsuite/libgomp.fortran/taskgroup1.f90 > +++ b/libgomp/testsuite/libgomp.fortran/taskloop1.f90 > +++ b/libgomp/testsuite/libgomp.fortran/use_device_addr-1.f90 > +++ b/libgomp/testsuite/libgomp.fortran/use_device_addr-2.f90 > +++ b/libgomp/testsuite/libgomp.fortran/workshare1.f90 > +++ b/libgomp/testsuite/libgomp.fortran/workshare2.f90 Ok. Jakub
Hi, thanks for the review. On 10/30/19 10:31 AM, Jakub Jelinek wrote: >> +++ b/libgomp/testsuite/libgomp.fortran/omp_orphan.f >> +++ b/libgomp/testsuite/libgomp.fortran/omp_reduction.f >> +++ b/libgomp/testsuite/libgomp.fortran/omp_workshare1.f >> --- a/libgomp/testsuite/libgomp.fortran/omp_workshare2.f >> +++ b/libgomp/testsuite/libgomp.fortran/omp_workshare2.f > Dunno, maybe, though not clear advantages of doing so. I didn't added 'dg-do run' for those. Otherwise as suggested – and committed as Rev. 277606. > I'm not really happy about the uppercase STOP in all the > libgomp.fortran tests that are written completely in lowercase except > these stops, but didn't get around to changing it yet. How about the following patch? Created by sed -i -e 's/STOP /stop /' in testsuite/libgomp.fortran/ and glanced over. (Seemingly, no all-capital-letters file exists.) ? Tobias
On Wed, Oct 30, 2019 at 11:45:11AM +0100, Tobias Burnus wrote: > On 10/30/19 10:31 AM, Jakub Jelinek wrote: > > > +++ b/libgomp/testsuite/libgomp.fortran/omp_orphan.f > > > +++ b/libgomp/testsuite/libgomp.fortran/omp_reduction.f > > > +++ b/libgomp/testsuite/libgomp.fortran/omp_workshare1.f > > > --- a/libgomp/testsuite/libgomp.fortran/omp_workshare2.f > > > +++ b/libgomp/testsuite/libgomp.fortran/omp_workshare2.f > > Dunno, maybe, though not clear advantages of doing so. > > I didn't added 'dg-do run' for those. > Otherwise as suggested – and committed as Rev. 277606. Thanks. > > I'm not really happy about the uppercase STOP in all the libgomp.fortran > > tests that are written completely in lowercase except these stops, but > > didn't get around to changing it yet. > > How about the following patch? Created by > sed -i -e 's/STOP /stop /' in testsuite/libgomp.fortran/ > and glanced over. (Seemingly, no all-capital-letters file exists.) > --- a/libgomp/testsuite/libgomp.fortran/lib2.f > +++ b/libgomp/testsuite/libgomp.fortran/lib2.f > @@ -14 +14 @@ C { dg-do run } > - IF (OMP_TEST_LOCK (LCK)) STOP 1 > + IF (OMP_TEST_LOCK (LCK)) stop 1 ... > --- a/libgomp/testsuite/libgomp.fortran/lib3.f > +++ b/libgomp/testsuite/libgomp.fortran/lib3.f > --- a/libgomp/testsuite/libgomp.fortran/pr25162.f > +++ b/libgomp/testsuite/libgomp.fortran/pr25162.f Please don't change these 3 tests, they are all-capital-letters, at least on the corresponding lines, comments and especially dg-* directives which have to be lowercase don't count (I've looked for IF in capital letters in your patch ;) ). Otherwise LGTM, thanks. Jakub
libgomp/ * testsuite/libgomp.fortran/target-simd.f90: Use stop not abort. * testsuite/libgomp.fortran/use_device_ptr-optional-1.f90: Ditto; add 'dg-do run' for torture testing. * testsuite/libgomp.fortran/display-affinity-1.f90: Add 'dg-do run'. * testsuite/libgomp.fortran/lastprivate1.f90: Ditto. * testsuite/libgomp.fortran/lastprivate2.f90: Ditto. * testsuite/libgomp.fortran/nestedfn4.f90: Ditto. * testsuite/libgomp.fortran/omp_hello.f: Ditto. * testsuite/libgomp.fortran/omp_orphan.f: Ditto. * testsuite/libgomp.fortran/omp_reduction.f: Ditto. * testsuite/libgomp.fortran/omp_workshare1.f: Ditto. * testsuite/libgomp.fortran/omp_workshare2.f: Ditto. * testsuite/libgomp.fortran/pr25219.f90: Ditto. * testsuite/libgomp.fortran/pr28390.f: Ditto. * testsuite/libgomp.fortran/pr35130.f90: Ditto. * testsuite/libgomp.fortran/pr90779.f90: Ditto. * testsuite/libgomp.fortran/strassen.f90: Ditto. * testsuite/libgomp.fortran/task2.f90: Ditto. * testsuite/libgomp.fortran/taskgroup1.f90: Ditto. * testsuite/libgomp.fortran/taskloop1.f90: Ditto. * testsuite/libgomp.fortran/use_device_addr-1.f90: Ditto. * testsuite/libgomp.fortran/use_device_addr-2.f90: Ditto. * testsuite/libgomp.fortran/workshare1.f90: Ditto. * testsuite/libgomp.fortran/workshare2.f90: Ditto. diff --git a/libgomp/testsuite/libgomp.fortran/display-affinity-1.f90 b/libgomp/testsuite/libgomp.fortran/display-affinity-1.f90 index 4811b6f801b..4e732e5427f 100644 --- a/libgomp/testsuite/libgomp.fortran/display-affinity-1.f90 +++ b/libgomp/testsuite/libgomp.fortran/display-affinity-1.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/lastprivate1.f90 b/libgomp/testsuite/libgomp.fortran/lastprivate1.f90 index 132617b5c27..62a5ef9d96c 100644 --- a/libgomp/testsuite/libgomp.fortran/lastprivate1.f90 +++ b/libgomp/testsuite/libgomp.fortran/lastprivate1.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/lastprivate2.f90 b/libgomp/testsuite/libgomp.fortran/lastprivate2.f90 index 6cd5760206c..97b6007e1ef 100644 --- a/libgomp/testsuite/libgomp.fortran/lastprivate2.f90 +++ b/libgomp/testsuite/libgomp.fortran/lastprivate2.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/nestedfn4.f90 b/libgomp/testsuite/libgomp.fortran/nestedfn4.f90 index bc8614a340a..6143bfb283c 100644 --- a/libgomp/testsuite/libgomp.fortran/nestedfn4.f90 +++ b/libgomp/testsuite/libgomp.fortran/nestedfn4.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/omp_hello.f b/libgomp/testsuite/libgomp.fortran/omp_hello.f index ba445312625..0e795482dcf 100644 --- a/libgomp/testsuite/libgomp.fortran/omp_hello.f +++ b/libgomp/testsuite/libgomp.fortran/omp_hello.f @@ -0,0 +1 @@ +C { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/omp_orphan.f b/libgomp/testsuite/libgomp.fortran/omp_orphan.f index 7653c78d2e4..306ed4eb64d 100644 --- a/libgomp/testsuite/libgomp.fortran/omp_orphan.f +++ b/libgomp/testsuite/libgomp.fortran/omp_orphan.f @@ -0,0 +1 @@ +C { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/omp_reduction.f b/libgomp/testsuite/libgomp.fortran/omp_reduction.f index 0560bd8963d..222f20d010a 100644 --- a/libgomp/testsuite/libgomp.fortran/omp_reduction.f +++ b/libgomp/testsuite/libgomp.fortran/omp_reduction.f @@ -0,0 +1 @@ +C { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/omp_workshare1.f b/libgomp/testsuite/libgomp.fortran/omp_workshare1.f index 8aef69406de..6fb8aad3ad0 100644 --- a/libgomp/testsuite/libgomp.fortran/omp_workshare1.f +++ b/libgomp/testsuite/libgomp.fortran/omp_workshare1.f @@ -0,0 +1 @@ +C { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/omp_workshare2.f b/libgomp/testsuite/libgomp.fortran/omp_workshare2.f index 9e61da91e9b..3280dca9e6a 100644 --- a/libgomp/testsuite/libgomp.fortran/omp_workshare2.f +++ b/libgomp/testsuite/libgomp.fortran/omp_workshare2.f @@ -0,0 +1 @@ +C { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/pr25219.f90 b/libgomp/testsuite/libgomp.fortran/pr25219.f90 index 61dd1bc04e6..3b10fceb8b7 100644 --- a/libgomp/testsuite/libgomp.fortran/pr25219.f90 +++ b/libgomp/testsuite/libgomp.fortran/pr25219.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/pr28390.f b/libgomp/testsuite/libgomp.fortran/pr28390.f index a667e08f73e..9b2d29d2f73 100644 --- a/libgomp/testsuite/libgomp.fortran/pr28390.f +++ b/libgomp/testsuite/libgomp.fortran/pr28390.f @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/pr35130.f90 b/libgomp/testsuite/libgomp.fortran/pr35130.f90 index e6be64f15f5..940531e823a 100644 --- a/libgomp/testsuite/libgomp.fortran/pr35130.f90 +++ b/libgomp/testsuite/libgomp.fortran/pr35130.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/pr90779.f90 b/libgomp/testsuite/libgomp.fortran/pr90779.f90 index a6d687abfe6..c14dc87dd00 100644 --- a/libgomp/testsuite/libgomp.fortran/pr90779.f90 +++ b/libgomp/testsuite/libgomp.fortran/pr90779.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/strassen.f90 b/libgomp/testsuite/libgomp.fortran/strassen.f90 index 84faced494a..06e136911e3 100644 --- a/libgomp/testsuite/libgomp.fortran/strassen.f90 +++ b/libgomp/testsuite/libgomp.fortran/strassen.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/target-simd.f90 b/libgomp/testsuite/libgomp.fortran/target-simd.f90 index a58e6a57d15..158347b59dc 100644 --- a/libgomp/testsuite/libgomp.fortran/target-simd.f90 +++ b/libgomp/testsuite/libgomp.fortran/target-simd.f90 @@ -17 +17 @@ program test - if (any (b - 5.0 *a > 10.0*epsilon(a))) call abort() + if (any (b - 5.0 *a > 10.0*epsilon(a))) stop 1 @@ -25 +25 @@ program test - if (any (b - 2.0 *a > 10.0*epsilon(a))) call abort() + if (any (b - 2.0 *a > 10.0*epsilon(a))) stop 2 diff --git a/libgomp/testsuite/libgomp.fortran/task2.f90 b/libgomp/testsuite/libgomp.fortran/task2.f90 index 27151415043..4f363b684a5 100644 --- a/libgomp/testsuite/libgomp.fortran/task2.f90 +++ b/libgomp/testsuite/libgomp.fortran/task2.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/taskgroup1.f90 b/libgomp/testsuite/libgomp.fortran/taskgroup1.f90 index 3f6b38a35f9..145f54f8911 100644 --- a/libgomp/testsuite/libgomp.fortran/taskgroup1.f90 +++ b/libgomp/testsuite/libgomp.fortran/taskgroup1.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/taskloop1.f90 b/libgomp/testsuite/libgomp.fortran/taskloop1.f90 index 48904b145bd..44a14c2433c 100644 --- a/libgomp/testsuite/libgomp.fortran/taskloop1.f90 +++ b/libgomp/testsuite/libgomp.fortran/taskloop1.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/use_device_addr-1.f90 b/libgomp/testsuite/libgomp.fortran/use_device_addr-1.f90 index 2e5ce60d47c..69607e03e88 100644 --- a/libgomp/testsuite/libgomp.fortran/use_device_addr-1.f90 +++ b/libgomp/testsuite/libgomp.fortran/use_device_addr-1.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/use_device_addr-2.f90 b/libgomp/testsuite/libgomp.fortran/use_device_addr-2.f90 index bddb4491414..391a8313aec 100644 --- a/libgomp/testsuite/libgomp.fortran/use_device_addr-2.f90 +++ b/libgomp/testsuite/libgomp.fortran/use_device_addr-2.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-1.f90 b/libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-1.f90 index 93c61216034..ac69df559c9 100644 --- a/libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-1.f90 +++ b/libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-1.f90 @@ -0,0 +1 @@ +! { dg-do run } @@ -17,2 +18,2 @@ contains - if (.not.present(ii)) call abort() - if (.not.associated(ii, ixx)) call abort() + if (.not.present(ii)) stop 1 + if (.not.associated(ii, ixx)) stop 2 @@ -20,2 +21,2 @@ contains - if (.not.present(ii)) call abort() - if (.not.associated(ii)) call abort() + if (.not.present(ii)) stop 3 + if (.not.associated(ii)) stop 4 @@ -29,2 +30,2 @@ contains - if (.not.present(jj)) call abort() - if (associated(jj)) call abort() + if (.not.present(jj)) stop 5 + if (associated(jj)) stop 6 @@ -32,2 +33,2 @@ contains - if (.not.present(jj)) call abort() - if (associated(jj)) call abort() + if (.not.present(jj)) stop 7 + if (associated(jj)) stop 8 diff --git a/libgomp/testsuite/libgomp.fortran/workshare1.f90 b/libgomp/testsuite/libgomp.fortran/workshare1.f90 index 1d2ba7d3ee2..f50928e0a47 100644 --- a/libgomp/testsuite/libgomp.fortran/workshare1.f90 +++ b/libgomp/testsuite/libgomp.fortran/workshare1.f90 @@ -0,0 +1 @@ +! { dg-do run } diff --git a/libgomp/testsuite/libgomp.fortran/workshare2.f90 b/libgomp/testsuite/libgomp.fortran/workshare2.f90 index 655a450885e..88b50fbe457 100644 --- a/libgomp/testsuite/libgomp.fortran/workshare2.f90 +++ b/libgomp/testsuite/libgomp.fortran/workshare2.f90 @@ -0,0 +1 @@ +! { dg-do run }