Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Running on HPC

Large runs are designed for a single many-core cluster node: one worker process per core, with jobs spread across them. A job is one history file in fixed mode, and one day (or one sub-daily history file) in orbit mode.

Setting up the environment (Alliance Canada)

On Alliance Canada clusters (Fir, Rorqual, Narval), with micromamba installed in ~/bin:

git clone https://github.com/torimcd/cesm-hawc
cd cesm-hawc
bash scripts/setup/create_env.sh

This creates the hawc_env environment, installs cesm-hawc with the [sim] extra, and checks that sasktran2, hawcsimulator and cesm_hawc import. It takes 5–10 minutes the first time.

SLURM job script

scripts/submit.sh runs cesm-hawc run --mode orbit on one node. Before using it, set --account to your allocation, and create a logs/ directory in the repository root; SLURM writes the job’s output there and fails without it.

mkdir -p logs
sbatch scripts/submit.sh                          # config.toml, configured case
sbatch scripts/submit.sh config.toml case_a       # a different case
sbatch scripts/submit.sh config.toml case_a strip-ozone

The arguments are, in order: the config file (default config.toml), a case name passed to --case-name, and the literal word strip-ozone to add --strip-ozone. Queuing one job per case name lets a single config drive several cases.

The script asks for 32 cores with 12 GB each for 60 hours, and sets the worker count to the number of cores, overriding n_workers in the config. Change the resources at submit time rather than editing the script. For example, a test over a single day of daily output runs as one job on one worker (see Runtime and resources), so a few cores are enough:

sbatch --cpus-per-task=8 --time=12:00:00 scripts/submit.sh

For --mode fixed, copy the script and change --mode orbit to --mode fixed. A handful of files usually needs only one core and well under an hour.

Practical notes

Runtime and resources

One day of orbit observations with the L2 retrieval at 6 wavelengths (1,440 observations sampled at one-minute spacing, about half of them in daylight and retrieved) took ~9.6 hours on one worker:

MeasureValue
Wall time per retrieved profileabout 48 s
CPU time per retrieved profileabout 3.7 core-minutes
Average cores in use by the workerabout 4.5
Peak memory of the workerabout 10 GB

Runtime grows with the number of wavelengths.

When planning a job, keep in mind: