General commands
man sbatch
man squeue
man scancel
Submitting jobs
myscript.scr
#!/bin/bash
#
#SBATCH -p general # partition (queue)
#SBATCH -N 1 # number of nodes
#SBATCH -n 1 # number of cores
#SBATCH –mem 100 # memory pool for all cores
#SBATCH -t 0-2:00 # time (D-HH:MM)
#SBATCH -o slurm.%N.%j.out # STDOUT
#SBATCH -e slurm.%N.%j.err # STDERR
#SBATCH –mail-type=END,FAIL # notifications for job done & fail
#SBATCH –mail-user=myemail@harvard.edu # send-to address
for i in {1..100000}; do
echo $RANDOM >> SomeRandomNumbers.txt
done
sort SomeRandomNumbers.txt
Now you can submit your job with the command:
sbatch myscript.scr
Information on jobs
List all current jobs for a user:
List all running jobs for a user:
List all pending jobs for a user:
List priority order of jobs for the current user (you) in a given partition:
List all current jobs in the general partition for a user:
List detailed information for a job (useful for troubleshooting):
List status info for a currently running job:
Once your job has completed, you can get additional information that was not available during the run. This includes run time, memory used, etc.
To get statistics on completed jobs by jobID:
To view the same information for all jobs of a user:
Controlling jobs
To cancel one job:
To cancel all the jobs for a user:
To cancel all the pending jobs for a user:
To cancel one or more jobs by name:
To pause a particular job:
To resume a particular job:
To requeue (cancel and rerun) a particular job:
Leave A Comment