On Mar 14, 2012, at 12:53 PM, Paul Gilbert wrote:
On 12-03-13 09:59 PM, Simon Urbanek wrote:
On Mar 13, 2012, at 3:05 PM, Paul Gilbert wrote:
On 12-03-13 12:50 PM, Brian G. Peterson wrote:
On Tue, 2012-03-13 at 12:40 -0400, Paul Gilbert wrote:
Brian
Thanks for spelling this out for those of us that are a bit slow.
(Newbie questions below)
So, if your BLAS does multithreaded matrix multiplication, it will use
multiple threads 'implicitly', as Simon pointed out.
Is there an easy way to know if the R I am using has been compiled with
multi-thread BLAS support?
BLAS should be 'plug and play', as R is usually compiled to use a shared
object BLAS. As such, installing the BLAS on your machine (and
appropriately configuring it) should 'just work' with te new BLAS when
you restart R.
Dirk et. al. wrote a paper, now a bit dated, that benchmarked some of
the BLAS libraries, that should have some additional details.
(I have a long history of getting things that should 'just work' to 'just not work'.) But I didn't really state my question very well. I'm really wondering about two related situations. How can I confirm after a change to underlying system that R is using the new configuration, and second, if I am running benchmarks in R is there an easy way to record the underlying configuration that is being used.
You can check whether you're leveraging multiple cores simply via system.time:
m=matrix(rnorm(4e6),2000)
system.time(m %*% m)
user system elapsed
6.860 0.020 0.584
The above is clearly using threaded BLAS (here I'm using ATLAS), because
the elapsed time is much smaller than the CPU time so it was computed in parallel.
Perhaps I am misreading something. I don't see elapse< CPU,