Batch job tutorial - Interactive jobs
In this tutorial weβll get familiar with the basic usage of the Slurm batch queue system at CSC
- The goal is to learn how to request resources that match the needs of a job
π¬ A job consists of two parts: resource requests and the job step(s)
βπ» Examples are done on Puhti. If using the web interface, you can either open a login node shell and follow the steps below or, even better, open a compute node shell directly and skip to step 3.
π‘ The benefit of running an interactive session through the Puhti web interface is that the shell is persistent, i.e. the session will stay open and any programs started there will keep running even if you would happen to lose internet connection or close the browser tab.
Interactive jobs
π¬ In an interactive batch job, an interactive shell session is launched on a compute node.
- For heavy interactive tasks one can request specific resources (time, memory, cores, disk).
π‘ You can also use tools with graphical user interfaces in an interactive shell session.
- For such usage the Puhti web interface remote desktop often provides an improved experience.
- Check also how to use RStudio and Jupyter Notebooks in Puhti
A simple interactive job
- Start an interactive job using one core for ten minutes:
sinteractive --account <project> --time 00:10:00 # replace <project> with your CSC project, e.g. project_2001234
π‘ You can list your projects with csc-projects
- You should see that the command prompt (initial text on each row on the command-line) has changed from e.g.
puhti-login11
to e.g.r07c51
which refers to a compute node. - Once on the compute node, you can run commands directly from the command-line without
srun
. You can e.g. load thepython-data
module (e.g. for running Python scripts interactively on Puhti):
module load python-data
- Quit the interactive batch job with
exit
.
π¬ This way you can work interactively for an extended period, using e.g. lots of memory without creating load on the login nodes. Running heavy/long tasks on the login nodes is forbidden according to our Usage Policy.
βΌοΈ Note that above you asked only for 10 minutes of time.
- Once that is up, you will be automatically logged out from the compute node.
π‘ From the command-line prompt you can see whether youβre on a compute node (e.g. r07c51
) or on the login node (e.g. puhti-login12
).
- Running
exit
on the login node will log you out from Puhti.
More information
π‘ Documentation at Docs CSC on Interactive usage
π‘ FAQ on CSC batch jobs in Docs CSC