Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
technical:slurm:templates:start [2019-06-25 16:43] – frey | technical:slurm:templates:start [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Caviness Slurm Job Script Templates ====== | ||
- | On both Mills and Farber, example job scripts were made available under the ''/ | ||
- | |||
- | One major problem with this paradigm comes when changes must be made to templates. | ||
- | |||
- | On Caviness, the job script templates have been structured differently. | ||
- | |||
- | ===== Where Can I Find Them? ===== | ||
- | |||
- | IT staff are maintaining the Caviness templates via git. The production copy of the repository is checked-out in ''/ | ||
- | |||
- | The external script fragments (mentioned above and discussed in detail below) can be found in the ''/ | ||
- | |||
- | ===== Hierarchical Modularity ===== | ||
- | |||
- | Environment setup tasks have been abstracted into each external script fragment file. Examining the fragment directory: | ||
- | |||
- | < | ||
- | -rw-r--r-- 1 frey sysadmin 1733 Sep 12 2018 common.sh | ||
- | -rw-r--r-- 1 frey sysadmin 5621 May 6 14:11 gaussian.sh | ||
- | -rw-r--r-- 1 frey sysadmin 1580 Sep 12 2018 generic-mpi.sh | ||
- | -rw-r--r-- 1 frey sysadmin 1432 Sep 14 2018 mpich.sh | ||
- | -rw-r--r-- 1 frey sysadmin 4805 Sep 12 2018 openmpi.sh | ||
- | -rw-r--r-- 1 frey sysadmin 2209 May 6 14:11 openmp.sh | ||
- | </ | ||
- | |||
- | ==== common.sh ==== | ||
- | |||
- | The '' | ||
- | |||
- | * Setting '' | ||
- | * Setting signal handlers to react to signals delivered by Slurm on preemption and runtime limit (timeout) | ||
- | * Adding the '' | ||
- | |||
- | ==== UD_EXEC and signal handling ==== | ||
- | |||
- | The '' | ||
- | |||
- | < | ||
- | : | ||
- | cleanup() { | ||
- | echo "Time limit exceeded, scrubbing all junk files now" | ||
- | exit 0 | ||
- | } | ||
- | UD_JOB_EXIT_FN=cleanup | ||
- | . / | ||
- | |||
- | sleep 500000000 | ||
- | </ | ||
- | |||
- | When this job is preempted, the '' | ||
- | |||
- | In order to get signals to work asynchronously in the Bash shell, long-running commands must be run in the background. | ||
- | |||
- | < | ||
- | : | ||
- | cleanup() { | ||
- | echo "Time limit exceeded, scrubbing all junk files now" | ||
- | exit 0 | ||
- | } | ||
- | UD_JOB_EXIT_FN=cleanup | ||
- | . / | ||
- | |||
- | UD_EXEC sleep 500000000 | ||
- | </ | ||
- | |||
- | The '' |