Comments (10)
Thanks for trying it out on a Mac. It's encouraging that it works without helper threads. The speed up on the matrix multiply test is a result of pqR using C routines that are a bit more sophisticated than the BLAS supplied with R-2.15.0. I'll be writing a blog post on matrix multiplies in pqR soon.
The problem when helper threads are enabled appears to be that openMP is not fully implemented with your toolset on the Mac, which surprises me. A bit of a search revealed a thread at http://openmp.org/forum/viewtopic.php?f=3&t=698 about this. It seems that there are solutions, but not having gotten into Mac's development environment yet, I can't say much more.
from pqr.
Thanks. The thread solves my problem! The Apple gcc compiler doesn't work but GNU gcc compiler does!
from pqr.
Great! I guess the new compiler must also generate better code, since the test has speeded up!
You can try something like the following to see if the helper threads are actually working:
A <- matrix(1.1,1000,1000)
B <- matrix(2.2,1000,1000)
system.time({ X <- A %*% B + B %*% A; print(X[1000,1000]) })
system.time({ X <- A %*% B + B %*% A; print(X[1000,1000]) })
You can compare results with and without a --helpers=1 argument to the R command. You should see a "Using 1 helper threads" line printed in the startup message with the --helpers=1 argument. The first system.time may be different from later times, both because memory allocation may not have settled down, and because of a somewhat strange feature of pqR (which I may eliminate so I won't feel a need to explain it...).
Don't try it without the "print", since then pqR will see no need to wait for anything to actually finish before the system.time is done. (Maybe I should change system.time to wait...?)
from pqr.
I compared the R, pqR and pqR -- helpers==1 with the below example.
The time elapsed are 18.823,12.836 and 9.928 respectively.
f = function(n){
for(i in 1:n){
A = matrix(rnorm(1000^2), 1000,1000)
B = matrix(rnorm(1000^2), 1000,1000)
list(A%*%B,B%*%A)
}
}
system.time(f(10))
Very promising!
from pqr.
@randy3k What did you have to do to get it to compile on Mac OSX? I'm also interested in trying it out
from pqr.
I am also able to compile the R GUI for the non-helper distribution.
But for the helper distribution,
I got a runtime error. Same problem? #2
from pqr.
For the non-helper distribution
- Get any gcc compiler, either from Xcode or GNU.
- follow http://radfordneal.github.io/pqR/R-admin.html#Installing-R-under-Unix_002dalikes
./configure --disable-helper-threads
For the helper distribution
- First get a GNU gcc compiler.
- follow http://radfordneal.github.io/pqR/R-admin.html#Installing-R-under-Unix_002dalikes
./configure CC=/path/to/GNU/gcc
from pqr.
What version of gcc did you use? I downloaded gcc-4.9 through homebrew and got the following error:
arima.c: In function 'getQ0':
arima.c:819:6: internal compiler error: Segmentation fault: 11
SEXP getQ0(SEXP sPhi, SEXP sTheta)
^arima.c:819:6: internal compiler error: Abort trap: 6
from pqr.
i am using gcc4.8, also from homebrew.
rmbp:~ Randy$ brew list gcc48
/usr/local/Cellar/gcc48/4.8.1/bin/x86_64-apple-darwin12.4.0-gcc-ranlib-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/x86_64-apple-darwin12.4.0-gcc-nm-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/x86_64-apple-darwin12.4.0-gcc-ar-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/x86_64-apple-darwin12.4.0-gcc-4.8.1
/usr/local/Cellar/gcc48/4.8.1/bin/x86_64-apple-darwin12.4.0-gcc-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/x86_64-apple-darwin12.4.0-g++-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/x86_64-apple-darwin12.4.0-c++-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/gcov-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/gcc-ranlib-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/gcc-nm-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/gcc-ar-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/gcc-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/g++-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/cpp-4.8
/usr/local/Cellar/gcc48/4.8.1/bin/c++-4.8
/usr/local/Cellar/gcc48/4.8.1/gcc/include/ (669 files)
/usr/local/Cellar/gcc48/4.8.1/gcc/lib/ (268 files)
/usr/local/Cellar/gcc48/4.8.1/gcc/libexec/ (10 files)
/usr/local/Cellar/gcc48/4.8.1/share/gcc-4.8.1/ (3 files)
/usr/local/Cellar/gcc48/4.8.1/share/man/ (4 files)
In particularly, I used
./configure CC=/usr/local/Cellar/gcc48/4.8.1/bin/gcc-4.8
from pqr.
Confirming that I've successfully been able to install using gcc-4.4 and make check
comes up fine. Speed tests are as follows for the function above:
>pqR - no helpers:
user system elapsed
13.421 0.102 13.523
> pqR - 1 helper
user system elapsed
18.758 0.092 10.126
> R 3.0.1
user system elapsed
85.334 0.178 85.618
from pqr.
Related Issues (20)
- What is preventing the merge of pqR into R? HOT 1
- pqR side by side with GNU-R HOT 8
- T and F don't work with mat_mult_with_BLAS configuration argument
- Docker image for pqR HOT 3
- No window version available HOT 1
- Incompatible library version HOT 3
- Will pqR code be merged to R? HOT 9
- Missing <R_ext/sggc-app.h> HOT 11
- Proposal of new feature: native 64 bit integers support HOT 2
- R/time.R - filename restricted? HOT 5
- Update formula does not work as expected HOT 6
- make error: multiple definitions HOT 6
- segfault when using attributes HOT 1
- buffer overflow when using attributes on a recursive function HOT 2
- floating point exception
- pqR aborted when using plot
- Problems with installation ubuntu 20.04 HOT 5
- Pqr and running Rstudio on mac
- Installation fails on Slackware 15.0 HOT 13
- Slow pqR loops vs R (CRAN)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pqr.