Fortran parameter

Discussion of the OpenMP 3.1 draft specifications closed May 1, 2011. (Read only)

Fortran parameter

Postby FDSUser » Fri Apr 08, 2011 11:10 am

All,

I checked the 3.1 specification (and 3.0) and found no entry that a fortran parameter can not be used within a shared list, if I use a DEFAULT(NONE) clause. Maybe this could be added for clarification, here a short example, which is not possible:
Code: Select all
REAL, PARAMETER :: Y_FU_MIN=2.0

!$OMP PARALLEL DEFAULT(NONE) SHARED(Y_FU_MIN)


If Y_FU_MIN has not the paramter attribute, it will work...
I had this problem and first I didn't know what the compiler tried to tell me, thus I recommend to add this to the Spec for the Shared-clause
FDSUser
 
Posts: 17
Joined: Sat Nov 15, 2008 8:54 pm

Re: Fortran parameter

Postby Federico » Sat Apr 09, 2011 1:40 pm

OpenMP specs clearly state more than once that data-sharing attributes apply only to variables.
Fortran parameters do not match the OpenMP definition of a variable (see Glossary, section 1.2.4), as their values cannot be redefined. Consequently, they are not affected by data-sharing defaults nor allowed on data-sharing clauses.

You can safely remove Y_FU_MIN from the list of shared variables, as it's not needed. Its value will be accessible in the PARALLEL construct, no matter what the DEFAULT() is.
Federico
 


Return to Draft 3.1 Public Comment

Who is online

Users browsing this forum: No registered users and 2 guests