Skip to content

HPC Reservations

You can request an “Advance reservation” which is a reservation for some CPU resources, CPU time and memory for a specified time in the future. See page UG-135 in the PBS User Guide which you can download from here:

Creating a Reservation

You create this advance reservation using the pbs_rsub command. PBS must be able to calculate the start and end times of the reservation, so you must specify two of the following three options:
-R Start time
-D Duration
-E End time

Note: Start and End times must be in a datetime format like this DDHHMM (no colons) whereas the Duration format can be in HH:MM (with colons).

The following example shows creating an advance reservation for 2 CPUs from 10:00 a.m. to 12:00 p.m. i.e. in HHMM time format 1000 hours to 1200 hours:

pbs_rsub -l select=1:ncpus=2 -R 1000.00 -E 1200.00

In this next example an end time is not specified, so PBS will calculate the end time based on the reservation start time and duration. The duration here is in HH:MM time format:

pbs_rsub -l select=1:ncpus=2 -R 1000.00 -D 02:00:00

The resource request -l walltime can be used instead of the -D option.

pbs_rsub -l select=1:ncpus=2 -l walltime=00:40:00 -R 2000.00

You can also give your reservation a name using -N <reservation name>.

$ pbs_rsub -l select=1:ncpus=2 -N testR -R 1300.00 -D 00:10:00
R1015456.hpcnode0 UNCONFIRMED

To view the status of a reservation, use the pbs_rstat command.

$ pbs_rstat -S 
Resv ID    Queue    User     State             Start / Duration / End              
R1015456.h R1015456 mlake@hp CO          Today 13:00 / 600 / Today 13:10

To get full information on a reservation use the -F option:

$ pbs_rstat -F

The reservation actually creates a “queue” like the “small” queue or the “gpu” queue. To use your reservation you submit your job to that reservation queue. The reservation accepts jobs only from the user who created the reservation. In the example above the reservation queue’s name is “R1015456”.

Using a Reservation

To submit your job to your reservation just use the qsub command but specify that you want it to use your reservation queue like this: qsub -q Reservation_Queue

For instance:

$ qsub -q R1015456

Now pbs_rstat will show this:

$ pbs_rstat -S
Resv ID    Queue    User     State             Start / Duration / End              
R1015456.h R1015456 mlake@hp RN          Today 13:00 / 600 / Today 13:10

A confirmed reservation will accept jobs into its queue at any time. Jobs are only scheduled to run from the reservation once the reservation period arrives. The jobs in a reservation are not allowed to use, in aggregate, more resources than the reservation requested.

But note: A reservation job is accepted in the reservation regardless of whether its requested walltime will fit within the reservation period. So for example if the reservation runs from 10:00 to 11:00, and the job’s walltime is 4 hours, the job will be started. When an advance reservation ends, any running or queued jobs in that reservation are deleted.

To view the status of a job that has been submitted to a reservation just use the usual qstat command:

$ qstat

Job-specific Start Reservations

From the PBS User Guide on page UG-140:

7.5.1 Job-specific Start Reservations:
PBS runs the job normally, and when the job starts, PBS creates and starts a job-specific start reservation and moves the job into the reservation. PBS creates the reservation using the same resources that are being used by the job. The reservation holds the resources needed for the job in case the job fails and needs to be re-submitted, allowing it to run again without having to wait to be scheduled. The reservation starts when the job starts and has the same end time as the job.

If you have a queued job that you think is likely to fail and need to be corrected and re-submitted, you can create a job-specific start reservation. When you submit the job, set its create_resv_from_job attribute to True using the -W option to qsub:

$ qsub -Wcreate_resv_from_job=true

Deleting a Reservation

To delete a reservation, use the pbs_rdel command. Do not use the qdel command.