patternsearch 'UseParallel' does not work

Hi All,
The patternsearch works fine in serial run as following.
options = psoptimset('Display','iter','MaxFunEvals',1000); A =[]; b = []; Aeq = []; beq = []; LB = 0.95*x0; UB = 1.05*x0;
xx = patternsearch(@smm,x0,A,b,Aeq,beq,LB,UB,options);
However, if I set 'UseParallel' = true and 'CompletePoll' = 'on' using multi-cores, Matlab finds an error in objective function smm.m
"Starting parallel pool (parpool) using the 'local' profile ... connected to 6 workers. Error using tauchen (line 33) In an assignment A(I) = B, the number of elements in B and I must be the same. Error in smm (line 35) [log_y,g_tran] = tauchen(num_y,mu,rho,sigma,m); "
There is no coding error in tauchen.m and it works well in serial run. Is there anything that I need to fix to run in parallel?
Best, Chamna

回答(0 个)

类别

Community Treasure Hunt

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

Start Hunting!

Translated by