Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: "Adam C. Powell, IV" <adam.powell@nist.gov>
To: chrisi@theo1.physik.uni-stuttgart.de
Subject: Re: Optimized BLAS (No. 2)
Date: 1998/11/12	[thread overview]
Message-ID: <364B3F7C.B8EC01BC@nist.gov> (raw)
In-Reply-To: 36433B28.1A85B9D7@theo1.physik.uni-stuttgart.de

[-- Attachment #1: Type: text/plain, Size: 3610 bytes --]

"C.Simmendinger" wrote:

> Hi there ;-)
>
> Time for an update.
>
> I added a few optimized routines to the alpha-blas,
> (complex ones) bugfixed a few others and
> made sure LAPACK runs atop of it.
>
> On large matrices egcs/BLAS now beats DEC's f90/DXML.

AWESOME!  Thank you vey much for putting these together in a single
place.  The BLAS I had were old, and not written to use gemm (or gemv),
so this is a HUGE help!

> The whole thing is based on the gemm_based blas from
> netlib, Goto's gemm and a couple of routines
> from Dayde.
> The BLAS is available under
> http://129.69.45.26/~chrisi/blastree.tar.gz
> Just unpack, use the makelib shellscript and pray ;-)
>
> Uhm, if g77 doesn't happen to be at /usr/local/bin/g77
> you'll need to set a link.

A couple of questions:

  1. Why the separate dcmplx directories?  To test the effect of
     -fno-emulate-complex on non-complex sources, I tried compiling
     dtrmm.f with and without it, and diff showed the objects were
     identical.  (Or does this slow down the single-precision complex
     routines?)
  2. Why not use a makefile (instead of makelib script)?  Advantages: no
     need to specify where g77 is; it dies if a file fails to compile,
     whereas the makelib script keeps going and gives an incomplete
     library; if you change one file you don't end up re-compiling
     everything; you get to watch it compile each file and feel like
     it's doing something. :-)  I've attached a makefile for the main
     directory that seems to work.  Small and simple.
  3. How about generating a shared library?  The attached makefile does
     this.  It doesn't seem to save a whole lot of space in progarm
     binaries, but when a new BLAS library is available, you don't have
     to re-compile other programs that depend on it.
  4. Generating this shared library turned up a problem in the source
     code (for some reason, g77 -shared is stricter than ar).  csgpm,
     dsgpm, ssgpm and zsgpm all start with PROGRAM, not SUBROUTINE, and
     all have in their file the LOGICAL FUNCTION LNCMP- all identical.
     Changing the first line in each and removing all LNCMPs but the one
     in csgpm.f solved this problem.
  5. Could we get an additional speed increase by replacing dgemv with a
     call to Goto's gemm with n=1?  (Also ldb=incx, ldc=incy.)  This
     could be done just by writing a "gemv.c" in the dgemm directory
     (which should probably be called "gemm" since it has both dgemm and
     sgemm) similar to "gemm.c", which calls gemm_nn or gemm_tn
     depending on TRANS.  It is sort of an abstraction violation, as
     level 3 BLAS are supposed to depend on level 2 and not vice versa,
     but I don't think this is a real problem- as long as it works and
     goes fast.
  6. Have you played with the block size settings?  I got a 10% speed
     increase in LAPACK dgetrf (LU decomposition) by editing ilaenv.f to
     change the block size from 64 to 32.  Possible reasons: Goto's gemm
     loads something like 122x32 and 122x122 blocks of the matrices into
     L2 cache, changing these both to 64x64 might help a tiny bit; but
     more likely it's because dgetf2 (unblocked, no gemm) is called with
     larger submatrices...  It's all so complicated. :-)  Just wondering
     if you've tried.

Okay, so I've done everything except gemv.c.  I'll work on this later.

Thank you again!

-Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____
USDoC, National Institute of Standards & Technology (NIST)  |\ ||<  |
Center for Theoretical and Computational Materials Science  | \||_> |





[-- Attachment #2: Makefile --]
[-- Type: text/plain, Size: 611 bytes --]

# Adam Powell's makefile for Christian Simmendinger's Alpha 21164A BLAS package
# including Kazushige Goto's amazing dgemm routine

FFLAGS = -O3 -fomit-frame-pointer -funroll-loops -fno-schedule-insns \
	-fschedule-insns2 -fno-emulate-complex
SRCS := $(wildcard *.f)
OBJS = $(SRCS:.f=.o)

all: $(OBJS)
	make -C BLAS_RISC lib && make -C dgemm || exit
	ln -sf BLAS_RISC/*.o dgemm/*.o .
	rm -f libblas.a
	ar qv libblas.a *.o
	rm -f libblas.so
	g77 -shared -Wl,-soname -Wl,libblas.so -o libblas.so *.o
	chmod +x libblas.so

clean:
	make -C BLAS_RISC clean && make -C dgemm clean || exit
	rm -f *.a *.so *.o *~ core

  reply	other threads:[~1998-11-12  5:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-06  5:00 Optimized BLAS (No. 2) C.Simmendinger
1998-11-12  5:00 ` Adam C. Powell, IV [this message]
1998-11-12  5:00   ` Murx
1998-11-12  5:00   ` Murx
1998-11-12  5:00     ` Adam C. Powell, IV
1998-11-12  5:00       ` Murx
1998-11-12  5:00         ` Adam C. Powell, IV
1998-11-13  5:00           ` Johannes G.D. Hausmann
1998-11-14  5:00             ` Toon Moene
1998-11-16  5:00               ` Adam C. Powell, IV
1998-11-13  5:00           ` Other things Murx
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