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

read ticks per second from cplex logs #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyomo/opt/results/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def __init__(self):
self.declare('message')
self.declare('user_time', type=ScalarType.time)
self.declare('deterministic_time', type=ScalarType.float)
self.declare('ticks_per_second', type=ScalarType.float)
self.declare('system_time', type=ScalarType.time)
self.declare('wallclock_time', type=ScalarType.time)
# Semantics: The specific condition that caused the solver to
Expand Down
1 change: 1 addition & 0 deletions pyomo/solvers/plugins/solvers/CPLEX.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ def process_logfile(self):
results.solver.user_time = float(tokens[3])
elif len(tokens) >= 4 and tokens[0] == "Deterministic" and tokens[1] == "time" and tokens[2] == "=":
results.solver.deterministic_time = float(tokens[3])
results.solver.ticks_per_second = float(tokens[5][1:])
elif len(tokens) >= 4 and tokens[0] == "Primal" and tokens[1] == "simplex" and tokens[3] == "Optimal:":
results.solver.termination_condition = TerminationCondition.optimal
results.solver.termination_message = ' '.join(tokens)
Expand Down
3 changes: 3 additions & 0 deletions pyomo/solvers/tests/checks/test_cplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ def test_log_file_shows_max_time_limit_exceeded_with_feasible_solution(self):
results.solver.termination_condition, TerminationCondition.maxTimeLimit
)
self.assertEqual(results.solver.deterministic_time, 100.00)
self.assertEqual(results.solver.ticks_per_second, 10.0)

def test_log_file_shows_max_deterministic_time_limit_exceeded_with_feasible_solution(self):
log_file_text = """
Expand All @@ -461,6 +462,8 @@ def test_log_file_shows_max_deterministic_time_limit_exceeded_with_feasible_solu
results.solver.termination_condition, TerminationCondition.maxTimeLimit
)
self.assertEqual(results.solver.deterministic_time, 100.00)
self.assertEqual(results.solver.ticks_per_second, 10.0)


def test_log_file_shows_warm_start_objective_value(self):
log_file_text = """
Expand Down