Why Gadi
Researchers run CABLE on NCI's Gadi through benchcab, ACCESS-NRI's benchmarking tool. So the analysis had to run there too, right after the model run, with results landing on modelevaluation.org. That needed a package Gadi users can load, a way for HPC jobs to move inputs and results, and evidence for what resources to request.
r-meorg: packaging someone else's science
palsR is Gab Abramowitz's R package, and it holds the science. When I started on it, it had no release process, its worker counts were hard-coded, and its name clashed with an existing CRAN package.
I built the release chain:
- A tag produces a GitLab release and a conda package called
r-meorg, published to the me-org Anaconda channel. - ACCESS-NRI builds that into a module on Gadi through their containerised-environments repo. I wrote the pull requests there: #75 shipped 1.0.5 (merged 16 Sep 2026), and #104 moved it to 1.0.7.
- On Gadi, a user runs
module load r-meorgand then the runner.
I cut the releases from 1.0.2 to 1.0.7. Release 1.0.5 went in as five sequenced changes:
- a test foundation (testthat and R CMD check in CI);
- a versioned analysis config with a strict validator;
- worker counts resolved at runtime: from the config, then the PBS allocation, then local cores;
- a default runner that writes every run's effective config as a JSON file;
- a bounded scheduler for multisite plots.
The design choice I'd defend: config is split into analysis and runtime, and nothing in runtime can change the science. You can give a run more workers without wondering whether you changed its results.
Before calling 1.0.5 done, I ran the nine legacy CI fixtures on Gadi with the new module, and checked by hash that the new package route reproduced the legacy outputs. The runner became a one-file contract: input.json in; output.json, run.json and an output directory out; the exit code is the status. It's 84 lines, replacing a 339-line collector. The first benchcab analysis through it took 19 s and 0.13 SU.
Getting data in and out
Three REST endpoints let a job outside our own worker take part in the platform:
- Dataset manifest. It returns an experiment's dataset files as presigned S3 URLs, with dataset versions resolved at request time.
- Analysis input. It returns the exact payload our worker would get, built by the same function, so an external run analyses identical files. If an input hasn't reached the object store yet, it returns a 409.
- Analysis result. A multipart submission creates the analysis record already finished. It's keyed on model output, experiment, runner and run ID, so a retry is harmless and the first final state wins. Artifacts upload before the record is written, so a submission that dies halfway leaves nothing behind. Large results go up in batches, and an hourly job clears abandoned staging.
Every endpoint needs a login and reaches only what the user's workspaces can access; anything else gets the same generic 404. Presigned URLs are bearer credentials, so responses are no-store and the URLs expire after an hour. I also added a resumable, parallel downloader to the platform's Python client.
The result path has been tested end to end with a real Gadi PBS job. Gadi is the first environment, but the APIs serve runs from any external environment, and there are plans to onboard HPC systems in Europe and the US.
How many workers?
Nobody knew what CPU and memory a large analysis needed, so I measured it on a 42-site case: 930 files, 23.1 GB of input, and 1,440 input roles once three benchmarks are added. Each arm was a separate PBS job on 12 CPUs, logged with its job ID and timed per phase from markers in the analysis log.
| Case | Plot workers | Analysis time | Service units |
|---|---|---|---|
| No benchmarks | 2 | 667 s | 9.21 |
| No benchmarks | 8 | 341 s | 4.77 |
| Three benchmarks | 4 | 723 s | 13.21 |
| Three benchmarks | 12 | 511 s | 9.48 |
Going from 2 to 8 plot workers cut analysis time by 48.9% and service units by 48.2%. With benchmarks, going from 4 to 12 cut them by 29% and 28%.
Total CPU time barely moved, and neither did the load phase. All of the gain was in single-site plotting, which got 2.7× faster in the first case and 2× in the second: the extra workers were parallelising a fixed amount of work.
Same answers. For each run I hashed the output metadata, with filenames stripped and the JSON sorted. The hash was identical across every arm of each case, so the worker count changed the time, not the results.
Noise. The arms ran concurrently on different nodes. A repeat of the 8-worker arm the next day was 3.7% slower, which is roughly the batch-to-batch noise and well inside the gains.
Past 12 CPUs. Forty-eight workers on 48 CPUs gave the fastest run (402 s), but at 11.44 SU, 31% more than 24 workers on 24 CPUs. Two identical 48-worker runs differed by 80 s, and 96% of that gap was in startup and observation loading, while their parallel phases agreed to within 3 s. So I compare phase timings, not totals.
The sweep also turned up four things to fix:
- Hashing. A full SHA-256 check of the 23 GB input took about 13 minutes, 55% of the job. The rule now is to verify inputs once when they're staged, not on every run.
- Scheduling. Static chunking in
parLapplyput two of the three long fingerprint plots on one worker. Dispatching the long plots first and load-balancing the short ones cut that phase by 13%. - A latent bug. Some multisite plot functions read a variable that exists in a normal R session but not on a fresh PSOCK worker. I guarded it to fail closed, then fixed it upstream in 1.0.5.
- Memory. Gadi charges for requested memory as well as CPUs (about 24, 32 and 48 SU an hour at 48, 64 and 96 GB on 12 CPUs), so over-asking costs money. The candidate default is 12 CPUs and 48 GB, with 96 GB or more for a 42-site run with benchmarks.
In the package, load and plot workers now follow the PBS allocation by default, and 1.0.12 lowered the automatic counts outside PBS to cut memory use.
Runtime metadata
Sweeps are one-off experiments. To size jobs from real usage, I added run metrics to the platform worker:
- Memory, sampled every 2 s and summed across every process carrying the job's marker. PSOCK workers detach from R, and walking R's own children saw only 208 of about 1,290 MiB.
- Out-of-memory kills, from the cgroup counter before and after R. An OOM-killed worker makes R exit with code 1 and no signal, so the exit code alone can't show it.
- Context: the memory limit, the pals and R versions, the download, R and upload times, and the exit status.
Every telemetry call has a deadline and falls back to null with a reason, so it can't change an analysis's outcome. The metrics are stored on the analysis record and hidden from clients. With each run's effective config, they build into a clean dataset of real runs for sizing future jobs.