From: harley@pauillac.inria.fr (Robert Harley)
Subject: Re: Final results of portable benchmark for single, SMP and MPP computers
Date: 1997/04/15 [thread overview]
Message-ID: <5j046v$hsq@news-rocq.inria.fr> (raw)
Jeffrey Potoff <jpotoff@latoso.cheme.cornell.edu> writes:
>Rob,
> Is there any chance that you could share some of your speed secrets ?
Secrets? Ahem, well there aren't any really.
I suppose it just requires believing that any piece of code can be
sped up and futzing around with it until you can't possibly squeeze
any more out of it, then step back for a coffee break and think of
another couple of tricks!
Of course the first thing to do is to look for algorithmic improvements.
After that you've get to give your compiler enough information to
optimise the program well. A good compiler can do plenty of great
stuff as long as it knows it's allowed to ;)
So stick "static" in front of functions that don't need to be
exported, put "const" qualifiers wherever they are valid, replace
small arrays with a few variables if you can etc. Also have some idea
of the workings of the chip you're targetting. On Alpha rewrite
locally to try to keep two threads going and to avoid dependencies
between successive expressions. For instance to double a f.p. number
choose between x *= 2.0 and x += x depending on whether the multiplier
or the adder is likely to be free. Replace ints by longs, reduce branches...
Declare functions with stuff like this:
static int Collide
( float *const*const*const*ff, [...]
);
Change this:
for(rho[0]=0.0,i=0; i<NVELOC; i++) rho[0] += f[i];
into this:
rho0 = f0+f1+(f2+f3)+(f4+f5+(f6+f7))+f8;
and so on. Avoid getting bogged down fiddling with stuff the compiler
definitely ought to do and worry instead about optimisations that are
likely to be just out of its reach. Of course, concentrate on the
parts that take a significant chunk of the run-time and compile with
max optimisation. Recently I've been using "gcc -O4 -funroll-loops"
and "cc -O5 -tune ev5 -migrate -std1".
Common sense, really.
Pick up 5% here and 10% there until it starts adding up. I think the
QCD code started at 51 Mflops at 333MHz, it's now doing 131 Mflops at
266 MHz (and 224 at 500). The fluid flow test case went from 41mins
to 17.5.
-- Rob.
next reply other threads:[~1997-04-15 4:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-04-15 4:00 Robert Harley [this message]
-- strict thread matches above, loose matches on Subject: below --
1997-04-12 4:00 Final results of portable benchmark for single, SMP and MPP computers Robert Harley
1997-04-12 4:00 ` Jeffrey Potoff
1997-04-13 4:00 ` henley
1997-04-13 4:00 ` Achim Gratz
1997-04-14 4:00 ` Jeffrey Potoff
1997-04-15 4:00 ` Achim Gratz
1997-04-12 4:00 Robert Harley
1997-04-11 4:00 Robert Harley
1997-04-12 4:00 ` henley
1997-04-12 4:00 ` Achim Gratz
1997-03-28 5:00 henley
1997-03-28 5:00 ` henley
1997-03-31 5:00 ` Ling Wang
1997-03-31 5:00 ` henley
1997-04-10 4:00 ` Achim Gratz
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox