# Here's content of the hook import pbs import sys EVENT_NAMES = { pbs.EXECHOST_PERIODIC: "EXECHOST_PERIODIC", ... pbs.RUNJOB: "RUNJOB", } def main(): e = pbs.event() f = open('/tmp/pbs-hook-cgroup.log', 'a') f.write("#######################start\n") f.write(EVENT_NAMES[e.type]) f.write(" jobid="+e.job.id+'\n') f.close() main() # Here's output of `qmgr -c "print hook cgroup"` """ create hook cgroup set hook cgroup type = site set hook cgroup enabled = true set hook cgroup event = execjob_prologue set hook cgroup event += execjob_launch set hook cgroup event += execjob_attach """ # Here's content of pbs-intelmpi.o33338. (Surely the .e file was empty) """ node12 node12 node16 node16 """ # Here's the job file """ #PBS -N pbs-intelmpi #PBS -l select=2:ncpus=2:mpiprocs=2 #PBS -l place=scatter I_MPI_HYDRA_BOOTSTRAP=rsh I_MPI_HYDRA_BOOTSTRAP_EXEC=/opt/pbs/bin/pbs_tmrsh ml load impi mpirun -machinefile $PBS_NODEFILE -np 4 /bin/hostname """ # Here's output of `for i in 12 16;do echo -- ---------------node$i;ssh node$i cat /tmp/pbs*;done"` """ -- ---------------node12 #######################start EXECJOB_PROLOGUE jobid=33339.w003 #######################start EXECJOB_LAUNCH jobid=33339.w003 -- ---------------node16 cat: '/tmp/pbs*': No such file or directory """