* Compiler and performance
@ 1998-08-31 4:00 Christian Hasse
1998-09-05 4:00 ` rsimpson
0 siblings, 1 reply; 4+ messages in thread
From: Christian Hasse @ 1998-08-31 4:00 UTC (permalink / raw)
There has been a lot of discussion regarding
the quality of the gnu compilers in
comparison to DU compilers. We have a little
code to evaluate floating point performance for
different loop lengths. The loop looks like
do l =1, length
f(l) = c(1)*(a(l) + c(2)*(a(l) + c(3)*(a(l) + c(4)*
& (a(l) + c(5)*(a(l) + c(6))))))
enddo
c is just a array of constants and f and a are variables
We measure the time by calls to system functions
and look at MFLOPS over loop length. We used different
compilers, system is LX board/2MB cache and 533MHZ processor.
We were fairly dissapointed with the g77. We used egcs-1.0.3
with haifa enabled as well as egcs-1.0.2. Just to give you
some numbers
MFLOPS
length g77/egcs-1.0.3 DU PA-RISC/8000
100 107.8 373.3
~300
10825 78.7 172.3 ~300
104912 62.4 98.8
We tried several compile options without success.
Even a PII 300 was faster for almost all loop
lengths. The PA-RISC has about the same Specfp as
the Alpha.
We know that this is a rather crude test and that
a good compiler can optimize that very well. But
we are also not satisfied with the performance of the
Alpha for our "real life" codes. Coding that loop in
C yields exactly the same results. This is rather
discouraging especially knowing that Digital released
their compilers for Alpha/NT which gives much better results,
according to www.specbench.org.
I hope that Digital will release their compilers it for Linux.
Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compiler and performance
1998-08-31 4:00 Compiler and performance Christian Hasse
@ 1998-09-05 4:00 ` rsimpson
1998-09-05 4:00 ` Toon Moene
1998-09-06 4:00 ` Christian Hasse
0 siblings, 2 replies; 4+ messages in thread
From: rsimpson @ 1998-09-05 4:00 UTC (permalink / raw)
1) Get the ffmath library -
http://people.frankfurt.netsurf.de/Joachim.Wesner/. This made a BIG
difference to our Fortran codes.
2) I understand that haifa does not work under Alpha with egcs 1.0.3. I
deduce this from the fact that one of the changes under egcs 1.1a is listed
as "haifa now works under Alpha".
3) Switching to 1.1a did not improve the speed of my code until I enabled
the -fno-emulate-complex option whereupon I got a big improvement. My
results files were identicle with and without this option.
I don't deny that the DU compiler may well be even better, but I have not
managed to try it yet.
--
----------------------------------------------------------------------------
Richard Simpson
Farnborough, Hants, Uk Fax: 01252 392976
rsimpson@ewrcsdra.demon.co.uk
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compiler and performance
1998-09-05 4:00 ` rsimpson
@ 1998-09-05 4:00 ` Toon Moene
1998-09-06 4:00 ` Christian Hasse
1 sibling, 0 replies; 4+ messages in thread
From: Toon Moene @ 1998-09-05 4:00 UTC (permalink / raw)
rsimpson@ewrcsdra.Cut_This_Out.demon.co.uk wrote:
> 1) Get the ffmath library -
> http://people.frankfurt.netsurf.de/Joachim.Wesner/. This made a BIG
> difference to our Fortran codes.
Indeed ! Thanks to Joachim for this effort !
> 2) I understand that haifa does not work under Alpha with egcs 1.0.3. I
> deduce this from the fact that one of the changes under egcs 1.1a is listed
> as "haifa now works under Alpha".
Well, in the egcs 1.0.x series, the HAIFA instruction scheduler was included
as an untested option. Unfortunately, (AFAIUnderstand), Red Hat build their
egcs 1.0.2-8 with HAIFA enabled, which introduced subtle bugs in the compiler
- yeah, you just can't win. Goes to show that "works for us" isn't a
guarantee with compilers ...
> 3) Switching to 1.1a did not improve the speed of my code until I enabled
> the -fno-emulate-complex option whereupon I got a big improvement. My
> results files were identicle with and without this option.
I start to get an idea when -fno-emulate-complex works and when it doesn't.
<WILD_SPECULATION>
One of the main problems with the internal representation of Single Precision
Complex Data in the "middle" end of the compiler - i.e. the routines between
the various front-ends and backends is that an item that's 64-bits wide is
kept as a single item. On targets that are basically 64-bit architectures
(like the Alpha, some Sparc and some MIPS targets), this interferes with the
way two 32-bit parts are handled vis-a-vis the 64-bit registers. One way to
see this is to try to compile the LAPACK distribution from ftp.netlib.org
with -fno-emulate-complex on an Alpha - it dies in one of the first single
precision complex routines with an abort in gen_low_part; i.e. it tries to
insert or extract a (32-bit) part of a 64-bit register that doesn't support
32-bit parts (like the floating point registers on an Alpha).
</WILD_SPECULATION>
So, it *might* be that for DOUBLE COMPLEX there's actually no problem.
There's hope that this will be solved in the not to distant future, because
glibc (as a consequence of having to move to the C9X Standard) is going to
use the internal complex representation more often.
HTH,
--
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.org; egcs: mailto:egcs-bugs@cygnus.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compiler and performance
1998-09-05 4:00 ` rsimpson
1998-09-05 4:00 ` Toon Moene
@ 1998-09-06 4:00 ` Christian Hasse
1 sibling, 0 replies; 4+ messages in thread
From: Christian Hasse @ 1998-09-06 4:00 UTC (permalink / raw)
rsimpson@ewrcsdra.Cut_This_Out.demon.co.uk wrote:
> 1) Get the ffmath library -
> http://people.frankfurt.netsurf.de/Joachim.Wesner/. This made a BIG
> difference to our Fortran codes.
The piece of code I gave in my first posting didn't result in any
math lib calls. We tried the libffm with our other fortran codes
which improved performance by a few percent. Our other codes
written in C/C++ will do a lot of these calls but haven't been ported
yet.
I used to the DU Fortran to compile our big codes and the result
is amazing. They are faster on our LX/2Mb cache with 533 MHz
processor than on an HP J282 which has a 19 Specfp number.
Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-09-06 4:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-08-31 4:00 Compiler and performance Christian Hasse
1998-09-05 4:00 ` rsimpson
1998-09-05 4:00 ` Toon Moene
1998-09-06 4:00 ` Christian Hasse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox