PyPSA / pypsa-usa

PyPSA-USA: An Open-Source Energy System Optimization Model for the United States
https://pypsa-usa.readthedocs.io
MIT License
60 stars 24 forks source link

Tune resource requirements for Sector Studies #480

Closed trevorb1 closed 3 days ago

trevorb1 commented 3 days ago

Checklist

The Issue

Running sector studies causes (in particular) the build_demand rule to be much heavier than the electrical counterpart. This often (at least on my computer) causes rules to fail with the error along the lines of:

/usr/bin/bash: line 1: 14318 Killed                  /home/trevor/miniforge3/envs/pypsa-usa/bin/python3.11 /home/trevor/master/pypsa-usa/workflow/.snakemake/scripts/tmp1zwbgps2.build_demand.py

This is just a resource allocation issue, and rerunning the workflow will eventually get past this.

Within the snakemake rules, the resources need to be updated to use the sector wildcard and determine appropriate resource limits.

Steps To Reproduce

  1. Turn on sector studies
  2. Run snakemake -j32 (or similar)

Expected Behavior

No response

Error Message

No response

Anything else?

No response

ktehranchi commented 3 days ago

I don't think the resource allocation (mem_mb / threads ) are actually used when you run it locally, snakemake only uses those for cluster runs. I think to deal with this you should run with -j1 --cores all to reduce the number of jobs running at once, and with all cores being used.

trevorb1 commented 3 days ago

Ahhh. Right, thank you. Forgot -j applies to clusters.