parallel computing of optimization problem

1 view (last 30 days)
Hi all,
I am trying to parallelize my optimization code. Below is my original code
options=optimset('TolX',1e-8,'TolFun',1e-8);
[x,resnorm,residual,exitflag] = lsqnonlin(@objfun,x0,[],[],options);
To implement parallel computing, I rewrite it into
matlabpool open 2
options=optimset('TolX',1e-8,'TolFun',1e-8,'UseParallel', 'always');
[x,resnorm,residual,exitflag] = lsqnonlin(@objfun,x0,[],[],options);
matlabpool close
After running matlab, I saw the following in the command window:
Starting matlabpool using the 'local' profile ... connected to 2 labs.
I have tested np=2, 8, 12, but the time cost does not change with the number of processors. So is there anything I missed in my code? Thanks.

Accepted Answer

Walter Roberson
Walter Roberson on 8 Dec 2013
  4 Comments
Walter Roberson
Walter Roberson on 9 Dec 2013
I realized after I posted last night that the difficulty is that the optimizer code itself is not parallelized.
I am reading through a document to see if I can find some hints on performing this task more efficiently; it might take me a couple of days to get through.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!