galform_execution
Generate and submit GALFORM semi-analytic galaxy formation runs on N-body merger trees to SLURM on the COSMA HPC cluster.
galform_execution builds the job scripts for a GALFORM run, injects the
simulation (trees, cosmology, snapshots) and model parameters into GALFORM's
.input.ref files, and submits each snapshot as a single SLURM job that runs
every subvolume across the CPUs of one allocation. It is a Python library and
a command-line tool (submit-galform-job), with no runtime dependencies.
Features
- Bundled configurations for the Millennium, P-Millennium (L800), EAGLE,
COLIBRE, FLAMINGO, DOVE and nIFTy simulations and the standard GALFORM models
(
gp14,lc16, ...), plus your own simulations and models in the same JSON format. - Packed jobs: all subvolumes of a snapshot run in one SLURM slot, one worker
per CPU. Contiguous ranges (
1-1024) and explicit subsets (ivols=[5, 17, 900]) are both supported. - Fails loudly: if any subvolume exits non-zero, the whole job fails, so
sacctnever shows a run with dead subvolumes asCOMPLETED. Bad ranges, unknown snapshots and incomplete configs are rejected before anything is queued. - Pipeline control: switch GALFORM, NETA dust, luminosity functions, stellar mass functions and other stages on or off. Override any GALFORM input parameter, and output several redshifts from one run.
- Robust submission: transient scheduler errors are retried with exponential backoff.
- Typed (
py.typed) and tested on Python 3.9–3.14.
Installation
pip install galform_execution
# or
uv pip install galform_execution
You need a compiled GALFORM source tree (containing build/galform2,
*.input.ref, replace_variable.csh, ...) and, to submit, a SLURM login node.
Off-cluster you can still generate and inspect scripts with --dry-run.
Quick start: command line
# Preview the generated scripts without submitting anything
submit-galform-job /path/to/galform --nbody-sim Mill2 --model lc16 --iz 40 --nvol 1-64 --dry-run
# Submit; prints the SLURM job id of each snapshot
submit-galform-job /path/to/galform --nbody-sim Mill2 --model lc16 --iz 40 --nvol 1-64 \
--output-folder-name MyProject
# What is available?
submit-galform-job --list-simulations
submit-galform-job --list-models
Run submit-galform-job --help for all options (SLURM resources, output
locations, pipeline stages, --input-override NAME=VALUE, ...).
Quick start: Python
from galform_execution import GalformSubmitter, RunFlags
s = GalformSubmitter(
"/path/to/galform",
nbody_sim="Mill2",
model="lc16",
iz=40,
nvol="1-64",
output_folder_name="MyProject",
# Skip post-processing you do not need (each stage writes extra files)
run_flags=RunFlags(neta=False, lum_fun=False, study_stellar_mass_function=False),
input_overrides={"vhotdisk": "290"},
)
s.submit_all_jobs(dry_run=True) # print the scripts
job_ids = s.submit_all_jobs() # submit with sbatch
The examples/ notebooks cover simulations and models, pipeline stages,
parameter studies, multi-redshift outputs and galaxy trees.
Your own simulations and models
Pass a JSON file (or a directory of them) in the same format as the bundled
galform_execution/config/simulations/*.json and config/models.json:
submit-galform-job /path/to/galform --simulation-config my_sims.json --nbody-sim MySim --iz 100
or, from Python, GalformSubmitter(..., sim_config=SimulationConfig(...), model_config=ModelConfig(...)).
Defaults and paths
| What | Default | Override |
|---|---|---|
| GALFORM source tree | /cosma/apps/durham/$USER/galform |
positional galform_dir |
| Outputs | /cosma5/data/durham/$USER/<output-folder-name>/<sim>/<model>/iz<iz>/ivol<n> |
--output-base-dir, --output-folder-name |
| SLURM logs and generated scripts | <output-base-dir>/<output-folder-name>/logs |
--log-path or $GALFORM_LOG_PATH |
| Partition / account | cosma5 / durham |
--partition, --account |
Development
git clone https://github.com/OscarHickman/galform_execution.git
cd galform_execution
uv sync # creates .venv with the package and dev tools
uv run pytest --cov # tests (tcsh needed for the script-execution tests)
uv run ruff check galform_execution tests
uv run black --check galform_execution tests
uv run isort --check-only galform_execution tests
uv run mypy galform_execution
Releasing
- Update the version in
pyproject.toml,CITATION.cff(version,date-released) andconda/meta.yaml, and add aCHANGELOG.mdentry. The test suite checks that these agree. - Commit, then tag and push:
git tag v0.3.0 && git push origin main v0.3.0.
The Publish workflow checks that the tag matches the package version, runs
the full CI, publishes the tested distributions to PyPI (trusted publishing),
and creates the GitHub Release, which Zenodo archives under a new version DOI.
For conda-forge, put the sha256 of the PyPI sdist into conda/meta.yaml and
submit it to conda-forge/staged-recipes.
Citing
If you use galform_execution in your research, please cite it. The concept DOI
10.5281/zenodo.20797781 always
resolves to the latest version. GitHub's "Cite this repository" button
gives the metadata from CITATION.cff.
@software{hickman_galform_execution,
author = {Hickman, Oscar},
title = {galform\_execution},
url = {https://github.com/OscarHickman/galform_execution},
doi = {10.5281/zenodo.20797781},
license = {MIT}
}
License
MIT; see LICENSE.
Metadata
Release files for galform-execution 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| galform_execution-0.3.0.tar.gz | 54.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| galform_execution-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 91.2 kB
Release files / galform_execution-0.3.0.tar.gz
| Download URL | galform_execution-0.3.0.tar.gz |
|---|---|
| Size | 54.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef6500846e38099a263a404d64fd7d708df2081cbe06cc7837920fa259fda2e5
|
|
BLAKE2b-256 checksum How to use checksums |
a592e096ae3116bd69e5760960d02517c52c7b264a005f61c14d5835d45e2059
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logRelease files / galform_execution-0.3.0-py3-none-any.whl
| Download URL | galform_execution-0.3.0-py3-none-any.whl |
|---|---|
| Size | 36.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0647154711cceea4e6de65b8114d3c9e3d663c75876dd4375b8b8876e256788b
|
|
BLAKE2b-256 checksum How to use checksums |
b4e703da5c73945515fe9b27a32e20f312fc410d26a2088751a8d96e40125654
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency log