Parallel Computing with surrogateopt
R2026bEnabling Parallel Computing
surrogateopt can evaluate objective function values on
multiple workers simultaneously. Unlike other solvers that use
parfor, surrogateopt uses
parfeval (Parallel Computing Toolbox) to send evaluations
to workers asynchronously.
To enable parallel computing:
options = optimoptions("surrogateopt",UseParallel="auto");
When UseParallel is "auto" or
"on", surrogateopt distributes search
point evaluations to available workers. The solver continues selecting new
search points while waiting for evaluations to complete on workers.
You cannot set UseParallel to "auto"
or "on" and also set UseVectorized to
true. If you enable both, the solver ignores
UseVectorized and attempts to compute in parallel using a
parallel pool, if possible.
For algorithmic details, see Parallel surrogateopt Algorithm.
Limitations
No nested parallel loops.
parfeval(Parallel Computing Toolbox) does not work in parallel when called from within anotherparfevalloop. If your objective or constraint functions useparfeval, the solver's parallel evaluation takes precedence and your innerparfevalruns serially.
For information on factors that affect the speed and results of parallel computations, see Improving Performance with Parallel Computing.