(j3.2006) DO CONCURRENT question

Bill Long longb
Wed Nov 21 18:16:27 EST 2012



On 11/21/12 4:18 PM, Robert Corbett wrote:
> On 11/21/12 12:53, Bill Long wrote:
>>
>> On 11/21/12 1:13 PM, Lionel, Steve wrote:

>>> DO CONCURRENT (I = 1:N)
>>>
>>> BLOCK
>>>
>>> REAL :: T
>>>
>>> T = A(I) + B(I)
>>>
>>> C(I) = T + SQRT(T)
>>>
>>> END BLOCK
>>>
>>> END DO
>>>
>>> If the BLOCK were removed, so that T was a procedure scope variable, why
>>> wouldn?t ?previously defined during that iteration? be sufficient to
>>> effectively make T local to each iteration, negating the need here for
>>> BLOCK?  Or am I misreading this?
>> No. You are right that the BLOCK is not technically needed here.  What
>> it does is remove any issue concerning T "becomes undefined when the
>> loop terminates" since (this) T does not even exist at the end of the
>> loop.
>>
>> Cheers,
>> Bill
>>
>
> What about the case of module variables, variables in common,
> and variables from an enclosing scoping unit?  They will not
> be easy to "localize."

How would you deal with the case where one of these variables is 
declared PRIVATE in an OpenMP region?  Seems like you would do the same 
thing here.

Cheers,
Bill


>
> Bob Corbett
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
>

-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the J3 mailing list