Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!lll-winken!ames!amelia!eagle!news From: xxrich@alliant1 (Rich Rinehart) Newsgroups: comp.sys.alliant Subject: Re: inter-loop locking Message-ID: <1990Mar29.152045.28708@eagle.lerc.nasa.gov> Date: 29 Mar 90 15:20:45 GMT References: <1990Mar27.132340.4243@eagle.lerc.nasa.gov> <3768@alliant.Alliant.COM> Reply-To: xxrich@alliant1.lerc.nasa.gov (Rich Rinehart) Organization: NASA/Lewis Research Center Lines: 54 >>I would like to force some MIMD like operation on the following >>loop but am having troubles figuring out the synchronization. >>Can anyone be of help? The problem is something like this.... > >> cvd$ concur >> do 100 I=1,100 >> call sub1 >> call sub2 >> c do sub3 only after sub1 and 2 have completed >> call sub3 >> 100 continue > > >As written, every iteration in the concurrent 'do 100' loop will be assigned >its own processor, and each will execute its own copy of sub1 then sub2 then >sub3, in order. So as it stands, it will do exactly what you asked for, on a This isn't what i wanted but i didn't realize this. It would complete 100 iterations of sub1, then go on to sub2? >However, I suspect perhaps you meant something different. One possibility is >to force *simultaneous execution* of sub1 and sub2, *then* do sub3: Yes, this is what i wanted >cvd$ cncall > do 100 I=1,2 > if (I.eq.1) call sub1 > if (I.eq.2) call sub2 >100 continue > call sub3 > >The 'do 100' loop is a trick to create a concurrent loop with each iteration >doing something different. Again, no locks are required, but both sub1 and >sub2 (and any child-subroutines) must be compiled 'recursive'. (The test Neat trick. How can i guarantee that sub1 and sub2 will act in a mimd fassion? What if sub1 call other routines which the compiler might find what it thinks to be a 'better' loop to parallelize? Why must it be compiled recursively for this? (or is this the answer). Thank you for your locking explaination as I plan to use it for another analysis. Thanks again for help! -rich -- ----------------------------------------------------------------------------- Rich Rinehart | phone: 216-433-5211 NASA Lewis Research Center | email: xxrich@alliant1.lerc.nasa.gov -----------------------------------------------------------------------------