This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH/ fortran] PR35423 omp workshare - first patch


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

Attachment: pr35423.diff
Description: Binary data

Attachment: pr35423.changelog
Description: Binary data

Attachment: pr35423-testcases.tar.gz
Description: GNU Zip compressed data

Attachment: bm-pr35423-array.f90
Description: Binary data

Attachment: bm-pr35423-where.f90
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]