OpenMP options and threading models

Scott Robert Ladd coyote@coyotegulch.com
Tue Oct 19 21:06:00 GMT 2004


To implement OpenMP for C, C++, and Fortran, at least one new compiler 
switch is in order. We may also need to extend configuration options.

Many "other" compilers use a -openmp switch; I suggest that GCC 
implement -fopenmp as a matter of internal consistency. The new switch 
will define appropriate preprocessor symbols (in C and C++), enable 
processing of OpenMP pragmas (in C and C++) or comments (Fortran), and 
perform linking to libgomp and other required libraries.

 From a broad, design standpoint, "processing OpenMP pragmas" entails 
performing code transformations in order to parallelize code. For the 
moment, let's lay aside the details of such transformations, and 
consider the broader question:

Which threading model should OpenMP use?

During configuration of GCC, we allow a number of different threading 
options; should --enable-threads=??? set the threading model used for 
OpenMP?

Or should we have another configuration switch, such as 
--openmp-threads=model?

Some compilers allow OpenMP programs to determine their threading model 
at compile time, i.e. gcc -fopenmp=pthreads. I'm not certain the extra 
complexity of such a design is a good price for the added flexibility.

Considered comments welcome!

-- 
Scott Robert Ladd
site: http://www.coyotegulch.com
blog: http://chaoticcoyote.blogspot.com



More information about the Gcc mailing list