Exercise 3: Creating and Running Jobs on the Cluster
In this exercise, we will refer to the examples provided in the chapter on running jobs on the cluster.
a) Command srun
Run the following jobs:
- Four instances of the
hostname
program on a single compute node using the reservationfri
. Set the job name to my_job. Use thesrun
command. - Two instances of the program
hostname
on each of the two compute nodes in the reservationfri
. Set the memory per CPU to10 MB
. Use thesrun
command.
b) Commands sbatch
and scancel
Using the sbatch
command, run the following jobs:
- Run four instances of the program
hostname
on a single node using thesbatch
command. Follow the provided example. - Run an instance of the program
sleep 600
using thesbatch
command. The program will wait for 600 seconds after and exit without any output. Use thefri
reservation. Use the provided example script as a base and adjust the time limit accordingly. Wait for the job to start running (status R), then cancel it prematurely using thescancel
command.
Hint
To cancel the execution of a job, we will need the job ID, which is displayed by the sbatch
command or can be obtained using the squeue
command.