Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| quickstart [2023/09/11 18:53] – [The SLURM Scheduler] docuadmin | quickstart [2025/05/08 19:43] (current) – docuadmin | ||
|---|---|---|---|
| Line 19: | Line 19: | ||
| ====== The SLURM Scheduler ====== | ====== The SLURM Scheduler ====== | ||
| - | Compute jobs on the cluster are managed by a scheduler: SLURM. To run jobs on the cluster you'll need to prepare your jobs then submit them to the scheduler along with some information about the resources that are needed to run the job. (Refer to the [[https:// | + | Compute jobs on the cluster are managed by a scheduler: SLURM. To run jobs on the cluster you'll need to prepare your jobs then submit them to the scheduler along with some information about the resources that are needed to run the job. (Refer to the [[https:// |
| - | Jobs can be submitted to the scheduler using the '' | + | Jobs can be submitted to the scheduler using the '' |
| These are common parameters passed to SLURM when submitting a job: | These are common parameters passed to SLURM when submitting a job: | ||
| - | * Initial | + | * Set Working Directory ('' |
| - | * Resource list: ('' | + | * Nodes ('' |
| - | * nodes and processors | + | * Sockets (or CPUs) per node ('' |
| - | * physical memory | + | * Cores ('' |
| - | * walltime | + | * Tasks ('' |
| - | * Output Path: ('' | + | * Memory required per node ('' |
| - | * Error Path: ('' | + | * Time limit ('' |
| - | * Name: ('' | + | * Output Path ('' |
| + | * Error Path ('' | ||
| + | * Name ('' | ||
| - | A complete list of parameters that Moab accepts is available in the [[http://docs.adaptivecomputing.com/9-1-3/ | + | A complete list of parameters that '' |
| - | As an example, consider | + | ====== Run an Interactive Job on a Compute Node ====== |
| + | |||
| + | Running an interactive job on a compute node is the preferred method of testing jobs and scripts. Doing so avoids running resource-intensive workloads on the master (or login) node. | ||
| + | To start a job with an interactive shell on a compute node you can use this command: | ||
| + | |||
| + | srun -N 1 -n 1 --pty /bin/bash | ||
| + | |||
| + | ====== Basic job submission ====== | ||
| + | |||
| + | Consider | ||
| + | | ||
| $ date; sleep 5; date; | $ date; sleep 5; date; | ||
| - | To execute this job on the cluster, we would turn this command in to a very simple script: | + | To execute this simple series of commands you can create |
| - | File `date.sub`: | + | File '' |
| #!/bin/bash | #!/bin/bash | ||
| Line 46: | Line 58: | ||
| sleep 5 | sleep 5 | ||
| date | date | ||
| - | |||
| - | Once the script is created it can submitted to the scheduler. But we also need to tell the scheduler what resources are needed and how long the job will likely take. This information can be passed to Moab directly in the `msub` command or it can be placed in the script itself. | ||
| - | The job can be submitted to the scheduler | + | The commands are now in a format that can be submitted to the scheduler to be run as a job on the cluster. But we also need to tell the scheduler what resources are needed. This information can be passed to SLURM directly in the '' |
| - | $ msub -l nodes=1:ppn=1, | + | The job can be submitted to the scheduler by adding flags to the '' |
| - | To place this request in the script itself, we modify the script to include an additional line with the resources request: | + | $ sbatch -J SleepJob -N 1 --tasks-per-node=1 date.sub & |
| - | File `date.sub`: | + | To place the resource request in the script itself, we modify the script to include additional lines for SLURM: |
| + | |||
| + | File '' | ||
| #!/bin/bash | #!/bin/bash | ||
| - | #PBS -l nodes=1:ppn=1, | + | #SBATCH |
| + | #SBATCH --tasks-per-node=1 | ||
| + | #SBATCH -J SleepJob | ||
| | | ||
| date | date | ||
| Line 64: | Line 78: | ||
| date | date | ||
| - | Then the job is submitted with `msub`: | + | Then the job is submitted with '' |
| - | $ msub date.sub | + | $ sbatch |
| - | The '' | + | The '' |
| - | $ showq | + | $ squeue --job < |
| -or- | -or- | ||
| + | $ squeue -n <Job name if specified upon submission> | ||
| + | |||
| + | |||
| + | ====== Next Steps ====== | ||
| - | $ checkjob JOBID | + | A step-by-step tutorial for creating and submitting a job using Open OnDemand is available here. |
| - | Refer to the [[http://docs.adaptivecomputing.com/9-1-3/suite/help.htm# | + | Comprehensive |