Saving large files within parfor loops

5 ビュー (過去 30 日間)
Nicholas Ayres
Nicholas Ayres 2020 年 7 月 6 日
コメント済み: Kojiro Saito 2020 年 7 月 8 日
i am trying to save variables >2Gb to separate .mat files from within a parfor loop. I have written a parsave function and explecitly called '-v7.3' from within my parsave function. See below.
function parsave(file,camData)
save(file,'camData','-v7.3')
end
However, whenever the data gets to this point, I get the
"Could not save because data was larger than 2GB. Use -v7.3 to save variables larger than 2GB" warning.
Does anyone know why this is/how I can get around this issue? It seems weird that MatLab calls this issue when I've explicitly told it to act on it.
  1 件のコメント
Kojiro Saito
Kojiro Saito 2020 年 7 月 8 日
I've tested the following code in R2019b but couldn't reproduce the warning which you got. It works well.
parfor ii=1:2
a = ones(2^31+ii, 1);
fname = sprintf("result_%d.mat", ii);
parsave(fname, a)
end
function parsave(file, var)
save(file, 'var', '-v7.3')
end
Is there any different from your actual code?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel Computing Toolbox についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by