Skip to content

Commit

Permalink
update log of call_before_subproblem_solve
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng committed May 1, 2024
1 parent a74fad7 commit add489c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pyomo/contrib/mindtpy/algorithm_base_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -2950,7 +2950,7 @@ def MindtPy_iteration_loop(self):
)
if self.curr_int_sol not in set(self.integer_list):
# Call the NLP pre-solve callback
with time_code(self.timing, 'Call after subproblem solve'):
with time_code(self.timing, 'Call before subproblem solve'):
config.call_before_subproblem_solve(self.fixed_nlp)

fixed_nlp, fixed_nlp_result = self.solve_subproblem()
Expand All @@ -2965,7 +2965,7 @@ def MindtPy_iteration_loop(self):
# The constraint linearization happens in the handlers
if not config.solution_pool:
# Call the NLP pre-solve callback
with time_code(self.timing, 'Call after subproblem solve'):
with time_code(self.timing, 'Call before subproblem solve'):
config.call_before_subproblem_solve(self.fixed_nlp)

fixed_nlp, fixed_nlp_result = self.solve_subproblem()
Expand Down Expand Up @@ -3002,7 +3002,7 @@ def MindtPy_iteration_loop(self):
self.integer_list.append(self.curr_int_sol)

# Call the NLP pre-solve callback
with time_code(self.timing, 'Call after subproblem solve'):
with time_code(self.timing, 'Call before subproblem solve'):
config.call_before_subproblem_solve(self.fixed_nlp)

fixed_nlp, fixed_nlp_result = self.solve_subproblem()
Expand Down
4 changes: 2 additions & 2 deletions pyomo/contrib/mindtpy/config_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ def _add_common_configs(CONFIG):
ConfigValue(
default=_DoNothing(),
domain=None,
description='Function to be executed after every subproblem',
doc='Callback hook after a solution of the nonlinear subproblem.',
description='Function to be executed before every subproblem',
doc='Callback hook before a solution of the nonlinear subproblem.',
),
)
CONFIG.declare(
Expand Down
4 changes: 2 additions & 2 deletions pyomo/contrib/mindtpy/single_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ def __call__(self):

# solve subproblem
# Call the NLP pre-solve callback
with time_code(mindtpy_solver.timing, 'Call after subproblem solve'):
with time_code(mindtpy_solver.timing, 'Call before subproblem solve'):
config.call_before_subproblem_solve(mindtpy_solver.fixed_nlp)
# The constraint linearization happens in the handlers
fixed_nlp, fixed_nlp_result = mindtpy_solver.solve_subproblem()
Expand Down Expand Up @@ -923,7 +923,7 @@ def LazyOACallback_gurobi(cb_m, cb_opt, cb_where, mindtpy_solver, config):

# solve subproblem
# Call the NLP pre-solve callback
with time_code(mindtpy_solver.timing, 'Call after subproblem solve'):
with time_code(mindtpy_solver.timing, 'Call before subproblem solve'):
config.call_before_subproblem_solve(mindtpy_solver.fixed_nlp)
# The constraint linearization happens in the handlers
fixed_nlp, fixed_nlp_result = mindtpy_solver.solve_subproblem()
Expand Down

0 comments on commit add489c

Please sign in to comment.