What is this?
This is a guide with examples on how to use the command line utility glurmo
. It is currently incomplete. While I am working to flesh it out, I think there is still enough here to be useful.
What is glurmo
?
glurmo
is a command line tool for setting up, running, and managing simulations via Slurm
.
Why glurmo?
In short, I have had to run quite a few simulations over the course of my PhD, and found that writing a simulation manager sped up the process quite a bit. But if you’d like a more detailed answer, see below.
Organization
Running a slurm job can produce quite a bit of output- an .out
file from slurm itself, an .Rout
file if you’re running an R script, a different file for errors (if you so choose), and, of course, the actual artifact of your simulation. glurmo
establishes a pre-determined structure for a simulation study, so all of these files are well organized and easy to find.
Reusability
This standardized structure is one example of the primary goal of glurmo
: more re-usability. Having standardized simulation directory structures makes it easy to write code to summarize simulation results that will work on any simulation with the same type of result. More importantly, glurmo
makes it easy to re-use and modify script templates and slurm templates with different settings by tweaking a few values.
DRY
Another primary goal of glurm
is to make your simulations DRY-er. By defining the script template, slurm template, and settings in three files that can produce an arbitrary number of simulations, changing a single value can change a setting across an entire simulation (or even set of simulations).
Why not job arrays?
glurmo
is more powerful than using job arrays, and having used both, there are a few reasons why I prefer glurmo
.
Readability
glurmo
uses a templating engine, so the resulting script and slurm templates are much more readable than if you rely on the index of a job array.
Ease of use
I am almost certainly biased here, but I find glurmo
easier to use than job arrays, particularly when it comes to cancelling jobs. With glurmo
, you can run a single command and cancel a certain number of jobs in specific states, without having to check job IDs. All you need to know is the base directory. You also don’t need to keep track of which simulations you have run in an array or not.
Power
glurmo
uses go templates to define slurm
submission scripts. This means that you can even set the resources requested by the simulation according to the settings themselves. So not only can you define an arbitrary number of simulations in a single slurm
script, you can even vary the resources requested arbitrarily in the same script!
Why is it called glurmo?
slurm
is a reference to Futurama, so I thought it was only fitting to make the name of glurmo a Futurama reference from the same episode.