very large matrix manipulation
4 次查看(过去 30 天)
显示 更早的评论
Hi I have a matrix that could end up being possibly 25x25 large. I need to do large manipulations on this matrix, for instance I need to generate a matrix of zeros B = zeros(n^m,m); where n and m are the dimensions of the original matrix. This obviously gives me an error because there is not enough computing power to do this. If I understand it right, any value in the matrix is a byte so that would be 25^25 bytes right? thats about 8*10^24 gb?! Whatever - Its too big. Can I use multiple cores to deal with the issue? Please can someone suggest how to get around this
0 个评论
回答(2 个)
Walter Roberson
2011-11-16
In B = zeros(n^m,m) each value in the matrix will be a double precision number, which is 8 bytes.
You can use B = zeros(n^m,m,'uint8') to get one byte per entry.
Remember too that you have n^m by m, so that would be 25^25 * 25 = 25^26 = 2220446049250313080847263336181640625 bytes.
Using multiple cores is not going to help without a fundamental reorganization of your problem. 25^26 bytes requires a 121 bit address space, but the maximum implemented for any x86 type chips (the only thing MATLAB runs on these days) is 48 bits of address space. Even if you managed to partition the problem up in to 48 bits of address space per instance, you would need approximately 2^(121-48) = 2^73 = 9444732965739290427392 systems (that is close to 1E22)
You need a redesign.
Jill Reese
2011-11-28
If you have access to Parallel Computing Toolbox and MATLAB Distributed Computing Server, you may find that distributed arrays will help you to work around the memory limitation. That is exactly what they are intended for.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!