How to report compute nodes allocated to job?

I am new to PBS and I’m looking for a way to report a list of the compute nodes allocated to each job. This information can be quite useful for analyzing individual job performance and system-wide compute node allocation fragmentation.

I read the qacct man page (SCV - SuperMan Pages) and the grid engine accounting format (SCV - SuperMan Pages). But I don’t see any information there about compute nodes.

By way of comparison, the slurm accounting command sacct can report a list of the host names of the compute nodes allocated to a job.

Hi Lee
Welcome :slight_smile:

If you wish to find out what compute node(s) is assigned to current runnning jobs you can do “qstat -an1”. The -a is for “all queued and running jobs” and the -n1 is usful to get it all on one line.

For expired jobs “qstat -x” wil print out a list of all expired i.e. finished jobs. This list can be saved and edited down to a file “jobs.txt”, then run some bash incantations:
for j in $(cat jobs.txt); do echo -n "$j "; qstat -fx $j | grep exec_host; done
573630.hpcnode0 exec_host = hpcnode03/3
573631.hpcnode0 exec_host = hpcnode03/3
573632.hpcnode0 exec_host = hpcnode03/3

The above is just a quick way to get the info, not really good for a big production site.
Mike

1 Like

Thank you Mike! I will give this a try.