...
The second part of the script is the lines beginning with #SBATCH
. These lines are the options that tell Slurm what type and how many resources you need. In this example, we first set the job name to “myappjob”. The job name is just an easy way for you to view your job later. The output and error parameters are the next two lines. These setup the screen output and screen error redirects to the file you specify. This is not your program output files, but rather what you would usually see on the screen if you ran your command without the scheduler. The last parameter is the number of tasks my job needs. In this example, I am requesting 2 tasks, which is essentially 2 cpu’s. Please read the Tasks vs CPU’s section below for more information about tasks. Please read the Slurm Parameters section below for more information about SBATCH parameters.
The last part of this script is the actual commands needed to run my programmyprogram. In this example, I first load the mpi module. You will need to load any modules your program needs before you actually run your program. I then call the program name, myapp, telling it to start running.
...
Code Block |
---|
sbatch myscript.job |
And that’s it! We have now submitted our job to the queue. You will be given a job id here, which you can use later to get detailed information about your job.
...
The following table is a list of common Slurm parameters, examples of how to use them, and a brief description of what they do. For a complete list of parameters, please refer to the Slurm SBATCH documtationdocumentation.
Slurm Option | Example | Description |
--error=<filename> | --error=errorout.txt | Redirect the screen error (standard error) to the specified file |
--output=<filename> | --output=screenout.txt | Redirect the screen output (standard out) to the specified file. This is NOT your programs output file |
--job-name=<jobname> | --job-name=myjob-name | A friendly name given to a job |
--mail-type=<type> | --mail-type=END,FAIL | Notifies the user when certain event types occur. Valid types are NONE, BEGIN, END, FAIL, REQUEUE, ALL. --mail-user but also be set |
--mail-user=<email> | --mail-user=netid@tamu.edu | User to receive email notifications of state changes defined by --mail-type |
--ntasks=<numtasks> | --ntasks=4 | The number of tasks needed. Please read the Tasks vs CPU’s section for more information |
--cpus-per-task=<num> | --cpus-per-task=20 | The number of cpus needed per task. Please read the Tasks vs CPU’s section for more information |
--partition=<partition_name> | --partition=large | Specifies the partition to submit your job to. |
--qos=<qos> | --qos=normal | Specifies the Quality of Service (QOS) your job should use |
...
Filter by label (Content by label) | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Page Properties | ||
---|---|---|
| ||
|