config: modularize solver_options

This commit is contained in:
Fabian 2022-11-18 11:22:06 +01:00
parent 6d3959f364
commit faa95c500c
5 changed files with 43 additions and 11 deletions

View File

@ -386,7 +386,10 @@ solving:
solver:
name: gurobi
options:
options: gurobi-default
solver_options:
gurobi-default:
threads: 4
method: 2 # barrier
crossover: 0
@ -395,14 +398,38 @@ solving:
AggFill: 0
PreDual: 0
GURO_PAR_BARDENSETHRESH: 200
#FeasibilityTol: 1.e-6
seed: 10 # Consistent seed for all plattforms
gurobi-numeric-focus:
name: gurobi
NumericFocus: 3 # Favour numeric stability over speed
method: 2 # barrier
crossover: 0 # do not use crossover
BarHomogeneous: 1 # Use homogeneous barrier if standard does not converge
BarConvTol: 1.e-5
FeasibilityTol: 1.e-4
OptimalityTol: 1.e-4
ObjScale: -0.5
threads: 8
Seed: 123
gurobi-fallback: # Use gurobi defaults
name: gurobi
crossover: 0
method: 2 # barrier
BarHomogeneous: 1 # Use homogeneous barrier if standard does not converge
BarConvTol: 1.e-5
FeasibilityTol: 1.e-5
OptimalityTol: 1.e-5
Seed: 123
threads: 8
cplex-default:
threads: 4
lpmethod: 4 # barrier
solutiontype: 2 # non basic solution, ie no crossover
barrier_convergetol: 1.e-5
feasopt_tolerance: 1.e-6
cbc-default: {} # Used in CI
#name: cplex
#threads: 4
#lpmethod: 4 # barrier
#solutiontype: 2 # non basic solution, ie no crossover
#barrier_convergetol: 1.e-5
#feasopt_tolerance: 1.e-6
mem: 30000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2

View File

@ -62,6 +62,10 @@ def plot_map(network, components=["links", "stores", "storage_units", "generator
for comp in components:
df_c = getattr(n, comp)
if df_c.empty:
continue
df_c["nice_group"] = df_c.carrier.map(rename_techs_tyndp)
attr = "e_nom_opt" if comp == "stores" else "p_nom_opt"

View File

@ -247,7 +247,8 @@ def extra_functionality(n, snapshots):
def solve_network(n, config, opts='', **kwargs):
solver_options = config['solving']['solver']['options']
options = config['solving']['solver']['options']
solver_options = config['solving']["solver_options"][options] if options else None
solver_name = config['solving']['solver']['name']
cf_solving = config['solving']['options']
track_iterations = cf_solving.get('track_iterations', False)

View File

@ -30,6 +30,6 @@ sector:
solving:
solver:
name: cbc
options: null
options: cbc-default
mem: 4000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2

View File

@ -29,6 +29,6 @@ sector:
solving:
solver:
name: cbc
options: null
options: cbc-default
mem: 4000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2