The cluster uses the Slurm scheduler. You describe what your job needs (partition, time, memory, and cores) in a script, submit the script, and Slurm runs it on a node when resources are available. Please do not run heavy computations directly on the login node.
Each CPU node has two processors with 12 cores each (24 cores per node).
Every job script should specify at least these four values:
-p)-t), in the format days-hours:minutes--mem), in megabytes unless you add a unit such as G-n)The example below also sets the number of nodes (-N), output and error file names, and email notifications. These are optional.
This example generates a file of random numbers and sorts it. It requests one core and 100 MB of memory for up to two hours.
#!/bin/bash
#SBATCH -p sbatch # partition (queue)
#SBATCH -N 1 # number of nodes
#SBATCH -n 1 # number of cores
#SBATCH --mem 100 # memory pool for all cores (in MB)
#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-user=NETID@msstate.edu
#SBATCH --mail-type=ALL
for i in {1..100000}; do
echo $RANDOM >> SomeRandomNumbers.txt
done
sort SomeRandomNumbers.txt
To use it:
nano myscript.sh opens an editor where you can paste it.NETID in the mail-user line to your own NetID. If you do not want email notifications, delete the mail-user and mail-type lines.sbatch myscript.sh
To use the A100 GPU, submit to the gpu partition and request the GPU with --gres=gpu:1. Slurm only assigns the GPU to jobs that request it, so a job that names the partition without --gres will run without GPU access.
#!/bin/bash
#SBATCH -p gpu # GPU partition
#SBATCH -N 1 # number of nodes
#SBATCH -n 8 # number of cores
#SBATCH --mem 32G # memory pool for all cores
#SBATCH --gres=gpu:1 # request the GPU
#SBATCH -t 0-4:00 # time (D-HH:MM)
#SBATCH -o slurm.%N.%j.out # STDOUT
#SBATCH -e slurm.%N.%j.err # STDERR
nvidia-smi # confirm the GPU is visible to the job
./my_gpu_program
Load CUDA or any other modules your program needs before running it (run module avail to see the exact module names). There is only one GPU, so GPU jobs run one at a time.
To work interactively on a compute node (for example, to test commands or debug a program), request a shell with srun:
srun -p sbatch -n 1 --mem 4G -t 0-1:00 --pty bash
When the shell starts, you are on a compute node and can run commands directly. Type exit to end the session and release the resources. Add --gres=gpu:1 and use -p gpu for an interactive session on the GPU node.
To see when Slurm expects to start your job without actually submitting it, use:
sbatch --test-only myscript.sh
Load the modules your program needs before it runs. In a job script, put the module load command before your program:
module load openfoam/2412
You can also run module initadd NAME to load a module automatically in every new shell, which helps MPI programs and other jobs that run across several nodes. See Engineering Compute Cluster – Overview for the list of available software.
squeue -u NETID # show your queued and running jobs
scancel JOBID # cancel a job
sinfo # show partition and node status
sinfo -o "%P %l" # show the maximum time limit for each partition
Additional Slurm example scripts are available on the cluster in /usr/local/share/slurm.