Goal: Introduction to Slurm and how to start interactive sessions, submit jobs and monitor.
...
Info |
---|
|
...
Submit Jobs: sbatch
:
...
Example
Info |
---|
The following is an example script that we will use to submit a job to the cluster. It uses a short test python file defined here: python script. |
Code Block |
---|
#!/bin/bash # Shebang indicating this is a bash script. # Do NOT put a comment after the shebang, this will cause an error. #SBATCH --account=arccanetrain # Use #SBATCH to define Slurm related values. #SBATCH --time=10:00 # Must define an account and wall-time. #SBATCH --reservation=<reservation-name> echo "SLURM_JOB_ID:" $SLURM_JOB_ID # Can access Slurm related Environment variables. start=$(date +'%D %T') # Can call bash commands. echo "Start:" $start module load gcc/13.2.0 python/3.10.6 # Load the modules you require for your environment. python python01.py # Call your scripts/commands. sleep 1m end=$(date +'%D %T') echo "End:" $end |
...
Info |
---|
...
Submit Jobs: sbatch
: Options:
...
Applied to Example
Info |
---|
Let’s take the previous example, and add some of the additional options: |
...