Gentoo Archives: gentoo-science

From: "Xavier Fernández i Marín" <xfim.ll@×××××.com>
To: gentoo-science@l.g.o
Subject: Re: [gentoo-science] Atlas giving wrong results on matrix multiplication
Date: Tue, 20 Sep 2011 05:19:40
Message-Id: 20110920051707.GC2337@deu.xfim
In Reply to: Re: [gentoo-science] Atlas giving wrong results on matrix multiplication by Andrea Arteaga
1 Andrea Arteaga vas escriure el dia dl, 19 set 2011:
2
3 > Dear Xavier,
4 >
5 > thank you for your email and sorry for the late reply.
6 > In theory it should be useless to provide optimization flags when
7 > compiling ATLAS, because it automatically uses and tests many flags,
8 > but I could be wrong.
9
10 Yes, Atlas tries to find the best options. However, I was worried because
11 I had -Ofast in CFLAGS, and thought that maybe some GCC optimizations were
12 harming the binary.
13
14 >
15 > How did you install ATLAS? From the science overlay? I suggest that
16 > you update it. Now in the overlay we have sci-libs/atlas-3.9.49
17 > (~keyworded) [BTW, I will probably bump the version to 3.9.51 today].
18 > Could you install it and redo the test? Otherwise, could you shortly
19 > explain how to reproduce the problem, so that I can try?
20
21 No, I simply use the atlas provided in the official gentoo branch.
22
23 François sent an email pointing that there was a problem with 3.9-xx, and
24 suggesting going bach to 3.8. This is what I did and it is working fine,
25 without errors. So I assume that, effectively, it was something related
26 to the 3.9 branch, rather than compiling options.
27
28 A simplification of the code that was giving trouble is:
29
30 -----8<---------------
31 B <- c(0, 4.9039)
32 for (l in 10:100) {
33 X <- cbind(1, matrix(rnorm(l, 0, 3), ncol=1))
34 X <- ics
35 for (i in 1:1000) {
36 M <- X %*% B
37 w <- which(is.nan(M))
38 l <- length(w)
39 if (l!=0) {
40 print(paste("Length", l, "error(s) on", X[w,2], sep=" "))
41 }
42 }
43 }
44 -----8<---------------
45
46 Thank you,
47 --
48 - Xavier -