Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!know!news.cs.indiana.edu!ariel.unm.edu!news From: john@ghostwheel.unm.edu (John Prentice) Newsgroups: comp.lang.fortran Subject: Parallel Fortran question Message-ID: <1990Dec11.055853.1248@ariel.unm.edu> Date: 11 Dec 90 05:58:53 GMT Sender: news@ariel.unm.edu (USENET News System) Organization: University of New Mexico Math Dept., Albuquerque, NM Lines: 53 I posted this earlier today, but it doesn't seem to have showed up. If you get two copies, my apologies. John I want to code the following for a shared memory parallel system: program yuppie c c loop over subroutine c integer n,nmax parameter (nmax=10) real hippie(nmax) do 10 n=1,nmax call yippie (hippie(n)) . . . call yippie (hippie(n)) . . . 10 continue end subroutine yippie (hippie) real hippie logical first save first data first /.true./ c if (first) then . [initializations] . first=.false. endif . . . end When yippie gets called the first time, it does some initializations. Subsequent calls for the same loop iteration should not repeat the initialization however (assume I am parallelizing the loop in the main routine). The way I wrote yippie works fine on a non-shared memory machine, but not on a shared memory system. This is because the save statement causes yippie to always save first to the same memory location, no matter which processor is being used. On the Cray, you could use task common to save the value of first, but there is no way to initialize task common (that I know of). Any suggestions? Thanks. John Prentice john@unmfys.unm.edu