Skip to content

Commit

Permalink
disable ipopt warmstart for feasibility subproblem solver
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng committed Sep 21, 2023
1 parent ff401df commit 6d442b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyomo/contrib/mindtpy/algorithm_base_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -2574,7 +2574,7 @@ def initialize_subsolvers(self):
self.nlp_opt, config.nlp_solver, config
)
set_solver_constraint_violation_tolerance(
self.feasibility_nlp_opt, config.nlp_solver, config
self.feasibility_nlp_opt, config.nlp_solver, config, warm_start=False
)

self.set_appsi_solver_update_config()
Expand Down
21 changes: 11 additions & 10 deletions pyomo/contrib/mindtpy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def set_solver_mipgap(opt, solver_name, config):
opt.options['add_options'].append('option optcr=%s;' % config.mip_solver_mipgap)


def set_solver_constraint_violation_tolerance(opt, solver_name, config):
def set_solver_constraint_violation_tolerance(opt, solver_name, config, warm_start=True):
"""Set constraint violation tolerance for solvers.
Parameters
Expand Down Expand Up @@ -600,15 +600,16 @@ def set_solver_constraint_violation_tolerance(opt, solver_name, config):
opt.options['add_options'].append(
'constr_viol_tol ' + str(config.zero_tolerance)
)
# Ipopt warmstart options
opt.options['add_options'].append(
'warm_start_init_point yes\n'
'warm_start_bound_push 1e-9\n'
'warm_start_bound_frac 1e-9\n'
'warm_start_slack_bound_frac 1e-9\n'
'warm_start_slack_bound_push 1e-9\n'
'warm_start_mult_bound_push 1e-9\n'
)
if warm_start:
# Ipopt warmstart options
opt.options['add_options'].append(
'warm_start_init_point yes\n'
'warm_start_bound_push 1e-9\n'
'warm_start_bound_frac 1e-9\n'
'warm_start_slack_bound_frac 1e-9\n'
'warm_start_slack_bound_push 1e-9\n'
'warm_start_mult_bound_push 1e-9\n'
)
elif config.nlp_solver_args['solver'] == 'conopt':
opt.options['add_options'].append(
'RTNWMA ' + str(config.zero_tolerance)
Expand Down

0 comments on commit 6d442b2

Please sign in to comment.