Skip to content

Commit ff78022

Browse files
Add Xpress solver configuration support (#2006)
1 parent 630d37d commit ff78022

4 files changed

Lines changed: 53 additions & 0 deletions

File tree

config/config.default.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,18 @@ solving:
12371237
GPUMode: 1
12381238
PDLPTol: 1.0e-05
12391239
Crossover: 0
1240+
"xpress-default":
1241+
threads: 8
1242+
lpflags: 4
1243+
crossover: 0
1244+
bargaptarget: 1.0e-05
1245+
baralg: 2
1246+
"xpress-gpu":
1247+
lpflags: 4
1248+
crossover: 0
1249+
baralg: 4
1250+
barhggpu: 1
1251+
barhgreltol: 1.0e-05
12401252
"cbc-default": {}
12411253
"glpk-default": {}
12421254
check_objective:

doc/installation.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Nevertheless, you can still use open-source solvers for smaller problems.
111111
The rules :mod:`cluster_network` solves a mixed-integer quadratic optimisation problem for clustering.
112112
The open-source solvers HiGHS, Cbc and GlPK cannot handle this. A fallback to SCIP is implemented in this case, which is included in the standard environment specifications.
113113
For an open-source solver setup install for example HiGHS **and** SCIP in your ``conda`` environment on OSX/Linux.
114+
114115
To install the default solver Gurobi, run
115116

116117
.. code:: console
@@ -119,3 +120,27 @@ Nevertheless, you can still use open-source solvers for smaller problems.
119120
$ conda install -c gurobi gurobi"=12.0.1"
120121
121122
Additionally, you need to setup your `Gurobi license <https://www.gurobi.com/solutions/licensing/>`__.
123+
124+
To use Xpress, install the ``xpress`` Python package and ensure you have:
125+
126+
- ``XPRESSDIR`` environment variable pointing to your Xpress installation
127+
- ``XPAUTH_PATH`` environment variable pointing to your license directory
128+
- A valid Xpress license file
129+
130+
Then configure the solver in your config file:
131+
132+
.. code:: yaml
133+
134+
solving:
135+
solver:
136+
name: xpress
137+
options: xpress-default
138+
139+
For GPU-accelerated solving, use:
140+
141+
.. code:: yaml
142+
143+
solving:
144+
solver:
145+
name: xpress
146+
options: xpress-gpu

doc/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Release Notes
99
Upcoming Release
1010
================
1111

12+
* Added Xpress solver configuration options (``xpress-default`` and ``xpress-gpu``) with barrier method settings optimized for large-scale linear programming problems.
13+
1214
* Added missing bidding zone data sources to data layer (https://github.com/PyPSA/pypsa-eur/pull/1991).
1315

1416
* Fix virtual bus naming when building the transmission network from raw OSM data to use persistent names (https://github.com/PyPSA/pypsa-eur/pull/1956).

scripts/lib/validation/config/solving.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,20 @@ class SolvingConfig(BaseModel):
313313
"PDLPTol": 1e-5,
314314
"Crossover": 0,
315315
},
316+
"xpress-default": {
317+
"threads": 8,
318+
"lpflags": 4,
319+
"crossover": 0,
320+
"bargaptarget": 1e-5,
321+
"baralg": 2,
322+
},
323+
"xpress-gpu": {
324+
"lpflags": 4,
325+
"crossover": 0,
326+
"baralg": 4,
327+
"barhggpu": 1,
328+
"barhgreltol": 1e-5,
329+
},
316330
"cbc-default": {},
317331
"glpk-default": {},
318332
},

0 commit comments

Comments
 (0)