From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,100c510dac09e617 X-Google-Attributes: gid111c93,public From: Toon Moene Subject: Re: MFlops Comparison using g77 (bad news) Date: 1997/09/16 Message-ID: <5vml8c$6kb$1@news.utrecht.NL.net>#1/1 X-Deja-AN: 273038339 References: <5vl4lv$8ko@bgtnsc03.worldnet.att.net> Organization: Moene Computational Physics, Maartensdijk, The Netherlands Newsgroups: comp.os.linux.alpha "Luke Lonergan" wrote: > I am running a simple Ocean model to benchmark machines. The computational > kernel is simple: > > ---------------------------------------------------------------------------- > ------------------------ > C Operation count = 9 operations/grid point > > do j = 2, ny-1 > do i = 2, nx-1 > psi_new(i,j) = a1*psi(i+1,j)+a2*psi(i-1,j)+ > & a3*psi(i,j+1)+a4*psi(i,j-1)- > & a5*f(i,j) > end do > end do > ---------------------------------------------------------------------------- > ------------------------ [ ... Horrendous performance figures ... ] > One of several things is wrong. It's not the memory system, as I observe > flat performance up to the 256 MBytes > of memory on the machine. > > I think the compiler is the culprit. Any ideas? This sort of code tends to benefit rather handsomely from the optimisation known as "strength reduction", basically changing all array index arithmetic by simple stride 4 (or 8 in case of DOUBLE PRECISION) steps through the arrays. However, in g77 "strength reduction" is almost completely ineffective on the Alpha, because the optimisation pass doesn't know how to deal with subword integers (the default INTEGER in g77 is 32 bits wide, which is half of a 64-bit register). I'm working on a solution to this problem, but so far I've produced nothing more than a patch purely as a Gedankenexperiment (on a Motorola 68040 based NEXTSTATION ;-) -- Toon Moene (mailto:toon@moene.indiv.nluug.nl) Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Phone: +31 346 214290; Fax: +31 346 214286 g77 Support: mailto:fortran@gnu.ai.mit.edu; NWP: http://www.knmi.nl/hirlam