[R-SIG-Mac] single-threaded R, 100% CPU with BLAS, vecLib and ATLAS

Simon Urbanek simon.urbanek at r-project.org
Fri Oct 26 03:20:52 CEST 2012


On Oct 25, 2012, at 7:16 PM, Melanie Courtot wrote:

> Hi,
> I am trying to run R on my MacBook Pro 2.4 GHz Intel core i5. I am trying to read a csv file, which works fine on my work colleague's machine (under linux) but causes my CPU to go up to 100% and makes the GUI unresponsive and hangs on the command line. Activity monitor indicates there is only one R thread running.
> I did see that by default R was using the BLAS library, which is single-threaded,

BLAS will have absolutely no effect on read.table() - it will always be single-threaded and it does not use BLAS. The difference between the two machines may be memory - read.table() is not the most efficient way to load a data set and maybe you're running out of memory (but you didn't tell us how you are loading it, really).


> and that there was an option to use vecLib instead. I did this, and 
> ls -l /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib
> does return 
> /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib -> libRblas.vecLib.dylib
> I however still see the same behavior: 100% CPU, single thread.
> I saw that some MacBook pro (Xeon Nehalem based) had a vecLib bug, so I built the ATLAS library and symlinked R to libtatlas.dylib (unfortunately the pre compiled binairies pointed to in a previous email on the list [1] were not available anymore. Building ATLAS was... fun ;)) I was able to get the shared libraries (using --shared in my config) but still see the same behavior when trying to run my code. I was unsure if I should link to libsatlas.dylib or libtatlas.dylib, so tried both (I guess the latter was the right one though)
> I tried building R from the source (specifying -arch x86_64 and --enable-BLAS-shlib to be able to switch libraries), but same behavior and it seems it is an identical version to the prepackaged one (I tried with BLAS, vecLib and ATLAS)
> R info: R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows", Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
> Any help would be greatly appreciated.
> Thanks,
> Melanie
> [1] https://stat.ethz.ch/pipermail/r-sig-mac/2010-October/007817.html
> ---
> Mélanie Courtot
> MSFHR/PCIRN Ph.D. Candidate,
> BCCRC - Terry Fox Laboratory - 12th floor
> 675 West 10th Avenue
> Vancouver, BC
> V5Z 1L3, Canada
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list