Sharing Large Memory Variable in a parfor
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a code which uses a very large variable of size [3 10 61 50 50 50 60], which is about 55 Gb. The form of the code is roughly like the following:
numthreads = 8;
numvals = 10^6;
load('dat.mat') % loads the big matrix "data"
for i=1:numthreads
vals{i} = zeros(numvals,1);
end
parfor i=1:numthreads
for j=1:numvals
a = randi(3);
b = randi(10);
c = randi(61);
d = randi(50);
e = randi(50);
f = randi(50);
g = randi(60);
refind = sub2ind([3 10 61 50 50 50 60],a,b,c,d,e,f,g);
vals{i}(j) = data(refind);
end
end
Unfortunately, because the matrix 'data is 55 Gb and i only have 64 Gb, I cannot run the above code.
Is there a way I can get around this? Is it possible, for example, to access the matrix directly from the hard drive? If so, perhaps I can load it on a RAM Disk and get fast access as well.
Thanks.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!