From f33c05ac0abfbc12cc8c0c5ddf656cbd231aacd3 Mon Sep 17 00:00:00 2001 From: Christian Valente Date: Wed, 21 Feb 2024 10:49:37 +0100 Subject: [PATCH 1/3] Added ARM64 flags for cbc and gcg --- .../scripts/python/BenchmarkExporter.py | 13 +++--- test/end2end/scripts/python/Solver.py | 45 +++++++++++++++++++ .../scripts/python/SolverCollection.py | 1 + 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/test/end2end/scripts/python/BenchmarkExporter.py b/test/end2end/scripts/python/BenchmarkExporter.py index cfd85a84e..3e4428485 100644 --- a/test/end2end/scripts/python/BenchmarkExporter.py +++ b/test/end2end/scripts/python/BenchmarkExporter.py @@ -49,11 +49,14 @@ def getModelsStats(self, run): return [ stats["nvars"], stats["nintvars"], stats["nconstr"], stats["nnz"]] def getStyle(self, r): - if "solved" in r[-1]["timelimit"]: - return None - elif "limit" in r[-1]["timelimit"]: - return self.font_yellow - else: + try: + if "solved" in r[-1]["timelimit"]: + return None + elif "limit" in r[-1]["timelimit"]: + return self.font_yellow + else: + return self.font_red + except: return self.font_red def writeLastResultLine(self, mr: ModelRunner): diff --git a/test/end2end/scripts/python/Solver.py b/test/end2end/scripts/python/Solver.py index 7987da19d..88be058c3 100644 --- a/test/end2end/scripts/python/Solver.py +++ b/test/end2end/scripts/python/Solver.py @@ -492,6 +492,51 @@ def _doParseSolution(self, st, stdout=None): except: print("No solution, string: {}".format(n)) self._stats["objective"] = None + + +class ConoptSolver(AMPLSolver): + + def _setLPMethod(self, method : str): + return "" + + def _setTimeLimit(self, seconds): + return "maxftime={}".format(seconds) + + def _setNThreads(self, threads): + return "" + + def _getAMPLOptionsName(self): + return "conopt" + + def __init__(self, exeName, timeout=None, nthreads=None, otherOptions=None): + stags = {ModelTags.continuous, ModelTags.integer, ModelTags.binary, + ModelTags.linear, + ModelTags.plinear, + ModelTags.quadratic, + ModelTags.quadratic_obj, + ModelTags.quadraticnonconvex, + + ModelTags.socp, + ModelTags.socp_hard_to_recognize, + ModelTags.nonlinear, ModelTags.log, ModelTags.trigonometric} + + super().__init__(exeName, timeout, nthreads, otherOptions, stags) + + def _doParseSolution(self, st, stdout=None): + if not st: + self._stats["outmsg"] = "Solution file empty" + self._stats["timelimit"] = False + return None + self._stats["outmsg"] = st[0] + self._stats["timelimit"] = "time limit" in st[0] + tag = "Objective " + if tag in st[1]: + n = st[1][st[1].index(tag) + len(tag):] + try: + self._stats["objective"] = float(n) + except: + print("No solution, string: {}".format(n)) + self._stats["objective"] = None class OcteractSolver(AMPLSolver): def __init__(self, exeName, timeout=None, nthreads=None, otherOptions=None): diff --git a/test/end2end/scripts/python/SolverCollection.py b/test/end2end/scripts/python/SolverCollection.py index dd9b9e1fe..d714a8111 100644 --- a/test/end2end/scripts/python/SolverCollection.py +++ b/test/end2end/scripts/python/SolverCollection.py @@ -33,6 +33,7 @@ def addStdSolvers(solvers: SolverCollection, binPath=""): solvers.addSolver(Solver.CPLEXSolver(path.join(binPath,"cplex"))) solvers.addSolver(Solver.CPLEXDirectSolver(path.join(binPath,"cplexmp"))) ## Need as long as the target is there solvers.addSolver(Solver.BaronSolver(path.join(binPath,"baron"))) + solvers.addSolver(Solver.ConoptSolver(path.join(binPath,"conopt4"))) solvers.addSolver(Solver.COPTSolver(path.join(binPath,"copt"))) solvers.addSolver(Solver.MindoptSolver(path.join(binPath,"mindoptampl"))) solvers.addSolver(Solver.HighsSolver(path.join(binPath,"highs"))) From 7ed32268f84e61471322f3929eeae92aa7539aac Mon Sep 17 00:00:00 2001 From: Christian Valente Date: Wed, 21 Feb 2024 15:31:03 +0100 Subject: [PATCH 2/3] Moved nlw-related projects to folders in IDEs. --- CMakeLists.txt | 3 +++ test/end2end/scripts/python/SolverCollection.py | 1 + 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3411ff629..97aa13bb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -512,6 +512,9 @@ if (BUILD_EXAMPLES OR NLW2_LIB) # for a calling CMake project set(NLW2_LIB_NAME ${NLW2_LIB_NAME} PARENT_SCOPE) set(NLW2_C_API_LIB_NAME ${NLW2_C_API_LIB_NAME} PARENT_SCOPE) + # Add to folders to better organize project in IDEs + add_to_folder(${MP_FOLDER_PREFIX}nlw nlw2 nlw2_c_api nl-writer-example-c nl-writer-example-cpp) + add_to_folder(${MP_FOLDER_PREFIX}nlw gen_nl_opcodes nlw-ex-easy-api-c nlw-ex-easy-api-cpp nlw-ex-full-api-c nlw-ex-full-api-cpp) endif() diff --git a/test/end2end/scripts/python/SolverCollection.py b/test/end2end/scripts/python/SolverCollection.py index d714a8111..0b2602c18 100644 --- a/test/end2end/scripts/python/SolverCollection.py +++ b/test/end2end/scripts/python/SolverCollection.py @@ -34,6 +34,7 @@ def addStdSolvers(solvers: SolverCollection, binPath=""): solvers.addSolver(Solver.CPLEXDirectSolver(path.join(binPath,"cplexmp"))) ## Need as long as the target is there solvers.addSolver(Solver.BaronSolver(path.join(binPath,"baron"))) solvers.addSolver(Solver.ConoptSolver(path.join(binPath,"conopt4"))) + solvers.addSolver(Solver.ConoptSolver(path.join(binPath,"conopt"))) solvers.addSolver(Solver.COPTSolver(path.join(binPath,"copt"))) solvers.addSolver(Solver.MindoptSolver(path.join(binPath,"mindoptampl"))) solvers.addSolver(Solver.HighsSolver(path.join(binPath,"highs"))) From ff46d99883775fee6474d34eaab5729a4d80480f Mon Sep 17 00:00:00 2001 From: Christian Valente Date: Wed, 21 Feb 2024 16:55:25 +0100 Subject: [PATCH 3/3] Updated gcg to the latest commit --- solvers/gcgmp/CHANGES.gcgmp.md | 4 ++++ solvers/scipmp/CHANGES.scipmp.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/solvers/gcgmp/CHANGES.gcgmp.md b/solvers/gcgmp/CHANGES.gcgmp.md index 3a259bb9b..015818740 100644 --- a/solvers/gcgmp/CHANGES.gcgmp.md +++ b/solvers/gcgmp/CHANGES.gcgmp.md @@ -1,6 +1,10 @@ Summary of recent updates to GCG for AMPL ========================================= +## 20240221 +- Updated to GCG 400 + + ## 20240115 - *Solve result codes*. - List codes by running (solver) -! diff --git a/solvers/scipmp/CHANGES.scipmp.md b/solvers/scipmp/CHANGES.scipmp.md index d1057f2dc..eac48e0a2 100644 --- a/solvers/scipmp/CHANGES.scipmp.md +++ b/solvers/scipmp/CHANGES.scipmp.md @@ -2,6 +2,10 @@ Summary of recent updates to SCIP for AMPL ========================================== +## 20240221 +- Updated to SCIP 9.0 + + ## 20240121 - Updated to SCIP 8.1.0