Subject: Re: CCL:Linux on Alpha, math library

From: Jochen Kuepper <[email-masked]>
Date: Fri, 8 Oct 2134 15:00:38 +0200

On Sat, 29 Aug 1998 Victoria Buch wrote:

>> Igor J. Barani writes:

>>  > I have just recently installed Linux on a DEC Alpha and when I compile
>>  > several programs in fortran on it, they seem to compile to twice the
>>  > size and require 9 times as long to run than on DEC UNIX.  Do you have
>>  > any idea why this may be so and how I may be able to speed up the
>>  > processes?  Any suggestions would be greatly appreciated.  Thank you.

>We have just been there. You have the latest Red Hat Linux, dont you?
>So: the latest math library libm version 2.0.7 from gnu is messed up.
>Our system menager installed old version 2.0.1 - works faster by a factor 2. 
>More generally our sexperience suggests that
>Alpha / Linux for FP operations is good only
>for simple operations + - * / . My simulation
>programs are still 40% below
>the performance of Alpha-DEC, and only 10% faster than Petium II (400MHz)
>which is more than 2 times cheaper. Disappointing.
>Good luck. Victoria

The slowdown of the math-library is due to bug-fixes. The old glibc based
math-libs do have problems with wrong results for sqrt ( and others ) !

So you have to decide wether you use correct code or ( little ) faster code
that might produce wrong answers.

I would suggest to use the newest possible libm, if you are really for speed
you might consider recompiling it with optimization turned high (v.i.).

More important, there are replacement libraries for the more important math
routines, that are hand-optimized assembler. IIRC, one of them is based on code
Cray developed for their Alpha based machines. You can use both of them, since
each one only provides a subset of functions in the next slower one
(libm <- libfm <- libffm ) !
Look at http://people.frankfurt.netsurf.de/Joachim.Wesner/

Another important fact is the compiler to use. egcs-1.1pre is really stable for
me, you might consider using it since there are very usefull new optimization
passes. Also check your code and the compiler flags you are using, consider
-fno-exceptions, -fno-rtti, ... and all the other -m, -f, -O options and take
all these that will speed up your programs !

Hope it helps and you all get more power out of your Alpha-toys.
If you need some more info, feel free to ask
( Victoria, aren't you in D"usseldorf right now ? )

Greetings,
Jochen
-----------------------------------------------------------------------
  Jochen K"upper

  Heinrich-Heine-Universit"at D"usseldorf   [email-masked]
  Institut f"ur Physikalische Chemie I
  Universit"atsstr. 1, Geb 26.43 Raum 02.29    phone ++49-211-8113681
  40225 D"usseldorf                            fax   ++49-211-8115195
  Germany             http://www-public.rz.uni-duesseldorf.de/~jochen
-----------------------------------------------------------------------

---

From: "Marc N." <[email-masked]>
Date: Wed, 2 Sep 1998 15:47:04 -0400 (EDT)

Hi,

Several people asked me about the "optimized libraries" from
my previous posting -
> However, with the right, i.e., optimized libraries, we've found, e.g.,
> Gaussian 94 on a 500MHz Alpha/Linux box to be 2.5 times as fast as on a
> 400MHz Pentium II Linux system. 

Many of the matrix operations of G94, which consume a large part of 
the CPU cycles for many (most?) G94 jobs, are handled by library functions
of the BLAS3 type (Basic Linear Algebra Subprograms, level 3).  In fact,
it is one single BLAS3 routine that is centrally used by G94, DGEMM
(Double-precision GEneral Matrix-Matrix).  On Digital Unix (DU), this
routine is part of DEC's proprietary DXML (Digital Extended Math
Library).

Kazushige Goto has hand-coded a DGEMM routine for 21164 CPUs in assembler,
and placed it under GNU Library Public License.  It is available at
ftp://ftp.eni.co.jp/.2/Linux-Alpha-JP/ftp.statabo.rim.or.jp/BLAS/
It has been clocked at 780 MFlops on a 600 MHz 21164 Alpha machine.
This version of DGEMM can be used to replace the one in DXML.  On 
Alpha/Linux, DXML doesn't run, so DXML has to be replaced there anyway.

A ready-made library, which can be used as a direct replacement for DXML
in G94 (edit alpha-osf1.make and recompile), has been placed by Bob
Williams in ftp://rw.usuf2.usuhs.mil/pub/libdgemm/
The fastest version there is libdgemm-980415-2-coff-gnu.a (37 Kb).

However, please note that in order to make a Alpha/Linux version of
G94, you still need a DU system for compilation, and quite a few other
requirements have to be fulfilled.  More on this can be found in
"Computational Chemistry on Commodity-Type Computers", Marc C. Nicklaus,
Robert W. Williams, Bruno Bienfait, Eric S. Billings, and Milan Hodoscek,
JCICS (in press), which also just came on-line on ACS's Web site at
http://pubs.acs.org/subscribe/journals/jcisd8/browse_asap.html.

Hope this helps,

Marc

------------------------------------------------------------------------
 Marc C. Nicklaus                        National Institutes of Health
 E-mail: [email-masked]               Bldg 37, Rm 5B29
 Phone:  (301) 402-3111                  37 Convent Dr, MSC 4255       
 Fax:    (301) 496-5839                  BETHESDA, MD 20892-4255    USA 
      http://rex.nci.nih.gov/RESEARCH/basic/medchem/mcnbio.htm
    Laboratory of Medicinal Chemistry, National Cancer Institute
------------------------------------------------------------------------