Skip to content
Prev 1285 / 2152 Next

Matrix multiplication

On Mar 13, 2012, at 3:05 PM, Paul Gilbert wrote:

            
You can check whether you're leveraging multiple cores simply via system.time:
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. In contrast this is what you get using single-threaded R BLAS on the same machine:
user  system elapsed 
 10.480   0.020  10.505 

It takes about 18x longer - this is a combination of the number of cores and the less optimized BLAS - and the elapsed time is greater or equal to the CPU time = single-threaded.

As for recording the underlying configuration - that is not really possible in general - you have to know what you enabled/compiled. In case of a shared BLAS implementation you may be able to infer that from the library name, but for static BLAS it is close to impossible to figure it out.

Cheers,
Simon