Problems building R 2.2.1 with libgoto and SSE2 enabled

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems building R 2.2.1 with libgoto and SSE2 enabled

Ivan Adzhubey
Hi,

I am trying to build R 2.2.1 with Kazushige Goto's BLAS library (libgoto) and
encountered a problem: I have two computers with the almost identical
hardware (P4 Northwood CPU, i875 chipset, 2GB DDR400 RAM) and identical Linux
OS. I have the latest version of libgoto for this CPU installed on both boxes
(libgoto_northwood32p-r1.00.so) and I am using gcc compiler flags "-O2
-march=pentium4 -mfpmath=sse -msse2" to enable use of SSE2 extensions. With
one computer that works perfectly, while on the other one "make check"
constantly fails on lm-test. If I remove "-mfpmath=sse -msse2" part from the
gcc flags then all checks pass on the second computer too. Any hints on what
may cause the error? Anyone willing to share his/her experience on building
and using R with SSE2 and on libgoto performance in particular? I was
planning to give ATLAS a try but pre-built binaries are not available for my
distro and on my AMD Opteron cluster it took almost 48 hours to build. I am
not sure my home computer (the one that gives me errors with libgoto/SSE2)
would survive this.

TIA,
Ivan

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Problems building R 2.2.1 with libgoto and SSE2 enabled

Prof Brian Ripley
[This sort of highly technical non-R issue would be better discussed on
the R-devel list.  See the R posting guide.]

Do note the comments in the R-admin manual.  R requires proper results
with IEEE754 specials (Infs and NaNs) and switching on fast arithmetic
options often calls failures because of this.  It is not clear from your
description what compiler you are using (presumably some version of gcc),
and how it handles this.  Since gcc's AMD64 code makes use of such
extensions it may be safe, but we don't know about your compiler/CPU
combination.   Generally the advice is that it takes more time to
investigate wrong results from over-optimization (as now, and it is not
just your time in this case) than to make use of safer options.

However, without knowing what the failure is (look in the
tests/foo.Rout.fail file) we can only speculate.

Building ATLAS should take only a couple of hours at most for platforms
where there are good defaults, and that includes P4 on Linux.  I had a lot
of problems on Opteron, basically because my machine was too fast for the
timing loops (and you also need to ensure that PIC code is used).


On Thu, 23 Feb 2006, Ivan Adzhubey wrote:

> Hi,
>
> I am trying to build R 2.2.1 with Kazushige Goto's BLAS library (libgoto) and
> encountered a problem: I have two computers with the almost identical
> hardware (P4 Northwood CPU, i875 chipset, 2GB DDR400 RAM) and identical Linux
> OS. I have the latest version of libgoto for this CPU installed on both boxes
> (libgoto_northwood32p-r1.00.so) and I am using gcc compiler flags "-O2
> -march=pentium4 -mfpmath=sse -msse2" to enable use of SSE2 extensions. With
> one computer that works perfectly, while on the other one "make check"
> constantly fails on lm-test. If I remove "-mfpmath=sse -msse2" part from the
> gcc flags then all checks pass on the second computer too. Any hints on what
> may cause the error? Anyone willing to share his/her experience on building
> and using R with SSE2 and on libgoto performance in particular? I was
> planning to give ATLAS a try but pre-built binaries are not available for my
> distro and on my AMD Opteron cluster it took almost 48 hours to build. I am
> not sure my home computer (the one that gives me errors with libgoto/SSE2)
> would survive this.
>
> TIA,
> Ivan
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Problems building R 2.2.1 with libgoto and SSE2 enabled

Peter Dalgaard
In reply to this post by Ivan Adzhubey
Ivan Adzhubey <[hidden email]> writes:

> Hi,
>
> I am trying to build R 2.2.1 with Kazushige Goto's BLAS library (libgoto) and
> encountered a problem: I have two computers with the almost identical
> hardware (P4 Northwood CPU, i875 chipset, 2GB DDR400 RAM) and identical Linux
> OS. I have the latest version of libgoto for this CPU installed on both boxes
> (libgoto_northwood32p-r1.00.so) and I am using gcc compiler flags "-O2
> -march=pentium4 -mfpmath=sse -msse2" to enable use of SSE2 extensions. With
> one computer that works perfectly, while on the other one "make check"
> constantly fails on lm-test. If I remove "-mfpmath=sse -msse2" part from the
> gcc flags then all checks pass on the second computer too. Any hints on what
> may cause the error?

Some hints, nothing conclusive:

Different gcc versions? glibc? (perhaps only one machine was updated).

Does libgoto factor into this at all? Will things still (not) work if
you omit it? If so, are you sure that both machines are picking it up
correctly?

Which test is failing?

> Anyone willing to share his/her experience on building
> and using R with SSE2 and on libgoto performance in particular? I was
> planning to give ATLAS a try but pre-built binaries are not available for my
> distro and on my AMD Opteron cluster it took almost 48 hours to build. I am
> not sure my home computer (the one that gives me errors with libgoto/SSE2)
> would survive this.

Build times for ATLAS are highly dependent on platform. On P4, it is
usually quite fast (since most choices are known in advance). 11
*minutes* on the one I'm using to type this.

(Why are you keeping your Linux distro a secret, BTW?)

--
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html