Releasing Idle Nodes from Running Jobs

Article ID: 532
Last updated: 16 Dec, 2025

Many jobs running across multiple nodes perform setup and pre-processing tasks on the first node, then launch computations across many nodes, and finish with post-processing and cleanup steps running only on the first node. The post-processing and cleanup steps may take minutes or even hours, during which the remaining nodes in the job are idle. You can use the pbs_release_nodes command to release these idle nodes so that you are not charged for them, and they can be made available to other jobs.

Some users have already taken steps to minimize the number of idle nodes by separating their workflow into multiple jobs of appropriate sizes. The downside to this approach is additional time waiting in the queue for these multiple jobs. Using pbs_release_nodes may allow these jobs to be combined, reducing the amount of wait time in the queue.

Node Tracking and Job Accounting

When you use the pbs_release_nodes command, the released nodes are removed from the contents of $PBS_NODEFILE. The job accounting system tracks when the nodes are released, and adjusts the amount of SBUs charged accordingly.

Running the pbs_release_nodes Command

You can either include the pbs_release_nodes command in your job script or you can run it interactively, for example, on a PFE. If you run it in your job script, you can use the $PBS_JOBID environment variable to supply the job_id. You can use pbs_release_nodes multiple times in a single job.

There are two ways to use the pbs_release_nodes command. In both cases, the first node is retained.

  • Keep the first node and release all other nodes
    If you want to retain the first node only, run the command as follows to release the remaining nodes:
    pfe21% pbs_release_nodes -j job_id -a
  • Release one or more specific nodes
    If you want to retain one or more nodes in addition to the first node, run the command as follows to release specific idle nodes:
    pfe21% pbs_release_nodes -j job_id node1 node2 ... nodeN

To find out which nodes are being used by a job before you run the pbs_release_nodes command, use one of the following methods:

  • For interactive jobs: Run qstat -f job_id. In the output, look for the nodes listed under the exec_vnode job attribute.
  • For job scripts: Run cat $PBS_NODEFILE. The output provides a list of the nodes in use.

Note: $PBS_NODEFILE may have duplicate entries for nodes, depending on how resources were requested. See man pbs_resources for details.

Sample Job Script with pbs_release_nodes Command

The following sample job script keeps the first node and releases all other nodes before running post-processing steps:

#PBS -S /bin/csh
#PBS -N cfd
#PBS -l select=4:ncpus=8:mpiprocs=8:model=sky_ele
#PBS -l walltime=4:00:00
#PBS -j oe
#PBS -W group_list=a0801
#PBS -m e
module load comp-intel/
module load mpi-hpe/mpt
cd $PBS_O_WORKDIR
mpiexec dplace -s1 -c 16-23 ./grinder < run_input > intermediate_output
# Before executing some post-processing steps that will run only on the
# first node of the job you can release all other nodes
pbs_release_nodes -j $PBS_JOBID -a
# Now run post-processing steps
./post_process < intermediate_output > final_output
# -end of script-

Contact Us

General User Assistance

Security

  • Report security issues 24x7x365
  • Toll-free: 1-877-NASA-SEC (1-877-627-2732)
  • E-mail: soc@nasa.gov

User Documentation

High-End Computing Capability (HECC) Portfolio Office

NASA High-End Computing Program

Tell Us About It

Our goal is furnish all the information you need to efficiently and effectively use the HECC resources needed for your NASA computational projects.

We welcome your input on features and topics that you would like to see included on this website.

Please send us email with your wish list and other feedback.