UVA’s CS cluster and Rivanna both use the slurm job manager. Here are some helpful hints to get you started, but the full documentation is available on the CS Wiki.
This is an example slurm batch file, example.slurm:
#!/bin/bash #SBATCH -N 1 #SBATCH -c 1 #SBATCH -t 72:00:00 #SBATCH --mem=16 #SBATCH --requeue #SBATCH --job-name="shortname" # Load the modules script just in case source /etc/profile.d/modules.sh # Load any modules needed (see module avail for the full list) # module load python3.8.0 # cd to your chosen directory cd /u/userid # Run shell commands python --version #prints python version
This script will be run when your job starts on the cluster. In this simple example, we are requesting one machine (
N), one core/thread on that machine (
c), a max runtime of 72 hours (
t), and 16GB of RAM (
mem). We’ve also titled the job “shortname”, for which the first 8 characters will be displayed in the queue list.
Interacting with the Queue
The following commands will help get your job on the queue:
sbatch example.slurm- queues the job with our example script on the queue.
squeue- display all the jobs in the queue
squeue | grep userid- display all jobs filtered by your userid