From 13f65ac0c5b04e276a538a23428106d305376eb7 Mon Sep 17 00:00:00 2001 From: Ronald van der Velden Date: Wed, 18 Dec 2024 20:20:31 +0100 Subject: [PATCH] Add logic for work/mem limit; finish test --- src/gurobi_logtools/parsers/termination.py | 4 ++++ tests/parsers/test_termination.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gurobi_logtools/parsers/termination.py b/src/gurobi_logtools/parsers/termination.py index e1aa5d7..08fa23c 100644 --- a/src/gurobi_logtools/parsers/termination.py +++ b/src/gurobi_logtools/parsers/termination.py @@ -31,6 +31,8 @@ class TerminationParser: re.compile( r"Thread count was (?P\d+) \(of (?P\d+) available processors\)" ), + re.compile(r"(?PWork limit reached)"), + re.compile(r"(?PMemory limit reached)"), ] status = [ @@ -45,6 +47,8 @@ class TerminationParser: "CUTOFF", "USER_OBJ_LIMIT", "INTERRUPTED", + "MEM_LIMIT", + "WORK_LIMIT" ] def __init__(self): diff --git a/tests/parsers/test_termination.py b/tests/parsers/test_termination.py index 60efc76..95bf26c 100644 --- a/tests/parsers/test_termination.py +++ b/tests/parsers/test_termination.py @@ -55,7 +55,10 @@ """ memlimit_summary = { - "Status": "MEM_LIMIT" + "Status": "MEM_LIMIT", + "SolCount": 10, + "Threads": 8, + "Cores": 8, } worklimit_log = """ @@ -69,7 +72,10 @@ """ worklimit_summary = { - "Status": "WORK_LIMIT" + "Status": "WORK_LIMIT", + "SolCount": 10, + "Threads": 8, + "Cores": 8, } class TestTermination(TestCase):