Advertisement
Guest User

Untitled

a guest
Nov 29th, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1. # Here's content of the hook
  2. import pbs
  3. import sys
  4.  
  5. EVENT_NAMES = {
  6.     pbs.EXECHOST_PERIODIC: "EXECHOST_PERIODIC",
  7. ...
  8.     pbs.RUNJOB: "RUNJOB",
  9. }
  10.  
  11. def main():
  12.     e = pbs.event()
  13.     f = open('/tmp/pbs-hook-cgroup.log', 'a')
  14.     f.write("#######################start\n")
  15.     f.write(EVENT_NAMES[e.type])
  16.     f.write(" jobid="+e.job.id+'\n')
  17.     f.close()
  18. main()
  19.    
  20. # Here's output of `qmgr -c "print hook cgroup"`
  21. """
  22. create hook cgroup
  23. set hook cgroup type = site
  24. set hook cgroup enabled = true
  25. set hook cgroup event = execjob_prologue
  26. set hook cgroup event += execjob_launch
  27. set hook cgroup event += execjob_attach
  28. """
  29.  
  30. # Here's content of pbs-intelmpi.o33338. (Surely the .e file was empty)
  31. """
  32. node12
  33. node12
  34. node16
  35. node16
  36. """
  37.  
  38. # Here's the job file
  39. """
  40. #PBS -N pbs-intelmpi
  41. #PBS -l select=2:ncpus=2:mpiprocs=2
  42. #PBS -l place=scatter
  43.  
  44. I_MPI_HYDRA_BOOTSTRAP=rsh
  45. I_MPI_HYDRA_BOOTSTRAP_EXEC=/opt/pbs/bin/pbs_tmrsh
  46. ml load impi
  47. mpirun -machinefile $PBS_NODEFILE -np 4 /bin/hostname
  48. """
  49.  
  50. # Here's output of `for i in 12 16;do echo -- ---------------node$i;ssh node$i cat /tmp/pbs*;done"`
  51. """
  52. -- ---------------node12
  53. #######################start
  54. EXECJOB_PROLOGUE jobid=33339.w003
  55. #######################start
  56. EXECJOB_LAUNCH jobid=33339.w003
  57. -- ---------------node16
  58. cat: '/tmp/pbs*': No such file or directory
  59. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement