(j3.2006) Questions about relationship between BLOCK and DO CONCURRENT

Malcolm Cohen malcolm
Thu Jul 17 00:48:43 EDT 2008


Van Snyder wrote:
> If an object is declared within a BLOCK within a DO CONCURRENT
> construct, is there a different one for each iteration?
Of course.  Why would you think the CONCURRENT clause makes it 
different?  I see no words that say that BLOCK makes these variables 
"except when it's inside a DO CONCURRENT, where the iterations share them".

And it's not like BLOCK is the only way of getting 
iteration-dependently-sized objects: if the DO CONCURRENT has
   PRINT *,[ (j,j=1,i) ]
then each iteration has its own array constructor with its own size and 
value, i.e. not shared between the iterations; if it's got
   ALLOCATE(a(i*100))
   ... calculation using A
   DEALLOCATE(a)
where A is a subprogram-scoped allocatable array, each iteration has a 
different size of A to work with (and on a parallel machine each CPU 
would be able to use its own local version of A instead of referencing 
the global, in fact that would be the whole idea of the bullet point at 
the top of p180).

Cheers,
-- 
.............................Malcolm.

P.S. (to several people, not just Van): discussing the "optional value 
of bind(c)" in private on the J3 list is all very fine, especially when 
it's more heat than light, but Bill did start the discussion on the WG5 
list.

P.P.S. (to Dan) It would probably be a good idea if the J3 mailing list 
software could set the Reply-Address for WG5 messages to the WG5 list, 
only setting the Reply-Address to the J3 list for non-WG5 messages, but 
maybe that's hoping for too much sophistication.  But if possible it 
would help to avoid the "discussion in separate rooms" effect.





More information about the J3 mailing list