MATLAB Answers

parfor giving : Maximum variable size allowed by the program is exceeded.

1 ビュー (過去 30 日間)
Paul
Paul 2013 年 12 月 19 日
回答済み: Paul 2013 年 12 月 20 日
Dear All,
I'm getting an error message while using parfor which has completely stumped me. I'm doing the following numerical integration:
for i = 1:N
I = quadgk(@(u)Integrand1(u,x(i), etc, etc ) ,0,200,'RelTol',1e-6,'AbsTol',1e-6);
f(1,i) = (1/pi) * I;
end
for some Integrand which is defined and f & x are preallocated. This runs fine but takes a long time so would be efficient to run in parallel. When I run the loop with 'parfor' I get the following error:
Maximum variable size allowed by the program is exceeded.
Error in run (line 63)
evalin('caller', [script ';']);
Caused by:
Maximum variable size allowed by the program is exceeded.
I guess this error is due to my stack being filled up but that shouldn't happen here given that it runs in serial ok.

回答 (1 件)

Paul
Paul 2013 年 12 月 20 日
nobody seems interested in this question but some extent solved my problem for anyone else facing this issue.
ok - so I missed out a piece of information. The above code was run using the command line because i'm ssh'in to a remote linux box at my office. This crashes even though the machine has massive memory. However, we I run the program using the matlab gui everythings works out fine. No idea why this is the case - maybe there are is a switch need when starting the matlab script?

Community Treasure Hunt

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

Start Hunting!

Translated by