This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran, doc] Improve docs of OpenMP, add contributors
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 23 Jan 2008 20:22:43 +0100
- Subject: [patch, fortran, doc] Improve docs of OpenMP, add contributors
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date:user-agent:mime-version:content-type:message-id; bh=SXohUgV5m4gANJAHV6g8B/aAbga9QFceTNSAu8GXlcg=; b=ZVwUZ8lX43WIGpFBsJ1MXh4PJxMJD9KgNNuAbhXTjEVQP3kNu4Q/ouRs8Noo2+OOeRskh+TtH/t4sFUC1zg7Iht/GxnslVuhSK5966+Z6a0bs3jFwj0oAkemqDMIYZcSqH2lwNdWT0/xb7rbEpeMG0lV5IUAh2gdZti3z/fvqdc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type:message-id; b=AdCbu6fMfbO5rCzvSyrtG5gQ4FAjdKj0Ypt9bCMhKSBlG4zAjV8e9gigMLwAXja+kLmB1MXLzzuetfFSyWzZw5+ndEKRdF6D7kAmftDYhzdG1AUvhknaf1Gg6huxBhep3DOhIrNCbcdpEA3heybSrPxw1ZxSznczLfelZyQ+P+E=
Hi all.
As a colleague keeps nagging me about implementation details of gfortran and
OpenMP and I keep telling him to read the docs, I realized that there wasn't
much documentation to speak of. This is meant to improve matters slightly.
Further, while browsing gfortran.texi, I removed some TODO items that were
dealt with and added some contributors to gfortran that were missing in the
list. I used the Annual Report 2008 as a template for this. If I missed
anyone who should be named, please accept my apologies in advance.
2008-01-23 Daniel Franke <franke.daniel@gmail.com>
* gfortran.texi (OpenMP): Extended existing documentation.
(contributors): Added major contributors of 2008 that were
not listed yet.
(proposed extensions): Removed implemented items.
Tested doc, dvi and html targets on i686-pc-linux-gnu. Ok for trunk?
Regards
Daniel
Index: gfortran.texi
===================================================================
--- gfortran.texi (revision 131761)
+++ gfortran.texi (working copy)
@@ -1400,18 +1400,59 @@ portable.
@section OpenMP
@cindex OpenMP
-GNU Fortran attempts to be OpenMP Application Program Interface v2.5
-compatible when invoked with the @option{-fopenmp} option. GNU Fortran
-then generates parallelized code according to the OpenMP directives
-used in the source. The OpenMP Fortran runtime library
-routines are provided both in a form of a Fortran 90 module named
-@code{omp_lib} and in a form of a Fortran @code{include} file named
-@file{omp_lib.h}.
+The OpenMP (Open Multi-Processing) is an application programming
+interface (API) that supports multi-platform shared memory
+multiprocessing programming in C/C++ and Fortran on many
+architectures, including Unix and Microsoft Windows platforms.
+It consists of a set of compiler directives, library routines,
+and environment variables that influence run-time behavior.
-For details refer to the actual
+GNU Fortran strives to be compatible to the
@uref{http://www.openmp.org/drupal/mp-documents/spec25.pdf,
-OpenMP Application Program Interface v2.5} specification and to the
-@ref{Top,,Introduction,libgomp,GNU OpenMP runtime library}.
+OpenMP Application Program Interface v2.5}.
+
+To enable processing of the OpenMP directives @code{!$omp} in free
+form, @code{c$omp}, @code{*$omp} and @code{!$omp} directives in fixed
+form, @code{!$} conditional compilation sentinels in free form and
+@code{c$}, @code{*$} and @code{!$} sentinels in fixed form,
+@command{gfortran} needs to be invoked with the @option{-fopenmp}.
+This also arranges for automatic linking of the GNU OpenMP runtime
+library @ref{Top,,libgomp,libgomp,GNU OpenMP runtime library}.
+
+The OpenMP Fortran runtime library routines are provided both in a
+form of a Fortran 90 module named @code{omp_lib} and in a form of
+a Fortran @code{include} file named @file{omp_lib.h}.
+
+An example of a parallelized loop taken from Appendix A.1 of
+the OpenMP Application Program Interface v2.5:
+@smallexample
+SUBROUTINE A1(N, A, B)
+ INTEGER I, N
+ REAL B(N), A(N)
+!$OMP PARALLEL DO !I is private by default
+ DO I=2,N
+ B(I) = (A(I) + A(I-1)) / 2.0
+ ENDDO
+!$OMP END PARALLEL DO
+END SUBROUTINE A1
+@end smallexample
+
+Please note:
+@itemize
+@item
+@option{-fopenmp} implies @option{-frecursive}, i.e. all local arrays
+will be allocated on the stack. When porting existing code to OpenMP,
+this may lead to surprising results, especially to segmentation faults
+if the stacksize is limited.
+
+@item
+On glibc-based systems, OpenMP enabled applications can not be statically
+linked due to limitations of the underlying pthreads-implementation. It
+might be possible to get a working solution if
+@command{-Wl,--whole-archive -lpthread -Wl,--no-whole-archive} is added
+to the command line. However, this is not supported by @command{gcc} and
+thus not recommended.
+@end itemize
@node Argument list functions
@section Argument list functions %VAL, %REF and %LOC
@@ -1508,35 +1549,41 @@ Most of the interface with GCC was writt
The following individuals have contributed code and/or
ideas and significant help to the GNU Fortran project
-(in no particular order):
+(in alphabetical order):
@itemize @minus
-@item Andy Vaught
-@item Katherine Holcomb
-@item Tobias Schl@"uter
+@item Janne Blomqvist
@item Steven Bosscher
-@item Toon Moene
-@item Tim Prince
-@item Niels Kristian Bech Jensen
-@item Steven Johnson
@item Paul Brook
-@item Feng Wang
-@item Bud Davis
-@item Paul Thomas
+@item Tobias Burnus
@item Fran@,{c}ois-Xavier Coudert
-@item Steven G. Kargl
-@item Jerry Delisle
-@item Janne Blomqvist
+@item Bud Davis
+@item Jerry DeLisle
@item Erik Edelmann
+@item Bernhard Fischer
+@item Daniel Franke
+@item Richard Guenther
+@item Richard Henderson
+@item Katherine Holcomb
+@item Jakub Jelinek
+@item Niels Kristian Bech Jensen
+@item Steven Johnson
+@item Steven G. Kargl
@item Thomas Koenig
@item Asher Langton
-@item Jakub Jelinek
-@item Roger Sayle
-@item H.J. Lu
-@item Richard Henderson
+@item H. J. Lu
+@item Toon Moene
+@item Brooks Moses
+@item Andrew Pinski
+@item Tim Prince
+@item Christopher D. Rickett
@item Richard Sandiford
-@item Richard Guenther
-@item Bernhard Fischer
+@item Tobias Schl@"uter
+@item Roger Sayle
+@item Paul Thomas
+@item Andy Vaught
+@item Feng Wang
+@item Janus Weil
@end itemize
The following people have contributed bug reports,
@@ -1545,9 +1592,10 @@ and much needed feedback and encourageme
GNU Fortran project:
@itemize @minus
-@item Erik Schnetter
@item Bill Clodius
+@item Dominique d'Humieres
@item Kate Hedstrom
+@item Erik Schnetter
@end itemize
Many other individuals have helped debug,
@@ -1625,13 +1673,6 @@ Flag to force local variables into stati
@item
Flag to force local variables onto stack.
-
-@item
-Flag for maximum errors before ending compile.
-
-@item
-Option to initialize otherwise uninitialized integer and floating
-point variables.
@end itemize