[patch, fortran] Remove parallell annotation from DO CONCURRENT

Jakub Jelinek jakub@redhat.com
Thu Apr 12 07:17:00 GMT 2018


On Wed, Apr 11, 2018 at 09:47:22PM +0200, Thomas Koenig wrote:
> Am 11.04.2018 um 20:33 schrieb Jakub Jelinek:
> 
> > > I have attached updated patch which moves the test case to
> > > gfortran.dg/gomp (where it actually passes).
> > 
> > How could it pass there?  dg-do run tests don't belong into g*.dg/gomp/,
> > nothing adds the -B etc. options needed to find libgomp.spec or libgomp
> > as a library, or adds it to LD_LIBRARY_PATH etc.
> > There are zero dg-do run tests in gfortran.dg/gomp/, there are 4
> > dg-do run tests in c-c++-common/gomp/, but those work fine because they
> > use -fopenmp-simd option rather than
> > -fopenmp/-fopenacc/-ftree-parallelize-loops= etc.
> 
> So, where should the test go?
> 
> The suggestion in PR 85346, to put it into
> libgomp/testsuite/libgomp.fortran/, does not work:

Yes, and I said what can be done to make it work; in patch form below.

> Running ../../../../trunk/libgomp/testsuite/libgomp.fortran/fortran.exp ...
> FAIL: libgomp.fortran/do_concurrent_5.f90   -O  execution test
> 
> even when ne (the array size) has been reduced to 2**20, far below

ne is not the array size, the array size is 8 * ne, and 8 * 1MB is 8MB and
you eat all of the usual stack limit just by that.

> reasonable memory limits.  The test passes when given the
> -O1 -ftree-parallelize-loops=2 options by hand.
> 
> So, what's the idea? Is there actually a directory which works,
> or are we left with a wrong-code bug for which no test case is
> possible? That would be quite bad, I think.

Here is incremental diff.  With the dg-skip-if and removal of explicit -O3,
you make the test run only once with -O3 -g, and skip the other variants:
UNSUPPORTED: libgomp.fortran/do_concurrent_5.f90   -O0 
UNSUPPORTED: libgomp.fortran/do_concurrent_5.f90   -O1 
UNSUPPORTED: libgomp.fortran/do_concurrent_5.f90   -O2 
UNSUPPORTED: libgomp.fortran/do_concurrent_5.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions 
UNSUPPORTED: libgomp.fortran/do_concurrent_5.f90   -Os 
and with -fno-openmp you disable the default -fopenmp which you really don't
need for the testcase, there are no OpenMP directives in there.

--- libgomp/testsuite/libgomp.fortran/do_concurrent_5.f90	2018-04-11 17:27:59.035100057 +0200
+++ libgomp/testsuite/libgomp.fortran/do_concurrent_5.f90	2018-04-12 09:12:40.611789503 +0200
@@ -1,6 +1,7 @@
 ! { dg-do run }
 ! PR 83064 - this used to give wrong results.
-! { dg-additional-options "-O3 -ftree-parallelize-loops=2" }
+! { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O3 -g" } }
+! { dg-additional-options "-fno-openmp -ftree-parallelize-loops=2" }
 ! Original test case by Christian Felter
 
 program main
@@ -8,7 +9,7 @@ program main
     implicit none
 
     integer, parameter :: nsplit = 4
-    integer(int64), parameter :: ne = 20000000
+    integer(int64), parameter :: ne = 2000000
     integer(int64) :: stride, low(nsplit), high(nsplit), edof(ne), i
     real(real64), dimension(nsplit) :: pi
     


	Jakub



More information about the Gcc-patches mailing list