Execution#
Most users only need project.run(), project.submit(), or
stilt run (Running). The functions below do the
work underneath.
run()is whatproject.run()calls. It finds the releases with missing results, runs them, and waits until they finish.task=(i, n)runs shareiofnhere (task_share()), which is whatstilt run --task i/ndoes.submit()is whatproject.submit()calls. It writes a job array script (job_script()) whose tasks each runstilt run --task, submits it withsbatch, and returns the job id at once.run_particles()runs the transport model for oneSimulationand writes its particles and log.run_stages()runs the stages of the variants that share those particles, the footprint among them: each stage file that is missing, in the order the stages read one another, and each again when what it reads was made again.run_stage()runs one, which writes its own file.run_release()runs every variant of one release, skipping what exists. Variants that share particles run the transport model once and run their stages on the particles in memory. A failure is recorded with the simulation (stilt.Simulation.failure). Workers are always handed releases.run_releases()runs a list of releases, in this process or in a process pool.
On Slurm each task of the job array runs one share of the releases
(task_share()) with stilt run --task. A local
run happens in this process. A program that starts the tasks itself, on
another scheduler, writes pending() to the
releases.txt each task reads (stilt run --releases);
wait() waits for a
Slurm job array by its id.
Running#
Run every simulation of a project that has not finished, and wait for it. |
|
Submit every simulation of a project that has not finished to Slurm. |
|
Return the ids of the releases a run would run, each once, in project order. |
|
Wait until every task of a Slurm job array has ended, and return how each ended. |
|
Return task task's share of release_ids, split n_tasks ways. |
Workers#
Internal: importable from their modules, and free to change.
Return the compute root of project: the directory its workdirs are made in. |
|
Run the transport model for a simulation and write its particles to the output directory. |
|
Run one stage of a simulation, which writes its file to the output directory. |
|
Run the stages of the simulations of one release that share particles, and return what failed. |
|
Run every simulation of one release, and return what did not complete. |
|
Run a list of releases, in this process or in a process pool. |
Slurm job arrays#
Return the |
|
Return the |
Transport model#
The worker runs a simulation through the transport model its settings name.
HYSPLIT is the one built in that runs, and CONTRIBUTING describes how to add
another, named by its import path. PYSTILT’s stilt-r model
(class: stilt.migration.StiltRModel) is one of those, and runs nothing: its
variants read the runs stilt.migration.import_stilt_r() imported from
STILT-R, with the settings STILT-R’s files record.
A model fails a run that its meteorology does not cover, as
MET_COVERAGE. Particles that all leave the met’s domain before the end
of the run are a complete run.
A transport model that follows particles from a release. |
|
A transport model that runs many releases in one call, such as an emulator on a GPU. |
|
The base of every transport model's config. |
|
What one model run produced. |
|
Return the transport model name names. |
|
Run the transport model called name for one release, and finish its particles. |
|
Run a batched transport model once for many releases, and finish each one's particles. |
|
HYSPLIT as a transport model, the object |
|
The |
|
The settings of imported STILT-R runs: HYSPLIT's, as STILT-R ran it, and the STILT-R version. |
|
The met of imported STILT-R runs, as written under |
Stages#
A stage makes one file per release from a simulation’s results, after the
transport model runs. The footprint is one
(stilt.footprint.FootprintStage). A stages block of
config.yaml names its stage’s class by import path, so a stage in a
package of your own needs no registration, and CONTRIBUTING describes how to
write one. Use check_stage() in its tests.
What is made from each simulation's results: one file per release. |
|
Return the stage whose class is at the import path path, made with no arguments. |
|
Return the names of stages in the order they run: each after the stages it reads. |
|
Check that stage keeps the promises the worker and the output directory rely on, for one config. |