How to submit a job to a specific node in PBS

Ashwin  picture Ashwin · Aug 23, 2013 · Viewed 39.5k times · Source

How do I send a job to a specific node in PBS/TORQUE? I think you must specify the node name after nodes.

#PBS -l nodes=abc

However, this doesn't seem to work and I'm not sure why. This question was asked here on PBS and specify nodes to use

Here is my sample code

#!/bin/bash
#PBS nodes=node9,ppn=1,
hostname
date 
echo "This is a script"
sleep 20    # run for a while so I can look at the details
date

Also, how do I check which node the job is running on? I saw somewhere that $PBS_NODEFILE shows the details, but it doesn't seem to work for me.

Answer

dbeer picture dbeer · Aug 23, 2013

You can do it like this:

#PBS -l nodes=<node_name>

You can also specify the number of processors:

#PBS -l nodes=<node_name>:ppn=X

Or you can request additional nodes, specified or unspecified:

#PBS -l nodes=<node_name1>[:ppn=X][+<node_name2...]

That gives you multiple specific nodes.

#PBS -l nodes=<node_name>[:ppn=X][+Y[:ppn=Z]]

This requests the specific node with X execution slots from that node, plus an additional Y nodes with Z execution slots each.

Edit: To simply request a number of nodes and execution slots per node:

PBS -l nodes=X:ppn=Y

NOTE: this is all for TORQUE/Moab. It may or may not work for other PBS resource managers/schedulers.