Xpress and OR-Tools integration in metrix-simulator#290
Open
lamoletoscar wants to merge 37 commits into
Open
Conversation
Signed-off-by: BONGRAIN Mathilde <mathilde.bongrain@rte-france.com>
Signed-off-by: BONGRAIN Mathilde <mathilde.bongrain@rte-france.com>
Signed-off-by: BONGRAIN Mathilde <mathilde.bongrain@rte-france.com>
* Minor fixes on metrix-simulator sources * Sirius and ortools are now pulled from github releases * Up ortools release * Fix extractBasisStatus * Throw ErrorI extractBasisStatus default * Do not specify EN_BASE_BORNE_INF/SUP in extractBasisStatus * Fix MPVariable bounds * Fix VARIABLE_FIXE MPVariable bounds for LP resolutions * Add xpress / cbc tnrs * Add pcsolverchoice * Add specificsolverparams * Add CI with sirius / xpress / cbc tnrs * Disable some xpress tests * Fix ignored tests Co-authored-by: Ulysse Prieto <uprieto@localsolver.com> Signed-off-by: bongrainmat <63796216+bongrainmat@users.noreply.github.com>
Signed-off-by: arnaud <arnaud.rohmer@rte-france.com>
Signed-off-by: arnaud <arnaud.rohmer@rte-france.com>
Signed-off-by: arnaud <arnaud.rohmer@rte-france.com>
Signed-off-by: arnaud <arnaud.rohmer@rte-france.com>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
…te::Solver, instrument MIP solves Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
… with Sirius semantics Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
…OLVERPARAMS Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
6 tasks
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
…vailable Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
… flags Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
…gration Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
Signed-off-by: lamoletoscar <lamoletoscar@proton.me>
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No.
What kind of change does this PR introduce?
Feature — integrates the OR-Tools abstraction layer and the Xpress backend into
metrix-simulator, alongside the existing Sirius solver. Also includes related build changes, refactors and bug fixes.Replaces #286. The previous branch was based on the legacy
temporary_ortoolswork; this one is rebased on currentmainand reorganized into a clean commit chain.What is the current behavior?
metrix-simulatorsolves LP/MIP problems exclusively through a direct call path to Sirius. No way to use other solvers (CBC, SCIP, GLOP, GUROBI, CPLEX, XPRESS) without modifying the source code.What is the new behavior (if this is a feature change)?
ISolverabstraction with two implementations:compute::Solver(the existing direct Sirius path, untouched) andortools::Solver(a new wrapper overMPSolver).fort.json:SOLVERCH: solver used for the main optimization (MIP/LP).PCSOLVERCH: solver used for the initial economic stacking phase.Both default to
SIRIUS(value5), which preserves the legacy behavior bit-for-bit. Other accepted values: GLPK, CBC, SCIP_GLOP, GUROBI, CPLEX, XPRESS.SPECIFICSOLVERPARAMSstring key passes solver-specific options through to the backend.ERRSolveurIndisponible, FR/EN dictionary entry) instead of an OR-ToolsLOG(FATAL)abort. The availability check is memoized, as it involves a license probe for Xpress.VARIABLE_FIXEvariables being valued atXon both the LP and MIP paths (matching Sirius behavior inspx_construire_probleme.candpne_init_pne.c).USE_ORTOOLS) and Sirius are now built from source viaExternalProject_Add. New CMake options:USE_ORTOOLS(off by default) andUSE_XPRESS(off by default; must reflect whether OR-Tools was built with the Xpress backend, which is itself enabled by settingXPRESS_ROOTwhen buildingexternal/), plusUSE_SIRIUS_SHARED. Xpress is consumed transitively throughortools::ortools— no direct link frommetrix-simulator.time_limitunit, error throwing, accumulator reset), and theINFOIncident/INFOParadelog-message separator moved from the dictionary into the code, so that dictionary whitespace is never significant.README.mdand in the Sphinx documentation (docs/simulator/build.mdfor the CMake options,docs/simulator/io_doc.mdfor the newfort.jsonkeys).Does this PR introduce a breaking change or deprecate an API?
The default build (
USE_ORTOOLS=OFF) is strictly equivalent to the previous behavior. The default values ofSOLVERCH/PCSOLVERCHareSIRIUS, so existing input files keep producing identical results.Other information:
Xpress test policy. The full Xpress TNR suite (110 tests, with reference files under
tests/xpress_reference) is included in the repository but disabled by default: Xpress is a licensed solver and cannot run in the public CI. License holders can enable it locally with-D METRIX_RUN_XPRESS_TESTS=ON(in addition toUSE_XPRESS=ON, seeREADME.md). The full suite has been run this way on a licensed installation and passes, including the marginal-variation tests. CBC tests were removed since Xpress is the only target backend of this integration.Solver-equivalent solutions. When using Xpress, the final simplex re-solve for marginal variations (
metrix2assess.cpp) yields a different — but equally valid — optimal basis than Sirius: Xpress's presolve eliminates fixed columns (integer variables afterfixerVariablesEntieres()) and degenerate curative variables, restoring them as non-basic at postsolve, while Sirius keeps them in its terminal basis. This only changes diagnostic log lines ("variation marginale sur …") and has no impact on results: duals and the R4/R4B/R7 outputs are identical (verified on the marginal-variations test set). On degenerate instances, alternative optimal solutions may still produce minor attribution differences between solvers in R2/R2B/R3B/R10 (equivalent-cost groups or remedial actions), which is inherent to comparing two LP/MIP engines.Note on
variantes_regroupees_complexereference files. This test is declaredmetrix_test_no_check(random/equivalent solutions), so its reference files are never compared. They were regenerated on this branch and are now consistent with the actual code output (e.g. theR2Bheader), whereas the copies onmainare stale — which explains the few remaining differences withmainundertests/sirius_reference.