필터 지우기
필터 지우기

fmincon and Parallel Computing

조회 수: 37 (최근 30일)
John R.
John R. 2015년 12월 17일
댓글: John R. 2015년 12월 17일
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