Submit a job

To submit a job on the computing platform, you must have a computing account and connect on an interactive server. Two commands allow job submission.

Job submission through command line needs to follow to the following syntax:

% sbatch -t 0-00:30 -c 1 --mem 2G job.sh
sbatch: INFO: Account: ccin2p3
sbatch: INFO: Submission node: cca013
sbatch: INFO: Partition set to: htc
sbatch: INFO: Partition limited to one node per job.
sbatch: INFO: Time limit set to: 0-00:30 (30 minutes)
Submitted batch job 10280305
-t <j-hh:mm>

specifies the evaluated time limit. All acceptable formats are explained in Main sbatch options paragraph.

-c <number>

specifies the requested number of CPUs per task (by default a job has only one task).

--mem <number>

specifies the requested amount of memory.

job.sh

your executable task script.

Upon submission, information is returned to you in the standard output: the computing group (Account, here ccin2p3), the submission node (here cca013), the partition htc (default) in which the job will be executed, and the job identifier contained in the environment variable SLURM_JOB_ID (here 10280305) .

If you need to access a resource requiring declaration, use the -L option (in the following example, to declare the use of sps and matlab):

% sbatch -t 0-00:30 -c 4 --mem 2G -L sps,matlab job.sh

Attention

  • Missing the options indicating the time -t, the number of CPUs per task -c and the memory --mem =, the job submission will be refused. The upper limits of these parameters will be discussed in the Required parameters limits paragraph.

  • Please check that your resources request does not exceed the hardware limits on the computing platform nodes.

The default computing group (“account”) corresponds to the user’s main Unix group. To know all your accounts limitations, use the command suggested in paragraph User information.

To compute on a different account than the default, use the -A | --account= submission option or the change group command to change your main Unix group.

Important

The job submission directory defines the working directory. TMPDIR may be used for storing large amounts of data, but it is not the default working directory. You may force Slurm to use this space, or any other space, as your workspace using the option -D | --chdir=. Please refer also to the Computing environment page.

Main sbatch options

You may find below a brief description of the main sbatch options. To browse all the available options, please refer to the command help sbatch -h.

-t | --time=

sets a limit on the total run time of the job allocation. Acceptable formats: “minutes”, “minutes:seconds”, “hours:minutes:seconds”, “days-hours”, “days-hours:minutes” and “days-hours:minutes:seconds”.

-c | --cpus-per-task=

states the number of cores per task. By default a job has only one task.

--mem=

states the amount of needed memory (ex. --mem=5G). This option accepts only integer, non-zero values (ex. do not declare --mem=5.5G, but --mem=5500M).

-L | --licenses=

states the types of storage and software resources needed by the job.

-A | --account=

states the computing group to be charged with the resources used by the job.

-a | --array=

allows the description of a job array, , is the separator to define a list or - to define an interval, ex. --array=0,6,16-32.

-J | --job-name=

defines the job name.

-o | --output=

states the file name for the standard output, by default slurm-jobid.out. Use %j in the file name to include the job number and avoid the output being overwritten by successive jobs. Example: --output=<job name>-%j.out. If left blank, the default output file will be named slurm-%j.out.

-e | --error=

states the file name for the error messages. By default both standard output and standard error are directed to the same file.

-p | --partition=

allows to select the chosen partition.

-N | --nodes=

states the number of the computing servers needed.

-n | --ntasks=

states the maximum number of parallel tasks lauched by the job. By default it corresponds to allocated CPU number. If this option is used with srun, then the task will be repeated n times.

-D | --chdir=

sets the working directory of the batch script before it is executed. The path can be specified as full path or relative path.

--mail-user=

states the email to receive the chosen notifications, such as job state changes. Must contains a valid, professionnal email address. Please do not activate automatic replies during the job run-time.

--mail-type=

states the type of alert to be notified. If set, then --mail-user must also be set or no email will be sent.