Submitting a SLURM Script
TLDR
Submit your job script using sbatch my_submission_script.sh, check its status with squeue --me, monitor outputs with watch tail my_output_file.out, and cancel jobs with scancel if needed.
Want an Example?
You can find a very basic SLURM submission file here.
SLURM
All the information found here is expanded upon in more detail in our SLURM Guide.
Once you have completed your SLURM submission script, save it as a .sh file. For example, if you have a submission script named run.sh, you can submit it by running:
in the Turing terminal window. Your job will be placed in the scheduler queue and will run when resources become available.
Monitoring Your Job
Checking Job Status
To check the status of your running and queued jobs, use the command:
This command will show the status of only your own jobs.
You can use the watch command to look at the output in real time:
Cancelling a running command
you can cancel any running command using CTRL+C inside the terminal. This kills the actively running process.
Once your job is complete you should check to see if it utilized the resources allocated to it. This information will help you request the appropriate resource for subsequent jobs. You can check the utilization of a job using the command seff jobnumber for example
Output and Error Files
When you submit a job, SLURM redirects your job's standard output and standard error to files. By default, these files are combined into slurm-<job_id>.out.
Customizing Output Files:
You can specify custom filenames for these outputs in your submission script using the following arguments:
#SBATCH --output <filename>.out # Standard Output file
#SBATCH --error <filename>.err # Standard Error file
Monitoring Job Output in Real-Time
the tail command shows you the last few lines of a file. Adding -f will provide live output:
Cancelling a Job
If you need to cancel a job—for example, if it's using too many resources or behaving unexpectedly—you can use the scancel command:
Replace <job_id> with the actual job ID assigned by SLURM when you submitted the job. You can find the job id using squeue --me
Example:
This will cancel the job with ID 123456.