diff --git a/config.default.yaml b/config.default.yaml index f01474b2..9e98ea01 100755 --- a/config.default.yaml +++ b/config.default.yaml @@ -281,33 +281,86 @@ clustering: efficiency: mean solving: + #tmpdir: "path/to/tmp" options: formulation: kirchhoff + clip_p_max_pu: 1.e-2 load_shedding: false noisy_costs: true - min_iterations: 4 - max_iterations: 6 - clip_p_max_pu: 0.01 skip_iterations: true track_iterations: false - #nhours: 10 + min_iterations: 4 + max_iterations: 6 + keep_shadowprices: + - Bus + - Line + - Link + - Transformer + - GlobalConstraint + - Generator + - Store + - StorageUnit + solver: name: gurobi - threads: 4 - method: 2 # barrier - crossover: 0 - BarConvTol: 1.e-5 - FeasibilityTol: 1.e-6 - AggFill: 0 - PreDual: 0 - GURO_PAR_BARDENSETHRESH: 200 - # solver: - # 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 + options: gurobi-default + + solver_options: + highs-default: + # refer to https://ergo-code.github.io/HiGHS/options/definitions.html#solver + threads: 4 + solver: "ipm" + run_crossover: "off" + small_matrix_value: 1e-6 + large_matrix_value: 1e9 + primal_feasibility_tolerance: 1e-5 + dual_feasibility_tolerance: 1e-5 + ipm_optimality_tolerance: 1e-4 + parallel: "on" + random_seed: 123 + gurobi-default: + threads: 4 + method: 2 # barrier + crossover: 0 + BarConvTol: 1.e-6 + Seed: 123 + AggFill: 0 + PreDual: 0 + GURO_PAR_BARDENSETHRESH: 200 + 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 + + mem: 30000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2 + plotting: map: diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 4804a23c..75e1c601 100755 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -373,8 +373,9 @@ def extra_functionality(n, snapshots): def solve_network(n, config, opts="", **kwargs): - solver_options = config["solving"]["solver"].copy() - solver_name = solver_options.pop("name") + set_of_options = config['solving']['solver']['options'] + solver_options = config['solving']["solver_options"][set_of_options] if set_of_options else {} + solver_name = config['solving']['solver']['name'] cf_solving = config["solving"]["options"] track_iterations = cf_solving.get("track_iterations", False) min_iterations = cf_solving.get("min_iterations", 4) @@ -411,7 +412,7 @@ if __name__ == "__main__": from _helpers import mock_snakemake snakemake = mock_snakemake( - "solve_network", simpl="", clusters="5", ll="copt", opts="Co2L-BAU-CCL-24H" + "solve_network", simpl="", clusters="5", ll="v1.5", opts="" ) configure_logging(snakemake) @@ -419,7 +420,7 @@ if __name__ == "__main__": if tmpdir is not None: Path(tmpdir).mkdir(parents=True, exist_ok=True) opts = snakemake.wildcards.opts.split("-") - solve_opts = snakemake.config["solving"]["options"] + solve_opts = snakemake.config['solving']['options'] fn = getattr(snakemake.log, "memory", None) with memory_logger(filename=fn, interval=30.0) as mem: