[torqueusers] unique identifiers per taks and PBS_VNODENUM?
Andrew J Caird
acaird at umich.edu
Wed Aug 16 20:14:04 MDT 2006
Hello,
I'm looking for a way to determine which task a given process is
in, and it sort of looks like PBS_VNODENUM might be that, but it
doesn't seem to be set all the time, and it seems sporadic when
it is set. Below is a simple code and the output from multiple
runs.
What is PBS_VNODENUM supposed to do?
Is there an environment variable that can be read by tasks that
can identify them uniquely?
Thanks.
--andy
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
int main( int argc, char *argv[], char **environ)
{
int done = 0, n, myid, numprocs, i;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
char *libpath, *p;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
MPI_Get_processor_name(processor_name,&namelen);
libpath = getenv("LD_LIBRARY_PATH");
fprintf(stderr,"Process %d on %s, LD_LIBRARY_PATH: %s\n",
myid, processor_name,libpath);
while ((p = *environ++)) {
fprintf(stderr, "[%d] [%s] %s\n",myid,processor_name,p);
}
exit(0);
}
[acaird at nyx301 environment-test]$ mpirun -np 8 env-m 2>&1 | grep VNODE
[0] [nyx301.engin.umich.edu] PBS_VNODENUM=0
[7] [nyx300.engin.umich.edu] PBS_VNODENUM=2
[2] [nyx300.engin.umich.edu] PBS_VNODENUM=2
[acaird at nyx301 environment-test]$ mpirun -np 8 env-m 2>&1 | grep VNODE
[0] [nyx301.engin.umich.edu] PBS_VNODENUM=0
[2] [nyx300.engin.umich.edu] PBS_VNODENUM=2
[4] [nyx301.engin.umich.edu] PBS_VNODENUM=0
[acaird at nyx301 environment-test]$ mpirun -np 2 env-m 2>&1 | grep VNODE
[1] [nyx301.engin.umich.edu] PBS_VNODENUM=0
[acaird at nyx301 environment-test]$ mpirun -np 2 env-m 2>&1 | grep VNODE
[0] [nyx301.engin.umich.edu] PBS_VNODENUM=0
[acaird at nyx301 environment-test]$ mpirun -np 2 env-m 2>&1 | grep VNODE
[1] [nyx301.engin.umich.edu] PBS_VNODENUM=0
[acaird at nyx301 environment-test]$ mpirun -np 2 env-m 2>&1 | grep VNODE
[1] [nyx301.engin.umich.edu] PBS_VNODENUM=0
[acaird at nyx301 environment-test]$ mpirun -np 4 env-m 2>&1 | grep VNODE
[1] [nyx301.engin.umich.edu] PBS_VNODENUM=0
[2] [nyx300.engin.umich.edu] PBS_VNODENUM=2
More information about the torqueusers
mailing list