gfortran+libcpp: omp-pragmas

Daniel Franke franke.daniel@gmail.com
Sat Apr 5 12:51:00 GMT 2008


Hi all.

I'm trying to integrate libcpp into gfortran, but keep running in odds and 
ends that don't go well with each other. While whether file included by the 
INCLUDE-statement should be preprocessed or not is disccused frequently, it 
just occured to me: what should be done about C-style OMP-pragma directives?

E.g.
	#pragma omp parallel num_threads(2) shared(x)
instead of
	!$OMP PARALLEL NUM_THREADS(2) SHARED(X)
?

Currently, "#pragma omp parallel" is taken by the preprocessor, subsequently 
generating an parse-error message on "num_threads(2) shared(x)". IMO, one 
should either reject them completely with a proper message, e.g. "'#pragma 
omp' not defined in Fortran, use '!$OMP' instead"), or one could try to 
transparently convert the former into the latter. 

Opinions? Thoughts? Comments?


Thanks.
	Daniel



More information about the Fortran mailing list