* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-16 4:00 ` Toon Moene
@ 1997-09-16 4:00 ` Luke Lonergan
1997-09-18 4:00 ` Thomas Leitner
1997-09-18 4:00 ` H.W. Stockman
0 siblings, 2 replies; 16+ messages in thread
From: Luke Lonergan @ 1997-09-16 4:00 UTC (permalink / raw)
On 16 Sep 1997 19:04:44 GMT, Toon Moene <toon@moene.indiv.nluug.nl>
wrote:
>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 implemented the kernel in C this morning. Unfortunately my news
server was screwed up at work so I couldn't post the results until
now:
----------------------------------------------------------------------------
/* Operation count = 9 operations/grid point */
for (j=1;j<*ny-1;j++) {
indj = (*nx)*j;
indjp1 = (*nx)*(j+1);
indjm1 = (*nx)*(j-1);
for (i=1;i<*nx-1;i++) {
indx = i+indj;
psi_new[indx] = (*a1)*psi[indx+1]+(*a2)*psi[indx-1]+
(*a3)*psi[i+indjp1]+(*a4)*psi[i+indjm1]-
(*a5)*f[indx];
}
}
----------------------------------------------------------------------------
I expected the result to be similar to the Fortran version, but lo and
behold:
48 MFlops, 433 MHz Alpha using gcc and the C kernel
36 MFlops, 433 MHz Alpha using g77
36 MFlops on the PPro 200 using gcc and the C kernel
40 MFlops on the PPro 200 using g77
The answer is still dramatically (factor of 2?) lower than I would
like, but interesting. I thought the code generator was the culprit,
but apparently the front end is involved in the Alpha's poor
performance as well.
BTW, the compiler options I used were:
-ffast-math -O2 (-m486 on the PPro)
I tried using the -fstrength-reduce on the C kernel and the Fortran
and got no change on the Fortran (36 MFlops) and a bump to the
C (49 MFlops versus 48).
I am posting the source tree here for anyone else who would like to
take a whack at it.
Luke
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-16 4:00 ` MFlops Comparison using g77 (bad news) - bench.tgz (0/1) Luke Lonergan
@ 1997-09-18 4:00 ` Thomas Leitner
1997-09-18 4:00 ` Andrew G. Morgan
1997-09-18 4:00 ` H.W. Stockman
1 sibling, 1 reply; 16+ messages in thread
From: Thomas Leitner @ 1997-09-18 4:00 UTC (permalink / raw)
In article <341f0c1d.68509433@netnews.worldnet.att.net> you wrote:
> On 16 Sep 1997 19:04:44 GMT, Toon Moene <toon@moene.indiv.nluug.nl>
> wrote:
> 48 MFlops, 433 MHz Alpha using gcc and the C kernel
> 36 MFlops, 433 MHz Alpha using g77
> 36 MFlops on the PPro 200 using gcc and the C kernel
> 40 MFlops on the PPro 200 using g77
This is what I get on an AlphaStation 500/500 running Digital Unix 4.0b
using DEC CC and DEC F77 and the code you've posted as bench.tgz
with the following options:
FOPTIONS = -O5
COPTIONS = -DUSCORE -O3 -fast
MFlops/Second = 93.03, C-Kernel
MFlops/Second = 123.79, F-Kernel
Looks as if DEC compilers are really much better than GNU stuff ??
Tom
--
--------------------------------------------------------------------------
T o m L e i t n e r Dept. of Communications
Graz University of Technology,
e-mail : tom@finwds01.tu-graz.ac.at Inffeldgasse 12
Phone : +43-316-873-7455 A-8010 Graz / Austria / Europe
Fax : +43-316-463-697
Home page : http://wiis.tu-graz.ac.at/people/tom.html
PGP public key on : ftp://wiis.tu-graz.ac.at/pgp-keys/tom.asc or send
mail with subject "get Thomas Leitner" to pgp-public-keys@keys.pgp.net
--------------------------------------------------------------------------
Before we have the paperless office, we have the paperless toilet!
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-18 4:00 ` Thomas Leitner
@ 1997-09-18 4:00 ` Andrew G. Morgan
0 siblings, 0 replies; 16+ messages in thread
From: Andrew G. Morgan @ 1997-09-18 4:00 UTC (permalink / raw)
(This is the first time I've tried to post with Netscape 4.02b7. If it all
comes
out in "html", my apologies and I'll start using emacs..)
Another Data point: Microway have beta released a 64bit version of their
Linux/Alpha compiler (version 4.6.1) and here is the fortran number for
Luke's
benchmark:
mf64 -O5 -fastlib -onv:
Time to calculate solution: 0.30 seconds.
Flops/Second = 80.66
[Note, that the timer Luke's code uses is a "real" timer and does not take
into
account the fact that other jobs may be running on the machine.]
Cheers
Andrew
Thomas Leitner wrote:
> In article <341f0c1d.68509433@netnews.worldnet.att.net> you wrote:
> > On 16 Sep 1997 19:04:44 GMT, Toon Moene <toon@moene.indiv.nluug.nl>
> > wrote:
>
> > 48 MFlops, 433 MHz Alpha using gcc and the C kernel
> > 36 MFlops, 433 MHz Alpha using g77
>
> > 36 MFlops on the PPro 200 using gcc and the C kernel
> > 40 MFlops on the PPro 200 using g77
>
> This is what I get on an AlphaStation 500/500 running Digital Unix 4.0b
> using DEC CC and DEC F77 and the code you've posted as bench.tgz
> with the following options:
>
> FOPTIONS = -O5
> COPTIONS = -DUSCORE -O3 -fast
>
> MFlops/Second = 93.03, C-Kernel
> MFlops/Second = 123.79, F-Kernel
>
> Looks as if DEC compilers are really much better than GNU stuff ??
>
> Tom
> --
> --------------------------------------------------------------------------
> T o m L e i t n e r Dept. of Communications
> Graz University of Technology,
> e-mail : tom@finwds01.tu-graz.ac.at Inffeldgasse 12
> Phone : +43-316-873-7455 A-8010 Graz / Austria / Europe
> Fax : +43-316-463-697
> Home page : http://wiis.tu-graz.ac.at/people/tom.html
> PGP public key on : ftp://wiis.tu-graz.ac.at/pgp-keys/tom.asc or send
> mail with subject "get Thomas Leitner" to pgp-public-keys@keys.pgp.net
> --------------------------------------------------------------------------
> Before we have the paperless office, we have the paperless toilet!
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-16 4:00 ` MFlops Comparison using g77 (bad news) - bench.tgz (0/1) Luke Lonergan
1997-09-18 4:00 ` Thomas Leitner
@ 1997-09-18 4:00 ` H.W. Stockman
1 sibling, 0 replies; 16+ messages in thread
From: H.W. Stockman @ 1997-09-18 4:00 UTC (permalink / raw)
Luke Lonergan wrote:
> /* Operation count = 9 operations/grid point */
>
> for (j=1;j<*ny-1;j++) {
>
> indj = (*nx)*j;
> indjp1 = (*nx)*(j+1);
> indjm1 = (*nx)*(j-1);
>
> for (i=1;i<*nx-1;i++) {
> indx = i+indj;
> psi_new[indx] = (*a1)*psi[indx+1]+(*a2)*psi[indx-1]+
> (*a3)*psi[i+indjp1]+(*a4)*psi[i+indjm1]-
> (*a5)*f[indx];
> }
> }
[...]
> I am posting the source tree here for anyone else who would like to
> take a whack at it.
Have you tried forcing some of the intensely-used
pointers into registers?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
[not found] <5vqs28$3el@news-rocq.inria.fr>
@ 1997-09-22 4:00 ` Luke Lonergan
1997-09-22 4:00 ` Jim West
1997-09-22 4:00 ` Greg Lindahl
0 siblings, 2 replies; 16+ messages in thread
From: Luke Lonergan @ 1997-09-22 4:00 UTC (permalink / raw)
On 18 Sep 1997 09:25:28 GMT, harley@pauillac.inria.fr (Robert Harley)
wrote:
>The C kernels were compiled with one of:
> cc -DUSCORE -migrate -O5 -tune ev5 -fast
> gcc -DUSCORE -O4
>
>Results:
> Machine Kernel compiler Mflops
> --------------------------------
> Corton Luke cc 54
> gcc 55
> me cc 90
> gcc 91
Thanks for clearing that up. 8MB of cache seems like a really good
thing, I wish it were cheap and available.
BTW, how did you get such good performance out of the C kernel? I
tried just using long ints on the best version of the C code I have
and didn't get a performance benefit. Here is the best version of the
C kernel I have (can you post yours?):
void jacobi_(float *psi_new,float *psi,float *f,
float *a1, float *a2, float *a3, float *a4, float *a5,
int *nx,int *ny,int *nx_max,int *ny_max) {
int i,j;
int indij,indip1j,indim1j,indijp1,indijm1;
float *p_ij_psi_new,*p_ij_psi,*p_ij_f;
float *p_ip1j_psi,*p_im1j_psi;
float *p_ijp1_psi,*p_ijm1_psi;
/* Critical performance benefit here! The value of nx is used in the
memory offset calculations and needs to be local to avoid
frequent
reloading and stalls. */
int nx_r=(*nx);
/* Copy the floating point values of constants into local memory for
the same reason as above. */
float aa1=(*a1),aa2=(*a2),aa3=(*a3),aa4=(*a4),aa5=(*a5);
i = 1; j = 1;
indij = i+(nx_r)*(j);
indim1j = indij-1;
indip1j = indij+1;
indijm1 = indij-(nx_r);
indijp1 = indij+(nx_r);
/* Create the starting locations of the pointers */
p_ij_psi_new = psi_new + indij;
p_ij_f = f + indij;
p_ij_psi = psi + indij;
p_im1j_psi = psi + indim1j;
p_ip1j_psi = psi + indip1j;
p_ijm1_psi = psi + indijm1;
p_ijp1_psi = psi + indijp1;
for (j=1;j<(*ny)-1;j++) {
for (i=1;i<(nx_r)-1;i++) {
*p_ij_psi_new++ = aa1*(*p_ip1j_psi++)+aa2*(*p_im1j_psi++)+
aa3*(*p_ijp1_psi++)+aa4*(*p_ijm1_psi++)+
aa5*(*p_ij_f++);
}
/* Fixup for the two skipped I locations */
p_ij_psi_new+=2;
p_ip1j_psi+=2;
p_im1j_psi+=2;
p_ijp1_psi+=2;
p_ijm1_psi+=2;
p_ij_f+=2;
}
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-22 4:00 ` Greg Lindahl
@ 1997-09-22 4:00 ` Greg Lindahl
0 siblings, 0 replies; 16+ messages in thread
From: Greg Lindahl @ 1997-09-22 4:00 UTC (permalink / raw)
lindahl@pbm.com (Greg Lindahl) writes:
> Aspen System's new Blackhawk motherboard has a user upgradable L2 cache
> which can go to 8 megabytes. Other than that it's identical to the
> PC164LX.
Never post after midnight.
I meant to say "L3", and it may be limited to 0-4 megabytes.
-- g
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-22 4:00 ` MFlops Comparison using g77 (bad news) - bench.tgz (0/1) Luke Lonergan
1997-09-22 4:00 ` Jim West
@ 1997-09-22 4:00 ` Greg Lindahl
1997-09-22 4:00 ` Greg Lindahl
1 sibling, 1 reply; 16+ messages in thread
From: Greg Lindahl @ 1997-09-22 4:00 UTC (permalink / raw)
luke@navo.hpc.mil (Luke Lonergan) writes:
> Thanks for clearing that up. 8MB of cache seems like a really good
> thing, I wish it were cheap and available.
Aspen System's new Blackhawk motherboard has a user upgradable L2 cache
which can go to 8 megabytes. Other than that it's identical to the
PC164LX.
-- g
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-22 4:00 ` MFlops Comparison using g77 (bad news) - bench.tgz (0/1) Luke Lonergan
@ 1997-09-22 4:00 ` Jim West
1997-09-23 4:00 ` Greg Lindahl
1997-09-23 4:00 ` Luke Lonergan
1997-09-22 4:00 ` Greg Lindahl
1 sibling, 2 replies; 16+ messages in thread
From: Jim West @ 1997-09-22 4:00 UTC (permalink / raw)
In article <3425c740.24725060@netnews.worldnet.att.net>,
Luke Lonergan <luke@navo.hpc.mil> wrote:
>
> /* Critical performance benefit here! The value of nx is used in the
> memory offset calculations and needs to be local to avoid
>frequent
> reloading and stalls. */
> int nx_r=(*nx);
I'm wondering if an optimizing compiler sould pick this up even without the
explicit definition of nx_r. Can anyone explain why it wouldn't?
jw
--
Jim West jwest@jwest.ecen.okstate.edu
Associate Professor jwest@master.ceat.okstate.edu
Electrical and Computer Engineering
Oklahoma State University
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-22 4:00 ` Jim West
1997-09-23 4:00 ` Greg Lindahl
@ 1997-09-23 4:00 ` Luke Lonergan
1 sibling, 0 replies; 16+ messages in thread
From: Luke Lonergan @ 1997-09-23 4:00 UTC (permalink / raw)
On 22 Sep 1997 14:53:51 GMT, jwest@jwest.ecen.okstate.edu (Jim West)
wrote:
>I'm wondering if an optimizing compiler sould pick this up even without the
>explicit definition of nx_r. Can anyone explain why it wouldn't?
Well, it might all be unnecessary if we could gain the wisdom of
Robert's implementation :-)
The one thing I was trying to do was get as close to the FORTRAN
version's efficiency on the non-Alpha platforms. I succeeded on the
Pentium Pro and Pentium machines. One reason why is that the FORTRAN
code benefits greatly from hardcoding of dimensions. That is, if you
explicitly put the 1002,1002 numbers in the FORTRAN kernel, you get a
great (~20%) performance increase.
I think I am doing the same thing when I localize the reference to the
nx dimension in the C kernel by putting it into stack (and through
optimization into register). I did this after looking at the assembler
code in the two versions of the FORTRAN kernel, with and without the
hardcoded dimensions and found a lot of address resolution in one
where the other simply had a $### telling it how far to advance the
reference. I can't think of a way to explicitly code this same
approach in FORTRAN, though I am pretty sure that a lot of other
compilers do the same thing I did in the C kernel.
Luke
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-22 4:00 ` Jim West
@ 1997-09-23 4:00 ` Greg Lindahl
1997-09-23 4:00 ` Volker Barthelmann
1997-09-26 4:00 ` H.W. Stockman
1997-09-23 4:00 ` Luke Lonergan
1 sibling, 2 replies; 16+ messages in thread
From: Greg Lindahl @ 1997-09-23 4:00 UTC (permalink / raw)
jwest@jwest.ecen.okstate.edu (Jim West) writes:
> I'm wondering if an optimizing compiler sould pick this up even without the
> explicit definition of nx_r. Can anyone explain why it wouldn't?
aliasing?
-- g
(no, I didn't look closely, but such a small kernel routine
in C is always at risk for aliasing problems...)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-23 4:00 ` Greg Lindahl
@ 1997-09-23 4:00 ` Volker Barthelmann
1997-09-26 4:00 ` H.W. Stockman
1 sibling, 0 replies; 16+ messages in thread
From: Volker Barthelmann @ 1997-09-23 4:00 UTC (permalink / raw)
Greg Lindahl <lindahl@pbm.com> wrote:
: jwest@jwest.ecen.okstate.edu (Jim West) writes:
: > I'm wondering if an optimizing compiler sould pick this up even without the
: > explicit definition of nx_r. Can anyone explain why it wouldn't?
: aliasing?
: -- g
: (no, I didn't look closely, but such a small kernel routine
: in C is always at risk for aliasing problems...)
Yes, a C compiler may not cache the values, because in
for (i=1;i<*nx-1;i++) {
indx = i+indj;
psi_new[indx] = (*a1)*psi[indx+1]+(*a2)*psi[indx-1]+
(*a3)*psi[i+indjp1]+(*a4)*psi[i+indjm1]-
(*a5)*f[indx];
}
the write to psi_new[indx] could modify all the other values.
When the restrict keyword will be supported in a future C standard
this could be avoided.
Volker
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-23 4:00 ` Greg Lindahl
1997-09-23 4:00 ` Volker Barthelmann
@ 1997-09-26 4:00 ` H.W. Stockman
1997-09-26 4:00 ` Greg Lindahl
1997-09-27 4:00 ` Toon Moene
1 sibling, 2 replies; 16+ messages in thread
From: H.W. Stockman @ 1997-09-26 4:00 UTC (permalink / raw)
Greg Lindahl wrote:
>
> jwest@jwest.ecen.okstate.edu (Jim West) writes:
>
> > I'm wondering if an optimizing compiler sould pick this up even without the
> > explicit definition of nx_r. Can anyone explain why it wouldn't?
>
> aliasing?
>
Likely. Some compilers will do a global aliasing check,
which is fairly time-consuming -- it helps to have
all the source in one file. Most (I've used) make
conservative aliasing assumptions, on a function-by-
function basis. Some compilers allow "no alias"
pragmas to be placed around critical functions, but this
practice is generally regarded as "cheating" for
benchmarks. Others have a switch for global assumption
of no aliasing -- a rather dangerous option.
FORTRAN aficionados like to tout lack of aliasing as
a great advantage. But I ask naively: what keeps a FORTRAN
function declared foo(xarray, yarray) from being called
foo(xarray, xarray)?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-26 4:00 ` H.W. Stockman
@ 1997-09-26 4:00 ` Greg Lindahl
1997-09-28 4:00 ` H.W. Stockman
1997-09-27 4:00 ` Toon Moene
1 sibling, 1 reply; 16+ messages in thread
From: Greg Lindahl @ 1997-09-26 4:00 UTC (permalink / raw)
"H.W. Stockman" <hwstock@swcp.com> writes:
> FORTRAN aficionados like to tout lack of aliasing as
> a great advantage. But I ask naively: what keeps a FORTRAN
> function declared foo(xarray, yarray) from being called
> foo(xarray, xarray)?
If you generate aliasing by calling a function incorrectly,
the program is no longer standard-conforming and the output
is undefined. In short, if you're dumb, you get a wrong answer,
but it's generated quickly ;-)
-- g
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-26 4:00 ` H.W. Stockman
1997-09-26 4:00 ` Greg Lindahl
@ 1997-09-27 4:00 ` Toon Moene
1 sibling, 0 replies; 16+ messages in thread
From: Toon Moene @ 1997-09-27 4:00 UTC (permalink / raw)
"H.W. Stockman" <hwstock@swcp.com> wrote:
> FORTRAN aficionados like to tout lack of aliasing as
> a great advantage. But I ask naively: what keeps a FORTRAN
> function declared foo(xarray, yarray) from being called
> foo(xarray, xarray)?
The Standard - you are not allowed to call it that way (migth start WW III
and all that ;-)
--
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
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-26 4:00 ` Greg Lindahl
@ 1997-09-28 4:00 ` H.W. Stockman
1997-09-28 4:00 ` Greg Lindahl
0 siblings, 1 reply; 16+ messages in thread
From: H.W. Stockman @ 1997-09-28 4:00 UTC (permalink / raw)
Greg Lindahl wrote:
>
> "H.W. Stockman" <hwstock@swcp.com> writes:
>
> > FORTRAN aficionados like to tout lack of aliasing as
> > a great advantage. But I ask naively: what keeps a FORTRAN
> > function declared foo(xarray, yarray) from being called
> > foo(xarray, xarray)?
>
> If you generate aliasing by calling a function incorrectly,
> the program is no longer standard-conforming and the output
> is undefined. In short, if you're dumb, you get a wrong answer,
> but it's generated quickly ;-)
But a function called foo(xarray, xarray) might
actually do what the caller wanted?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: MFlops Comparison using g77 (bad news) - bench.tgz (0/1)
1997-09-28 4:00 ` H.W. Stockman
@ 1997-09-28 4:00 ` Greg Lindahl
0 siblings, 0 replies; 16+ messages in thread
From: Greg Lindahl @ 1997-09-28 4:00 UTC (permalink / raw)
"H.W. Stockman" <hwstock@swcp.com> writes:
> > If you generate aliasing by calling a function incorrectly,
> > the program is no longer standard-conforming and the output
> > is undefined. In short, if you're dumb, you get a wrong answer,
> > but it's generated quickly ;-)
>
> But a function called foo(xarray, xarray) might
> actually do what the caller wanted?
If it doesn't involve aliasing, then it's fine. If the user
wants to have aliasing problems, they'll haev to use a different
language.
-- g
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~1997-09-28 4:00 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <5vqs28$3el@news-rocq.inria.fr>
1997-09-22 4:00 ` MFlops Comparison using g77 (bad news) - bench.tgz (0/1) Luke Lonergan
1997-09-22 4:00 ` Jim West
1997-09-23 4:00 ` Greg Lindahl
1997-09-23 4:00 ` Volker Barthelmann
1997-09-26 4:00 ` H.W. Stockman
1997-09-26 4:00 ` Greg Lindahl
1997-09-28 4:00 ` H.W. Stockman
1997-09-28 4:00 ` Greg Lindahl
1997-09-27 4:00 ` Toon Moene
1997-09-23 4:00 ` Luke Lonergan
1997-09-22 4:00 ` Greg Lindahl
1997-09-22 4:00 ` Greg Lindahl
1997-09-16 4:00 MFlops Comparison using g77 (bad news) Luke Lonergan
1997-09-16 4:00 ` Toon Moene
1997-09-16 4:00 ` MFlops Comparison using g77 (bad news) - bench.tgz (0/1) Luke Lonergan
1997-09-18 4:00 ` Thomas Leitner
1997-09-18 4:00 ` Andrew G. Morgan
1997-09-18 4:00 ` H.W. Stockman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox