fmincon and Parallel Computing

37 次查看(过去 30 天)
Hello,
I have a program that uses fmincon to optimize an objective function. The problem uses linear and nonlinear equality constraints, and nonlinear inequality constraints. I provide the gradients for both the objective function and nonlinear constrain function. I am using the 'sqp' algorithm so no Hessian is provided.
I have fmincon running inside a for-loop, so while each instance of fmincon might be fast, running it thousands of times in this for-loop can take several minutes (or longer!). This for-loop must proceed in sequential order. For example, the results of a loop are used in the following loop, and so on.
My question is, will parallel computing improve the speed of each optimization? If so, is it as simple as setting 'UseParallel' to 'always'? Or do I need to make other changes throughout the objective and constraint functions to accommodate parallel computing?
Thank you.

采纳的回答

Alan Weiss
Alan Weiss 2015-12-17
The automatic parallel computing in fmincon will not help, because you are providing function gradients, and that is all the parallel computing attempts to do. See Parallel Optimization Functionality.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 个评论
John R.
John R. 2015-12-17
Thanks Alan. That document explained it very well. It would appear that for my particular case, the only way to take advantage of Parallel Computing would be to use parfor-loops within my objective and constraint functions and elsewhere in the code.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by