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 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by