Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested SLSQP bug fix. #9317

Merged
merged 2 commits into from
Oct 6, 2018
Merged

Nested SLSQP bug fix. #9317

merged 2 commits into from
Oct 6, 2018

Conversation

GeneraalFandaal
Copy link
Contributor

First time contributor here. I came across a problem with nested optimization using the SLSQP method in scipy.optimize (Issue #9316) I added a test demonstrating the problem and managed to fix the problem by storing additional information about the internal state of the SLSQP optimization process in _minimize_slsqp(). Seems to be working fine on my side.

See issue scipy#9316.

The Fortran SLSQP implementation made use of local variables with the
SAVE attribute. The state of these variables were not correctly restored
if nested calls to SLSQP were made. The problem was fixed by passing all
these variables in as parameters to SLSQP, instead of relying on the
SAVE attribute. In this way, the correct state for different SLSQP
optimizations that are running simulataneously or nested can be stored.
@ilayn ilayn added enhancement A new feature or improvement scipy.optimize labels Sep 28, 2018
@pv pv merged commit 56573e0 into scipy:master Oct 6, 2018
@pv
Copy link
Member

pv commented Oct 6, 2018

Thanks, looks ok to me.
Not the prettiest thing, but probably the easiest way to do it.

@pv pv added this to the 1.2.0 milestone Oct 6, 2018
@batterseapower
Copy link
Contributor

I had issues using SLSQP concurrently on multiple threads (not reentrantly within one thread) with scipy 1.1.0. Upgrading to 1.2.1 seems to have fixed this, probably because of this commit. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement scipy.optimize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants