[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    [PATCH/ fortran] PR35423 omp workshare - first patch
From:       "Vasilis Liaskovitis" <vliaskov () gmail ! com>
Date:       2008-06-28 17:52:34
Message-ID: bec373e0806281052h40c9f561q576a742fd53e7b65 () mail ! gmail ! com
[Download RAW message or body]


Hi,

attached is a first patch implementing parallelization for some
statements within OMP WORKSHARE constructs.

This patch:
- parallelizes array assignments handled by the scalarizer by building
an OMP_FOR
- parallelizes simple where and where..else constructs in the same way.
- clusters all other code (i.e. statements that are not workshared)
into OMP SINGLE blocks
Currently, barriers are placed after every single block or omp_for
workshared construct.

Let me know if someone is interested in reviewing. Any
comments/feedback welcome.

Speedups for the attached bm-*f90 programs using the patched version
with "-O2 -fopenmp" and 1-8 threads:

			1	2	4	8
bm-array	 1.00	 1.98	3.92   7.38
bm-where	1.00	1.94   3.6    7.46

unpatched version has single-thread performance for all threads, since
everything is currently wrapped in omp single. With the patch, the
workshare construct performs the same as as a standard omp do loop for
an array assignment.

bootstrapped and regtested on x86_64 against trunk. Also attached are
some new testcases for workshare constructs.

I have also done some work on the following 2 items, let me know if
you are interested in a patch:
- do dependence analysis between statements so that openmp barriers
are placed only where needed to satisfy dependences. Currently there
is a barrier at the end of every workshared OMP_FOR loop and at the
end of every OMP_SINGLE block.
- workshare array assignments handled with builtin memcpy, memset (see
http://gcc.gnu.org/ml/gcc/2008-04/msg00232.html)

worksharing for intrinsic functions (e.g. SUM, COUNT) is not
implemented. I had some issues debugging this a while back (see thread
above) and haven't looked further into it. I don't plan to do this
unless someone expresses interest.

thanks,

- Vasilis

["pr35423.diff" (application/octet-stream)]
["pr35423.changelog" (application/octet-stream)]
["pr35423-testcases.tar.gz" (application/x-gzip)]
["bm-pr35423-array.f90" (application/octet-stream)]
["bm-pr35423-where.f90" (application/octet-stream)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic