parallel computing of optimization problem
1 view (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Walter Roberson
on 8 Dec 2013
Explanation here: http://www.mathworks.co.uk/matlabcentral/answers/105573-about-parallel-computing-toolbox#comment_179397
The below may assist in understanding or in improving performance
4 Comments
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.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!