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
hostnameprogram on a single compute node using the reservationfri. Set the job name to my_job. Use thesruncommand. - Two instances of the program
hostnameon each of the two compute nodes in the reservationfri. Set the memory per CPU to10 MB. Use thesruncommand.
b) Commands sbatch and scancel
Using the sbatch command, run the following jobs:
- Run four instances of the program
hostnameon a single node using thesbatchcommand. Follow the provided example. - Run an instance of the program
sleep 600using thesbatchcommand. The program will wait for 600 seconds after and exit without any output. Use thefrireservation. 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 thescancelcommand.
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.