[torqueusers] Question regarding getting the value of ppn

John S. Urban urbanjost at comcast.net
Sat Nov 8 17:39:41 MST 2008


Oops. You want the number of processers per host, not the number of unique 
host names.

PPN="`cat $PBS_NODEFILE|sort|uniq -c|head -1|awk '{print $1}'`"
assuming all nodes are using the same number of processors
1) sort list of nodes
2) reduce to unique lines with a duplicate count in front of each line
3) head just one line, assuming the count is the same on all lines
4) print column 1 of that first line

----- Original Message ----- 
From: "Michael Homa" <mhoma at uic.edu>
To: <torqueusers at supercluster.org>
Sent: Wednesday, November 05, 2008 6:05 PM
Subject: [torqueusers] Question regarding getting the value of ppn


> I'm running torque 2.2.1 and Maui 3.2.6p20 on our university cluster.
> For reasons having to do with the software package Gaussian, I'd like to
> get the NUMERICAL setting for ppn and place it in a Gaussian input file.
> There appears to be no environmental variable setting containing this. I
> looked at both the man page as well as the wiki. However, using a stub
> program, I was able to determine that the content of the the PBS_NODEFILE
> variable is correlated to ppn. For example
>
>    o If qsub -l node=2 stub          then PBS_NODEFILE contains
>                                         node1
>                                         node2
>
>    o If qsub -l node=1:ppn=2 stub    then PBS_NODEFILE contains
>                                         node1
>                                         node1
>
>    o If qsub -l node=2:ppn=2 stub    then PBS_NODEFILE contains
>                                         node1
>                                         node1
>                                         node2
>                                         node2
>
>    o If qsub -l node=2:ppn=3 stub    then PBS_NODEFILE contains
>                                         node1
>                                         node1
>                                         node1
>                                         node2
>                                         node2
>                                         node2
>
> So, obviously, I can cat the PBS_NODEFILE into a shell array and, via a
> regular expression or via some other method, calculate what ppn is based
> on the number of duplicate names. But, I'm hoping there is a cleaner way
> to do this? Or, maybe an undocumented environmental variable? I didn't see
> anything but hope springs eternal.
>
> Michael Homa
> Operating Systems Support and Database Group
> Academic Computing and Communication Center
> University of Illinois at Chicago
> email:  mhoma at uic.edu
>
> _______________________________________________
> torqueusers mailing list
> torqueusers at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torqueusers 



More information about the torqueusers mailing list