Can scipy.optimize.minimize(..., method='SLSQP', ...) use multiple cores?

Viewed 472

I am using scipy.optimize.minimize for nonlinear constrained optimization.

I tested two methods (trust-constr, SLSQP).

On a machine (Ubuntu 20.04.1 LTS) where proc gives 32,

scipy.optimize.minimize(..., method='trust-constr', ...) uses multiple cores like 1600%

scipy.optimize.minimize(..., method='SLSQP', ...) only uses one core

According to another post (scipy optimise minimize -- parallelisation options), it seems that this is not a python problem, rather, a BLAS/LAPACK/MKL problem. However, if it is a BLAS problem, then for me, it seems that all methods should be of a single core.

In the post, someone replied that SLSQP uses multiple cores.

Does the parallelization support of scipy.optimize.minimize depends on a chosen method?

How can I make SLSQP use multiple cores?

One observation I made by looking into

anaconda3/envs/[env_name]/lib/python3.8/site-packages/scipy/optimize

trust-constr is implemented in python (_trustregsion_constr directory)

SLSQP is implemented by C (_slsqp.cpython-38-x86_64-linux-gnu.so file)

0 Answers
Related