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

3 views (last 30 days)
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.

Answers (1)

Paul
Paul on 20 Dec 2013
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?

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!