Matrix multiplication using multicore
Ältere Kommentare anzeigen
how can i multiply a matrix of dimension (2^18*103) by its transpose using multiple cores of my local system ?
3 Kommentare
How much RAM do you have? The output has (2^18)^2 elements and needs 549 GB of RAM. If you want to do any calculations with this array, a 1 TB RAM machine is a minimal setup I would start to work with.
Taking into account that the output is symmetric, computing this matrix explicitly might waste half of the memory.
ANUSAI R
am 22 Nov. 2019
Jan
am 23 Nov. 2019
A 128 GB machine is simply too weak to process a matrix multiplication, which produces a 549 GB output. The bottleneck is the disk access, if you use a huge amount of virtual RAM. The number of cores will not really matter, because the calculations in the CPU will take less time (even with a single thread) than writig the data to the disk.
Antworten (1)
James Tursa
am 22 Nov. 2019
Bearbeitet: James Tursa
am 22 Nov. 2019
0 Stimmen
The matrix multiply operator * calls a highy optimized compiled BLAS library to do this calculation. The BLAS library is already multi-threaded and optimized for cache hits. In addition, I believe MATLAB checks for symmetric cases (both operands the same) and calls faster symmetric library routines for this ... at least it used to last time I looked several years ago. So I am not sure there is anything you can do that isn't already being done in the background. The only caveat is the symmetric case ... if MATLAB doesn't do this on your version then it may require a custom mex routine on your part to force this. My MTIMESX submission does this symmetry check, but alas I have not had the time yet to update it for later versions of MATLAB.
See also this link:
1 Kommentar
ANUSAI R
am 25 Nov. 2019
Kategorien
Mehr zu Choose a Solver finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!