I'm solving a biggish problem where the function takes a while to compute and want to throw as many workers as possible on the problem.
  1. Is the reason to set UseParallel to true when solving a problem with fmincon that it can potentially speed up the evaluation of the problem's gradient?
  2. Say my problem has 100 variables. Could I then theoretically improve performance with up to 100 workers? Or does fmincon never use that many parallel processes?

댓글 수: 1

"Is the reason to set UseParallel to true when solving a problem with fmincon that it can potentially speed up the evaluation of the problem's gradient?"
Only if you don't provide the gradient then fmincon estimates the gradient using finite differnce, each component of the gradient can be estimated in parallel and UseParallel is set to TRUE.

댓글을 달려면 로그인하십시오.

 채택된 답변

Matt J
Matt J 2024년 3월 1일
편집: Matt J 2024년 3월 1일

0 개 추천

Is the reason to set UseParallel to true when solving a problem with fmincon that it can potentially speed up the evaluation of the problem's gradient?
Yes.
Say my problem has 100 variables. Could I then theoretically improve performance with up to 100 workers? Or does fmincon never use that many parallel processes?
Theoretically. The number of workers can be set by you using parpool, if you have the Parallel Computing Toolbox, or fmincon will call parpool with default settings. How many workers you can create in a pool depends on your Matlab version and the resources available to your computer.

댓글 수: 3

I'm trying to run the problem on a cluster. There I could have lots and lots and lots of workers :-)
Matt J
Matt J 2024년 3월 1일
If it's a cluster, you'll also have to consider the time for transmitting data to the cluster nodes. If the work done by each node is much less than the communication time, you may not benefit much.
Good point, but I don’t think that should be a problem here…

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

제품

릴리스

R2023a

질문:

2024년 3월 1일

댓글:

2024년 3월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by