OS-Agnostic: This program is OS agnostic. For larger runs (e.g., full national runs), the user should pursue access to the High Performance Computing (HPC) environment. Use of the HPC is optional, but directions for its use are integrated into the following instructions.
- AWS Account and Allocation – Please reach out to the Stratus Cloud team (Stratus Cloud: Home) to acquire them (you may need to refresh the page to load it).
- AWS ResStock/ComStock Sandbox Access (likely
resbldg) – Please contact Buildings (ResStock/ComStock) teams for access. - HPC (optional) – Please reach out to the HPC team for an account and allocation.
- Follow the AWS CLI installation instructions.
- For example, on HPC:
We then add $HOME/local/bin to $PATH so we can use "aws ..."
cd ~ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip ./aws/install -i "$HOME/local/aws-cli" -b "$HOME/local/bin"Although unrelated to AWS, add this flag on HPC to trigger HPC-specific logic when running (only do this on HPC!)echo 'export PATH="$HOME/local/bin:$PATH"' >> ~/.bashrcFinally, reload .bashrc:echo 'export REEDS_USE_SLURM=1' >> ~/.bashrcAnd we confirm AWS installation and $PATH changes by seeing a version output from:source ~/.bashrcaws --version
- For example, on HPC:
- Follow AWS SSO configuration instructions, all the way through step 8! Note that after step 5 a browser should automatically open. We had luck using remote SSH from vscode, and didn't have luck with git bash or direct terminal sshing into kestrel.
# Via HTTPS
git clone https://github.com/NatLabRockies/buildstock-weatherreg.git
# Via SSH (requires SSH key setup)
git clone git@github.com:NatLabRockies/buildstock-weatherreg.gitgeotheraml_env_kestrel.yml was created on and intended to be installed on Kestrel, while geothermal_env.yml was created on Windows and likely is more appropriate for Windows machines.
On Kestrel:
cd buildstock-weatherreg
conda env create -f geothermal_env_kestrel.yml
conda activate geothermalThis step can take ~30 minutes.
Then, copy the ComStock schema:
python -c "import site; print(site.getsitepackages())"Locate comstock_oedi.toml in the current directory and copy it to:
<site-packages-dir>/buildstock_query/db_schema/
conda activate geothermal
aws sso login- Edit
switches_agg.jsonto match your desired settings.- Ensure that
"workgroup"matches your Stratus Cloud Handle / AWS Sandbox Workgroup.
- Ensure that
- Edit
#SBATCHsettings at the top ofC_run_bldg_chunk_agg.shas needed.
python B_building_stock_parallel_agg.pyBy default, switches_agg.json runs a regression of ResStock Baseline (Upgrade=0) HVAC end use load profiles (EULP), regressed from 2018 to 2007-2024. Also by default, it runs in testmode, a run of Vermont only (see 'VT' in B_building_stock_parallel_agg.py). For full runs:
- Set these switches in
switches_agg.json:"testmode": false. This deactivates the Vermont-only test run and runs full national."upgrades": [0,4](or any list of upgrades/measures to run). Upgrade 0 is Baseline. Note that for ComStock runs we typically only run one upgrade at a time on HPC."target_year": ["2007-2013","2016-2023"](or any integer or list of either integers or strings with ranges, as shown). These are the years for which regressed EULP data is output.- Change any other switches as shown in the subsections below. In the subsections below we discuss using ComStock rather than ResStock, and running the tool without regressions to simply extract existing ResStock/ComStock data.
- Edit
#SBATCHsettings at the top ofA_start_building_stock_parallel_agg.shand run withsbatch A_start_building_stock_parallel_agg.sh. For national runs, it's best to launchA_start_building_stock_parallel_agg.shinstead ofB_building_stock_parallel_agg.pyso that the job can be queued and fully run on compute nodes.
ResStock is used by default. For ComStock regressions, set these switches in switches_agg.json:
"comstock": true,"base_run": "comstock_2025_2""chunk_size": 10. This indicates that 10 counties should be chunked together. We use 10 instead of the default 150 because ComStock requires significantly more resources to regress, as all combinations of county and simulatated county are regressed separately. ResStock, on the other hand, does not have separate simulated counties.
To simply pull existing ComStock or ResStock results, rather than running any regressions, set these switches in switches_agg.json:
"apply_regression": false"target_year"must be set equal to"base_year".- Set
"chunk_size"to500for ResStock and50for ComStock. - For ComStock, also set
"comstock": true,and"base_run": "comstock_2025_2"as shown above.
Outputs will be dropped into a new timestamped folder in the outputs subdirectory of this repo. There will be an hourly "eulp_hvac_elec_MWh" csv and an annual "meta" csv for each parallelized chunk of counties that are run. To combine the chunked outputs into one eulp file, edit the #Inputs section at the top of agg_buildings.py and run it. The resulting file will be dropped into the same outputs sub-directory.
We had issues with AWS SSO configuration on Yampa. One solution is to perform authentication on your local machine (required for each login):
- Sign in on your local machine using
aws sso login. - Replace the SSO token cache directory (~/.aws/sso/cache) on Yampa with the one on local.
See regression validation outputs for resstock and comstock HVAC EULP here: https://drive.google.com/file/d/1qDy9DrraTP7Kkzk1i6_tDVStEf3fzrQn/view?usp=sharing