Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

UI Expand
title7. How to submit a job

Once you have your compiled program and prepared its input data, the last step is to run it on the compute nodes of the cluster.

Important: the node you are logged in is a login node and cannot be used to execute parallel programs.
Login nodes are not used for production therefore the execution of any command in the login nodes is limited up to 10 minutes.

For longer runs you need to use the "batch" mode. On CINECA machines we use the SLURM scheduler.

UI Expand
titleBatch job

A simple batch script to submit a job is the following

#!/bin/bash
#SBATCH --nodes=<nodes_no>           # number of nodes
#SBATCH --ntasks-per-node=<tasks_no> # number of tasks per node
#SBATCH --time=01:00:00              # time limits: here 1 hour
#SBATCH --mem=<memory>GB # total memory per node requested in GB (optional)
#SBATCH --error=myJob.err            # standard error file
#SBATCH --output=myJob.out           # standard output file
#SBATCH --account=<account_no>       # account name
#SBATCH --partition=<partition_name> # partition name
#SBATCH --qos=<qos_name>             # quality of service (optional)
srun ./my_application

In the script we tell the scheduler the amount of resources needed (--nodes, --ntasks-per-node and --mem) on which partition (–partition and --qos) and which budget of hours to be used (--account). The session has a walltime (--time) and the outputs of the code are collected in myJob.out and myJob.err (--output and --error respectively).
The partition and the resources depend on the machine you are considering. All you need to know to properly fill your batch script can be found in the "UG3.0 System specific guide" page.

To submit the job to the scheduler type

> sbatch [opts] job_script

You can find a complete list of examples of job scripts here.

UI Expand
titleInteractive job

As an alternative you can submit an interactive job opening a terminal session directly in a compute node in which you can execute your program:

 > salloc --nodes=<nodes_no> --ntasks-per-node=<tasks_no> --account=<account_no> --partition=<partition_name> --pty /bin/bash

in which you can execute your program with the same inputs as the batch job.
Remember to close the interactive job with the command "exit" when you have finished, in order not to waste your account budget.

Congratulations! You have successfully executed your first job on our clusters.
Remind: Going through our detailed documentation may help you in optimizing your programs on our clusters and saving hours of your budget.

For any problem or question please refer to our Help Desk writing to superc@cineca.it

...