My IT people have set up R on a a Kubuntu box with an RWkard front end.? I have OpenBLAS set up as a shared BLAS but I'm not sure how to get R to see it.? A.3.1 of the installation docs talks about it but I'm not clear if I need a option on my startup line or if I need to find a config file.? The BLAS is is in: ? /usr/lib/openblas-base ? on my machine. I'm not sure how to confirm that R is seeing the BLAS. ? Recommendations?
Accessto OpenBLAS
8 messages · Michael Rutter, Scott Raynaud, Dirk Eddelbuettel
On 02/14/2012 04:56 PM, Scott Raynaud wrote:
My IT people have set up R on a a Kubuntu box with an RWkard front end. I have OpenBLAS set up as a shared BLAS but I'm not sure how to get R to see it. A.3.1 of the installation docs talks about it but I'm not clear if I need a option on my startup line or if I need to find a config file. The BLAS is is in: /usr/lib/openblas-base on my machine. I'm not sure how to confirm that R is seeing the BLAS. Recommendations?
Scott,
There used to be a good post about this on a blog, but the blog has gone
under. Luckily, I was able to salvage the post from Google cache. Here
is the relevant part:
Copy the resulting .so shared object library file
(libgoto2_penrynp-r1.12.so on my machine) to /usr/lib
The original BLAS library located there is called libblas.so.3gf.0.
Back this file up: cp libblas.so.3gf.0 libblas.so.3gf.0.keep
Make a symbolic link to the new BLAS library:
ln -s libgoto2_penrynp-r1.12.so libblas.so.3gf.0
Basically, you need to make sure that the file "libblas.so.3gf.0" links
to the location of your lib. I would find a benchmark file
(http://r.research.att.com/benchmarks/) to test R before and after
creating the link, just to make sure it is working.
Hope this helps,
Michael
_______________________________________________
R-SIG-Debian mailing list R-SIG-Debian at r-project.org
Dr. Michael A. Rutter School of Science Penn State Erie, The Behrend College Station Road Erie, PA 16563 http://math.bd.psu.edu/faculty/rutter
On 14 February 2012 at 18:15, Michael Rutter wrote:
| |
| On 02/14/2012 04:56 PM, Scott Raynaud wrote:
| > My IT people have set up R on a a Kubuntu box with an RWkard | > front end. I have OpenBLAS set up as a shared BLAS but I'm not | > sure how to get R to see it. A.3.1 of the installation docs talks | > about it but I'm not clear if I need a option on my startup line or | > if I need to find a config file. The BLAS is is in: | > | > /usr/lib/openblas-base | > | > on my machine. I'm not sure how to confirm that R is seeing | > the BLAS. | > | > Recommendations? | > | | Scott, | | There used to be a good post about this on a blog, but the blog has gone | under. Luckily, I was able to salvage the post from Google cache. Here | is the relevant part: | | Copy the resulting .so shared object library file | (libgoto2_penrynp-r1.12.so on my machine) to /usr/lib | The original BLAS library located there is called libblas.so.3gf.0. | Back this file up: cp libblas.so.3gf.0 libblas.so.3gf.0.keep | Make a symbolic link to the new BLAS library: | ln -s libgoto2_penrynp-r1.12.so libblas.so.3gf.0 | | Basically, you need to make sure that the file "libblas.so.3gf.0" links | to the location of your lib. I would find a benchmark file | (http://r.research.att.com/benchmarks/) to test R before and after | creating the link, just to make sure it is working. Is that really needed? a) We never had Goto in the distro for its licensing issues. But there always was the goto2helper package from Japan which I and other have used with great success. With it, goto BLAS became a drop-in just like Atlas or MKL. b) I haven't had time play with Openblas but I recall Doug Bates telling me it worked for him (possibly after one or two manual steps I cannot recall). c) I hope to get to OpenBlas myself 'soon' and may follow-up then. Lastly, and as always, faster BLAS are nice, but BLAS are rarely your bottleneck with R. Hope this helps, Dirk | | Hope this helps, | Michael | | | _______________________________________________ | > R-SIG-Debian mailing list | > R-SIG-Debian at r-project.org | > https://stat.ethz.ch/mailman/listinfo/r-sig-debian | | -- | Dr. Michael A. Rutter | School of Science | Penn State Erie, The Behrend College | Station Road | Erie, PA 16563 | http://math.bd.psu.edu/faculty/rutter | | _______________________________________________ | R-SIG-Debian mailing list | R-SIG-Debian at r-project.org | https://stat.ethz.ch/mailman/listinfo/r-sig-debian
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too dark to read." -- Groucho Marx
On 02/14/2012 06:40 PM, Dirk Eddelbuettel wrote:
On 14 February 2012 at 18:15, Michael Rutter wrote: | | | On 02/14/2012 04:56 PM, Scott Raynaud wrote: |> My IT people have set up R on a a Kubuntu box with an RWkard |> front end. I have OpenBLAS set up as a shared BLAS but I'm not |> sure how to get R to see it. A.3.1 of the installation docs talks |> about it but I'm not clear if I need a option on my startup line or |> if I need to find a config file. The BLAS is is in: |> |> /usr/lib/openblas-base |> |> on my machine. I'm not sure how to confirm that R is seeing |> the BLAS. |> |> Recommendations? |> | | Scott, | | There used to be a good post about this on a blog, but the blog has gone | under. Luckily, I was able to salvage the post from Google cache. Here | is the relevant part: | | Copy the resulting .so shared object library file | (libgoto2_penrynp-r1.12.so on my machine) to /usr/lib | The original BLAS library located there is called libblas.so.3gf.0. | Back this file up: cp libblas.so.3gf.0 libblas.so.3gf.0.keep | Make a symbolic link to the new BLAS library: | ln -s libgoto2_penrynp-r1.12.so libblas.so.3gf.0 | | Basically, you need to make sure that the file "libblas.so.3gf.0" links | to the location of your lib. I would find a benchmark file | (http://r.research.att.com/benchmarks/) to test R before and after | creating the link, just to make sure it is working. Is that really needed? a) We never had Goto in the distro for its licensing issues. But there always was the goto2helper package from Japan which I and other have used with great success. With it, goto BLAS became a drop-in just like Atlas or MKL.
That package is hard to find without Dirk's gcdb vignette. Here is the link: http://prs.ism.ac.jp/~nakama/debian/lenny-ism/ That would work to install GotoBLAS. Reworking the helper package for OpenBLAS would make a nice little project. There is an OpenBLAS package for Ubuntu 11.10, but the binary version only uses two cores, at least that what it used the last time I tried it.
b) I haven't had time play with Openblas but I recall Doug Bates telling me
it worked for him (possibly after one or two manual steps I cannot
recall).
My guess is that the manual steps are the ones I described above. Michael
c) I hope to get to OpenBlas myself 'soon' and may follow-up then. Lastly, and as always, faster BLAS are nice, but BLAS are rarely your bottleneck with R. Hope this helps, Dirk | | Hope this helps, | Michael | | | _______________________________________________ |> R-SIG-Debian mailing list |> R-SIG-Debian at r-project.org |> https://stat.ethz.ch/mailman/listinfo/r-sig-debian | | -- | Dr. Michael A. Rutter | School of Science | Penn State Erie, The Behrend College | Station Road | Erie, PA 16563 | http://math.bd.psu.edu/faculty/rutter | | _______________________________________________ | R-SIG-Debian mailing list | R-SIG-Debian at r-project.org | https://stat.ethz.ch/mailman/listinfo/r-sig-debian
Dr. Michael A. Rutter School of Science Penn State Erie, The Behrend College Station Road Erie, PA 16563 http://math.bd.psu.edu/faculty/rutter
8 days later
So my experiments have confirmed that the binary version of OpenBLAS uses onlt two cores.? Should the compiled version use more? I want figure out which package to utilize mulitiple cores in a UNIX environment.? Did some research on this a while back but it's a bit fuzzy right now.? My main concern is there's a warning about BLAS and multiple cores in the install docs. Will I run into problems? ? ----- Original Message ----- From: Michael Rutter <mar36 at psu.edu> To: Dirk Eddelbuettel <edd at debian.org> Cc: Scott Raynaud <scott.raynaud at yahoo.com>; "r-sig-debian at r-project.org" <r-sig-debian at r-project.org> Sent: Tuesday, February 14, 2012 6:47 PM Subject: Re: [R-sig-Debian] Accessto OpenBLAS
On 02/14/2012 06:40 PM, Dirk Eddelbuettel wrote:
On 14 February 2012 at 18:15, Michael Rutter wrote: | | | On 02/14/2012 04:56 PM, Scott Raynaud wrote: |>? My IT people have set up R on a a Kubuntu box with an RWkard |>? front end.? I have OpenBLAS set up as a shared BLAS but I'm not |>? sure how to get R to see it.? A.3.1 of the installation docs talks |>? about it but I'm not clear if I need a option on my startup line or |>? if I need to find a config file.? The BLAS is is in: |> |>? /usr/lib/openblas-base |> |>? on my machine. I'm not sure how to confirm that R is seeing |>? the BLAS. |> |>? Recommendations? |> | | Scott, | | There used to be a good post about this on a blog, but the blog has gone | under.? Luckily, I was able to salvage the post from Google cache.? Here | is the relevant part: | |? ? ? Copy the resulting .so shared object library file | (libgoto2_penrynp-r1.12.so on my machine) to /usr/lib |? ? ? The original BLAS library located there is called libblas.so.3gf.0. |? Back this file up:? cp libblas.so.3gf.0? libblas.so.3gf.0.keep |? ? ? Make a symbolic link to the new BLAS library: |? ? ? ln -s libgoto2_penrynp-r1.12.so libblas.so.3gf.0 | | Basically, you need to make sure that the file "libblas.so.3gf.0" links | to the location of your lib.? I would find a benchmark file | (http://r.research.att.com/benchmarks/) to test R before and after | creating the link, just to make sure it is working. Is that really needed? a)? We never had Goto in the distro for its licensing issues. But there ? ? ? always was the goto2helper package from Japan which I and other have ? ? ? used with great success. ? ? ? With it, goto BLAS became a drop-in just like Atlas or MKL.
That package is hard to find without Dirk's gcdb vignette.? Here is the link: http://prs.ism.ac.jp/~nakama/debian/lenny-ism/ That would work to install GotoBLAS. Reworking the helper package for OpenBLAS would make a nice little project.? There is an OpenBLAS package for Ubuntu 11.10, but the binary version only uses two cores, at least that what it used the last time I tried it.
b)? I haven't had time play with Openblas but I recall Doug Bates telling me ? ? ? it worked for him (possibly after one or two manual steps I cannot ? ? ? recall).
My guess is that the manual steps are the ones I described above. Michael
c)? I hope to get to OpenBlas myself 'soon' and may follow-up then. Lastly, and as always, faster BLAS are nice, but BLAS are rarely your bottleneck with R. Hope this helps, Dirk | | Hope this helps, | Michael | | |? _______________________________________________ |>? R-SIG-Debian mailing list |>? R-SIG-Debian at r-project.org |>? https://stat.ethz.ch/mailman/listinfo/r-sig-debian | | -- | Dr. Michael A. Rutter | School of Science | Penn State Erie, The Behrend College | Station Road | Erie, PA 16563 | http://math.bd.psu.edu/faculty/rutter | | _______________________________________________ | R-SIG-Debian mailing list | R-SIG-Debian at r-project.org | https://stat.ethz.ch/mailman/listinfo/r-sig-debian
Dr. Michael A. Rutter School of Science Penn State Erie, The Behrend College Station Road Erie, PA 16563 http://math.bd.psu.edu/faculty/rutter
On 23 February 2012 at 09:08, Scott Raynaud wrote:
| So my experiments have confirmed that the binary version of
| OpenBLAS uses onlt two cores.? Should the compiled version
| use more?
|
| I want figure out which package to utilize mulitiple cores in
| a UNIX environment.? Did some research on this a while back
| but it's a bit fuzzy right now.? My main concern is there's a
| warning about BLAS and multiple cores in the install docs.
| Will I run into problems?
Did you see the README?
4.Usages
Link with libopenblas.a or -lopenblas for shared library.
4.1 Set the number of threads with environment variables. for example,
export OPENBLAS_NUM_THREADS=4
or
export GOTO_NUM_THREADS=4
or
export OMP_NUM_THREADS=4
The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS.
If you compile this lib with USE_OPENMP=1, you should only set OMP_NUM_THREADS environment variable.
Some BLAS libraries can respond to environment variables at run-time: MKL,
GotoBlas and hence OpenBlas. For others such as Atlas this is fixed at
compile time.
Dirk
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too dark to read." -- Groucho Marx
6 days later
So I was passing this to my IT department but they have now abandoned me and I'm left to fend for myself.? I guess I have to learn how to do everything on my own now. I looked at the read.me.? It's pretty cryptic.? How does one link with -lopenblas to a shared library?? At the bash command line? Somewhere else?? Where? My machine has 4 Intel? Xeon? Processor X5650 CPUs.? On Intel's site they say each CPU has 6 cores and 12 threads.? Of course I want to take advatage of that horsepower. It looks like the environment variables can be setup when I launch R, correct? The questions is how?? There are three environment variables.? Which one should I use?? And how do I get R to pick up those environment variables.? (I'm usinf Rkward as a front end). There's some ambiguity in the read.me under known issues.? It says: The number of CPUs/Cores should less than or equal to 8*sizeof(unsigned long). On 64 bits, the limit is 64. ? I'm not sure what that implies in terms of my machine. To what values?do I set my environment variables? ? ----- Original Message ----- From: Dirk Eddelbuettel <edd at debian.org> To: Scott Raynaud <scott.raynaud at yahoo.com> Cc: "r-sig-debian at r-project.org" <r-sig-debian at r-project.org> Sent: Thursday, February 23, 2012 11:31 AM Subject: Re: [R-sig-Debian] Accessto OpenBLAS
On 23 February 2012 at 09:08, Scott Raynaud wrote:
| So my experiments have confirmed that the binary version of | OpenBLAS uses onlt two cores.? Should the compiled version | use more? | | I want figure out which package to utilize mulitiple cores in | a UNIX environment.? Did some research on this a while back | but it's a bit fuzzy right now.? My main concern is there's a | warning about BLAS and multiple cores in the install docs. | Will I run into problems? Did you see the README?? ? 4.Usages ? Link with libopenblas.a or -lopenblas for shared library. ? 4.1 Set the number of threads with environment variables. for example, ? export OPENBLAS_NUM_THREADS=4 ? ? or ? export GOTO_NUM_THREADS=4 ? ? or ? export OMP_NUM_THREADS=4 ? ? The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS. ? ? If you compile this lib with USE_OPENMP=1, you should only set OMP_NUM_THREADS environment variable. Some BLAS libraries can respond to environment variables at run-time: MKL, GotoBlas and hence OpenBlas.? For others such as Atlas this is fixed at compile time. Dirk
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too dark to read." -- Groucho Marx
On 29 February 2012 at 13:42, Scott Raynaud wrote:
| So I was passing this to my IT department but they have now
| abandoned me and I'm left to fend for myself.? I guess I have to
| learn how to do everything on my own now.
|
| I looked at the read.me.? It's pretty cryptic.? How does one link
| with -lopenblas to a shared library?? At the bash command line?
| Somewhere else?? Where?
Based on my so-far-still-casual investigation, on Ubuntu (and Debian, at the
same OpenBLAS package version), you do nothing and just make sure that
OpenBLAS is your installed BLAS (eg if you have Atlas, it ranks higher as a
default and will be picked):
(The following is a little edited to fit the columns)
edd at max:~$ dpkg -l|grep atlas # no atlas
edd at max:~$ dpkg -l|grep openblas
ii libopenblas-base 0.1alpha2.2-3 Optimized BLAS (linear algebra) ...
ii libopenblas-dev 0.1alpha2.2-3 Optimized BLAS (linear algebra) ...
edd at max:~$ ldd /usr/lib/R/lib
lib/ library/
edd at max:~$ ldd /usr/lib/R/lib/libR.so
linux-vdso.so.1 => (0x00007fff83fff000)
libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007f9cfe120000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9cfde9c000)
libreadline.so.6 => /lib/libreadline.so.6 (0x00007f9cfdc59000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9cfda1d000)
liblzma.so.2 => /usr/lib/liblzma.so.2 (0x00007f9cfd7fb000)
libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00007f9cfd5ea000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9cfd3d2000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9cfd1ca000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9cfcfc5000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f9cfcdb7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9cfcb9a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9cfc7fa000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9cffb48000)
libtinfo.so.5 => /lib/libtinfo.so.5 (0x00007f9cfc5d3000)
edd at max:~$ ls -l /usr/lib/libblas.so.3gf
lrwxrwxrwx 1 root root 32 2012-02-23 11:23 /usr/lib/libblas.so.3gf -> /etc/alternatives/libblas.so.3gf
edd at max:~$ ls -l /usr/lib/libblas.so.3gf /etc/alternatives/libblas.so.3gf
lrwxrwxrwx 1 root root 39 2012-02-23 11:23 /etc/alternatives/libblas.so.3gf -> /usr/lib/openblas-base/libopenblas.so.0
lrwxrwxrwx 1 root root 32 2012-02-23 11:23 /usr/lib/libblas.so.3gf -> /etc/alternatives/libblas.so.3gf
edd at max:~$
So R is dynamically linked the _system's_ libblas.so.3gf which is, when we
follow the symlinks, is provided by OpenBLAS.
Ok?
| My machine has 4 Intel? Xeon? Processor X5650 CPUs.? On
| Intel's site they say each CPU has 6 cores and 12 threads.? Of
| course I want to take advatage of that horsepower. It looks like
| the environment variables can be setup when I launch R, correct?
Yes as per the text I included last time.
| The questions is how?? There are three environment variables.?
| Which one should I use?? And how do I get R to pick up
| those environment variables.? (I'm usinf Rkward as a front end).
Read any standard Unix text. ~/.bashrc is one possibility. If it is for R
only, ~/.R/Renviron is another.
Dirk
|
| There's some ambiguity in the read.me under known issues.?
| It says:
|
| The number of CPUs/Cores should less than or equal to
| 8*sizeof(unsigned long). On 64 bits, the limit is 64.
| ?
| I'm not sure what that implies in terms of my machine.
| To what values?do I set my environment variables?
| ?
| ----- Original Message -----
| From: Dirk Eddelbuettel <edd at debian.org>
| To: Scott Raynaud <scott.raynaud at yahoo.com>
| Cc: "r-sig-debian at r-project.org" <r-sig-debian at r-project.org>
| Sent: Thursday, February 23, 2012 11:31 AM
| Subject: Re: [R-sig-Debian] Accessto OpenBLAS
|
|
| On 23 February 2012 at 09:08, Scott Raynaud wrote:
| | So my experiments have confirmed that the binary version of | | OpenBLAS uses onlt two cores.? Should the compiled version | | use more? | | | | I want figure out which package to utilize mulitiple cores in | | a UNIX environment.? Did some research on this a while back | | but it's a bit fuzzy right now.? My main concern is there's a | | warning about BLAS and multiple cores in the install docs. | | Will I run into problems? | | Did you see the README?? | | ? 4.Usages | ? Link with libopenblas.a or -lopenblas for shared library. | | ? 4.1 Set the number of threads with environment variables. for example, | ? export OPENBLAS_NUM_THREADS=4 | ? ? or | ? export GOTO_NUM_THREADS=4 | ? ? or | ? export OMP_NUM_THREADS=4 | ? | ? The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS. | ? | ? If you compile this lib with USE_OPENMP=1, you should only set OMP_NUM_THREADS environment variable. | | Some BLAS libraries can respond to environment variables at run-time: MKL, | GotoBlas and hence OpenBlas.? For others such as Atlas this is fixed at | compile time. | | Dirk | | -- | "Outside of a dog, a book is a man's best friend. Inside of a dog, it is too | dark to read." -- Groucho Marx |
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too dark to read." -- Groucho Marx