Snakefile: use standard resource mem_mb rather than mem

This commit is contained in:
Fabian Neumann 2022-01-27 21:04:50 +01:00
parent 2bfccebc83
commit 090b4908a4
2 changed files with 19 additions and 17 deletions

View File

@ -45,7 +45,7 @@ if config['enable'].get('prepare_links_p_nom', False):
output: 'data/links_p_nom.csv'
log: 'logs/prepare_links_p_nom.log'
threads: 1
resources: mem=500
resources: mem_mb=500
script: 'scripts/prepare_links_p_nom.py'
@ -87,7 +87,7 @@ rule build_powerplants:
output: "resources/powerplants.csv"
log: "logs/build_powerplants.log"
threads: 1
resources: mem=500
resources: mem_mb=500
script: "scripts/build_powerplants.py"
@ -108,7 +108,7 @@ rule base_network:
log: "logs/base_network.log"
benchmark: "benchmarks/base_network"
threads: 1
resources: mem=500
resources: mem_mb=500
script: "scripts/base_network.py"
@ -128,7 +128,7 @@ rule build_shapes:
nuts3_shapes='resources/nuts3_shapes.geojson'
log: "logs/build_shapes.log"
threads: 1
resources: mem=500
resources: mem_mb=500
script: "scripts/build_shapes.py"
@ -142,7 +142,7 @@ rule build_bus_regions:
regions_offshore="resources/regions_offshore.geojson"
log: "logs/build_bus_regions.log"
threads: 1
resources: mem=1000
resources: mem_mb=1000
script: "scripts/build_bus_regions.py"
if config['enable'].get('build_cutout', False):
@ -154,7 +154,7 @@ if config['enable'].get('build_cutout', False):
log: "logs/build_cutout/{cutout}.log"
benchmark: "benchmarks/build_cutout_{cutout}"
threads: ATLITE_NPROCESSES
resources: mem=ATLITE_NPROCESSES * 1000
resources: mem_mb=ATLITE_NPROCESSES * 1000
script: "scripts/build_cutout.py"
@ -200,7 +200,7 @@ rule build_renewable_profiles:
log: "logs/build_renewable_profile_{technology}.log"
benchmark: "benchmarks/build_renewable_profiles_{technology}"
threads: ATLITE_NPROCESSES
resources: mem=ATLITE_NPROCESSES * 5000
resources: mem_mb=ATLITE_NPROCESSES * 5000
script: "scripts/build_renewable_profiles.py"
@ -212,7 +212,7 @@ if 'hydro' in config['renewable'].keys():
cutout="cutouts/" + config["renewable"]['hydro']['cutout'] + ".nc"
output: 'resources/profile_hydro.nc'
log: "logs/build_hydro_profile.log"
resources: mem=5000
resources: mem_mb=5000
script: 'scripts/build_hydro_profile.py'
@ -232,7 +232,7 @@ rule add_electricity:
log: "logs/add_electricity.log"
benchmark: "benchmarks/add_electricity"
threads: 1
resources: mem=5000
resources: mem_mb=5000
script: "scripts/add_electricity.py"
@ -251,7 +251,7 @@ rule simplify_network:
log: "logs/simplify_network/elec_s{simpl}.log"
benchmark: "benchmarks/simplify_network/elec_s{simpl}"
threads: 1
resources: mem=4000
resources: mem_mb=4000
script: "scripts/simplify_network.py"
@ -273,7 +273,7 @@ rule cluster_network:
log: "logs/cluster_network/elec_s{simpl}_{clusters}.log"
benchmark: "benchmarks/cluster_network/elec_s{simpl}_{clusters}"
threads: 1
resources: mem=6000
resources: mem_mb=6000
script: "scripts/cluster_network.py"
@ -285,7 +285,7 @@ rule add_extra_components:
log: "logs/add_extra_components/elec_s{simpl}_{clusters}.log"
benchmark: "benchmarks/add_extra_components/elec_s{simpl}_{clusters}_ec"
threads: 1
resources: mem=3000
resources: mem_mb=3000
script: "scripts/add_extra_components.py"
@ -295,7 +295,7 @@ rule prepare_network:
log: "logs/prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.log"
benchmark: "benchmarks/prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
threads: 1
resources: mem=4000
resources: mem_mb=4000
script: "scripts/prepare_network.py"
@ -326,8 +326,8 @@ rule solve_network:
memory="logs/solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_memory.log"
benchmark: "benchmarks/solve_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
threads: 4
resources: mem=memory
shadow: "shallow"
resources: mem_mb=memory
shadow: "minimal"
script: "scripts/solve_network.py"
@ -342,8 +342,8 @@ rule solve_operations_network:
memory="logs/solve_operations_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_op_memory.log"
benchmark: "benchmarks/solve_operations_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}"
threads: 4
resources: mem=(lambda w: 5000 + 372 * int(w.clusters))
shadow: "shallow"
resources: mem_mb=(lambda w: 5000 + 372 * int(w.clusters))
shadow: "minimal"
script: "scripts/solve_operations_network.py"

View File

@ -22,6 +22,8 @@ Upcoming Release
correction factor for solar PV capacity factors by default while satellite data is used.
A correction factor of 0.854337 is recommended if reanalysis data like ERA5 is used.
* Resource definitions for memory usage now follow [Snakemake standard resource definition](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#standard-resources) ```mem_mb`` rather than ``mem``.
PyPSA-Eur 0.4.0 (22th September 2021)
=====================================