correctly read number of solver threads in rule definition
This commit is contained in:
parent
2183e742b2
commit
d3cf329456
@ -46,6 +46,8 @@ Upcoming Release
|
|||||||
existing heating to urban/rural, residential/services and spatially more
|
existing heating to urban/rural, residential/services and spatially more
|
||||||
transparent.
|
transparent.
|
||||||
|
|
||||||
|
* Bugfix: Correctly read out number of solver threads from configuration file.
|
||||||
|
|
||||||
|
|
||||||
PyPSA-Eur 0.9.0 (5th January 2024)
|
PyPSA-Eur 0.9.0 (5th January 2024)
|
||||||
==================================
|
==================================
|
||||||
|
@ -13,6 +13,13 @@ for path in helper_source_path:
|
|||||||
from _helpers import validate_checksum
|
from _helpers import validate_checksum
|
||||||
|
|
||||||
|
|
||||||
|
def solver_threads(w):
|
||||||
|
solver_options = config["solving"]["solver_options"]
|
||||||
|
option_set = config["solving"]["solver"]["options"]
|
||||||
|
threads = solver_options[option_set].get("threads", 4)
|
||||||
|
return threads
|
||||||
|
|
||||||
|
|
||||||
def memory(w):
|
def memory(w):
|
||||||
factor = 3.0
|
factor = 3.0
|
||||||
for o in w.opts.split("-"):
|
for o in w.opts.split("-"):
|
||||||
|
@ -25,7 +25,7 @@ rule solve_network:
|
|||||||
+ "solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_python.log",
|
+ "solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_python.log",
|
||||||
benchmark:
|
benchmark:
|
||||||
BENCHMARKS + "solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
|
BENCHMARKS + "solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
|
||||||
threads: 4
|
threads: solver_threads
|
||||||
resources:
|
resources:
|
||||||
mem_mb=memory,
|
mem_mb=memory,
|
||||||
walltime=config["solving"].get("walltime", "12:00:00"),
|
walltime=config["solving"].get("walltime", "12:00:00"),
|
||||||
|
@ -137,7 +137,7 @@ rule solve_sector_network_myopic:
|
|||||||
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_solver.log",
|
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_solver.log",
|
||||||
python=LOGS
|
python=LOGS
|
||||||
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
+ "elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
||||||
threads: 4
|
threads: solver_threads
|
||||||
resources:
|
resources:
|
||||||
mem_mb=config["solving"]["mem"],
|
mem_mb=config["solving"]["mem"],
|
||||||
walltime=config["solving"].get("walltime", "12:00:00"),
|
walltime=config["solving"].get("walltime", "12:00:00"),
|
||||||
|
@ -28,10 +28,7 @@ rule solve_sector_network:
|
|||||||
+ "logs/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_memory.log",
|
+ "logs/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_memory.log",
|
||||||
python=RESULTS
|
python=RESULTS
|
||||||
+ "logs/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
+ "logs/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
||||||
threads:
|
threads: solver_threads
|
||||||
config["solving"]["solver_options"][
|
|
||||||
config["solving"]["solver"]["options"]
|
|
||||||
].get("threads", 4)
|
|
||||||
resources:
|
resources:
|
||||||
mem_mb=config["solving"]["mem"],
|
mem_mb=config["solving"]["mem"],
|
||||||
walltime=config["solving"].get("walltime", "12:00:00"),
|
walltime=config["solving"].get("walltime", "12:00:00"),
|
||||||
|
@ -127,7 +127,7 @@ rule solve_sector_network_perfect:
|
|||||||
output:
|
output:
|
||||||
RESULTS
|
RESULTS
|
||||||
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years.nc",
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years.nc",
|
||||||
threads: 4
|
threads: solver_threads
|
||||||
resources:
|
resources:
|
||||||
mem_mb=config["solving"]["mem"],
|
mem_mb=config["solving"]["mem"],
|
||||||
shadow:
|
shadow:
|
||||||
|
Loading…
Reference in New Issue
Block a user