To run a job on the cluster in the jobs queue, the name of the primary SLURM partition, you must create what is known as a submit file. The submit file lets the scheduler know what resources your job requires (number of processors, amount of memory, walltime, etc.). The following submit file will be used to run your first job.
#!/bin/bash -l |
Let's take a quick look at each section of the submit file to understand the structure.
The first section contains the scheduler directives. The directives below are running the job in the BASH shell, in the jobs SLURM partition, setting the name of the job to basic_slurm_job, requesting a single core on a single node, and asking for these resources for up to 1 hour:
#!/bin/bash |
The second section prints out information, such as today's date, the directory the job resides in, the job's ID and name, as well as the total number of tasks and a node list:
|
echo "======================================================" |
The third section is the portion of the submit file where your actual program will be specified. In this example, the job is just returning the directory that contains the SLURM submit script and printing out a message, as well as the compute node name to the output file:
cd $SLURM_SUBMIT_DIR |
The final section appends the job's completion time to the output file:
|
echo "" |
To run this first job. Login to the login node, create a file called basic-submit.slurm and past the above script into the file.
Then submit the script using the slurm scheduler:
|
$ sbatch basic-submit.slurm |
Once your job completes you should see the following(or similar since the actual compute node could be different) when you cat your output file:
|
$ cat slurm-18513.out |
There are additional sample batch files on the system that you can copy into your home directory:
|
$ cp /mnt/it_research/examples/bioinformatics/* . |
Additional scripts you copied to your home directory:
|
$ ls bio* |
Since you have copied these to your home directory you can edit and modify them as needed or use them as the start of your own batch file.