Thursday, October 9, 2008

GotoBLAS on Intel Core Duo + SS12

GotoBLAS is renowned as the fastest BLAS library. It has been used by many supercomputing sites to run HPL, the infamous benchmark that determines their position in the Top500.

I've had a chance to test the combo of Goto+HPL using Sun's compilers (Sun Studio 12 aka. SS12) on OpenSUSE 11.0 x86 (i.e. 32-bit version). The machine is a laptop: IBM Thinkpad R60 with Intel Core Duo T2400 1.83GHz. [In the past, I've had relied on ACML when building HPL for AMD platforms.]

Here're the steps to build GotoBLAS on the abovementioned environment, assuming that the source archive has been extracted and you're in the source-code directory:

  1. Open detect in a text editor, then change FCOMPILER=NULL to FCOMPILER=SUN
  2. If your SS12 is installed in a non-standard directory (e.g. /tmp/sunstudio12), then open Makefile.rule in a text editor. Then, apply the following two changes:
    • ifeq ($(F_COMPILER), SUN)
      COMPILER_F77 = f90

      into
      ifeq ($(F_COMPILER), SUN)
      COMPILER_F77 = /tmp/sunstudio12/bin/f90

    • ifneq ($(OSNAME), SunOS)
      SUNPATH = /opt/sunstudio12

      into
      ifneq ($(OSNAME), SunOS)
      SUNPATH = /tmp/sunstudio12

And that's it! Should you wonder that I forgot about the C compiler: no, I don't. Leave it to use gcc.

Note that on this particular environment, -fast must not be used as it results in a floating-point exception on one of GotoBLAS's self-tests. YMMV (your mileage may vary) though.

Note2 that -xtarget=native is safe (again, it has to be qualified as “only on this particular CPU architecture”).

In addition to the built-in self-tests, another test was to build HPL with libgoto.a (and CT8), and then run the xhpl. And, not surprisingly, everything went smoothly; no further hiccups or whatsoever.

3 comments:

Yann said...

I'm trying, without success to compile Lapack with the gotoblas lib. I'm, as you, using sunstudio 12 update 1 compiler. I've got some SIGFPE error on the first example program... What options did you used to compile lapack ? thanks.

Cincai Patron said...

Yann,

I've never tried to build Lapack with SS before.

If you haven't, I'd suggest to remove any compiler optimization flags and try to rebuild again.

Cincai Patron said...

As noted in my blog, -fast will cause gotoblas to spit sigfpe.

The only compiler flag I set was -xtarget=native (add -m64 if you're working on a x64 platform).

I'm not sure if -xO2 or -xO3 is safe..