Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!newstop!texsun!convex!bleikamp From: bleikamp@convex.com (Richard Bleikamp) Newsgroups: comp.lang.fortran Subject: Re: vectorization question Summary: Fortran 90 aids to vectorization Keywords: Fortran 90 Message-ID: <1991Mar29.195509.2323@convex.com> Date: 29 Mar 91 19:55:09 GMT References: <1991Mar29.141313.7418@ariel.unm.edu> <1991Mar29.165126.11431@rice.edu> Sender: usenet@convex.com (news access account) Organization: Convex Computer Corporation, Richardson, Tx. Lines: 38 Nntp-Posting-Host: mozart.convex.com In article <1991Mar29.165126.11431@rice.edu> paco@rice.edu (Paul Havlak) writes: > >In article <1991Mar29.141313.7418@ariel.unm.edu>, prentice@triton.unm.edu (John Prentice) writes: >|> Consider the following loop: >|> >|> do 30 k=1,kmax >|> do 20 j=1,jmax >|> do 10 i=1,imax >|> a(i,j,k)=... >|> 10 continue >|> 20 continue >|> 30 continue >|> >|> On the Cray, only the inner most loop will vectorize. >|> ... > > useful discussion deleted. > >Good news about Fortran 90: You can write the above loop in triplet notation: > > a(1:imax,1:jmax,1:kmax) = ... > > more discussion deleted. > >Paul Havlak Note that substituting Fortran 90 array notation is ONLY valid when the assignment statement "a(i,j,k)= ..." does NOT contain a loop carried dependency. It can be non-trivial (in complicated loops) to decide if any dependencies exist. When they do, you can sometimes rewrite the loop nest as two or more separate Fortran 90 assignment statements, but sometimes there is no semantically equivalent array notation. -- ------------------------------------------------------------------------------ Rich Bleikamp bleikamp@convex.com Convex Computer Corporation