[R] using mclapply (multi core apply) to do matrix multiplication

Spencer Graves spencer.graves at structuremonitoring.com
Tue Feb 7 16:06:11 CET 2012


       What is the nature of the matrices?  Are they sparse or derived 
from sparse matrices?  If they are sparse, have you looked at the 
packages available in R for sparse matrices?


             library(sos)



             summary(sp <- findFn('sparse', 999))


will identify help pages in contributed packages containing "sparse". 
The primary one is "Matrix", but there are others.


       If they are not sparse but are derived from sparse matrices, you 
might be able to do some theoretical work.  Of course, this only makes 
sense if you have a specific class of problems that generates the 
matrices, which seems plausible since you said you had square matrices 
of dimension 2^14.


       Hope this helps.
       Spencer


On 2/7/2012 4:36 AM, Ernest Adrogué wrote:
>   7-02-2012, 03:32 (-0800); Alaios escriu:
>> I wouldl ike to thank you for your response. The hardest part in the
>> installation is to find a BLAS library to install. If I understand
>> it right once I install BLAS then I only need to change a flag in
>> the ./configure of R installation..
>>
>>
>> Our system is running opensuse and has intel cores. according to the
>> link here http://cran.r-project.org/doc/manuals/R-admin.html#BLAS
>>
>> I ahve to find a proper BLAS library to installll.. In the
>> explanation for the different alternatives seem that most of those
>> are not implemented any more and other require special configuration
>> :(
> This article includes an overview of different BLAS libraries along
> with benchmarks:
>
> http://cran.r-project.org/web/packages/gcbd/vignettes/gcbd.pdf
>
> It looks like using single-threaded ATLAS is already an improvement
> over LAPACK in most cases. I use Debian and it's straightforward to
> replace one with the other: you only have to install the
> libatlas3gf-base package and remove liblapack3gf and libblas3gf.
>
> Unfortunately, Debian does not include a multi-threaded version of
> ATLAS although they provide instructions on how to recompile the
> package yourself with multi-threading enabled.
>
> I don't know about SUSE, sorry.
>


-- 
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567
web:  www.structuremonitoring.com



More information about the R-help mailing list