Changeset 282 for trunk/examples/pbs_jobmonitor
- Timestamp:
- 05/01/12 14:53:13 (12 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/pbs_jobmonitor
r281 r282 8 8 # $URL$ 9 9 # 10 # topjob, gojob jobnr [nodenr] 11 # jobnr: the number of the job 12 # nodenr: the rank of the node in the job 10 # pbs_jobmonitor, pbs_joblogin <jobnr> [nodenr] 11 # jobnr: the number of the job 12 # nodenr: the rank of the node in the job 13 # 13 14 # depending on the name with this script is called it performs the 14 15 # following: 15 16 16 # called as topjob:17 # called as pbs_jobmonitor: 17 18 # shows the output of top -u user on the node 18 19 # - one cycle of top 19 20 # - user: the user the job belongs to 20 21 # 21 # called as gojob:22 # called as pbs_joblogin: 22 23 # logs in to the node as the user who invokes this script 23 24 # (os.getenv('USER')) … … 40 41 41 42 def usage(a): 42 if a == 'gojob': 43 if a == 'pbs_jobmonitor': 44 print a,'shows the system usage of a node where a job is running' 45 if a == 'pbs_joblogin': 43 46 print a,'logs you in to a node where a job is running' 44 if a == 'topjob':45 print a,'shows the system usage of a node where a job is running'46 47 47 48 print 'Usage:' 48 print a,' jobnumber[nodenumber]'49 print 'where jobnumberis the number of the job'49 print a,'<jobnumber> [nodenumber]' 50 print 'where <jobnumber> is the number of the job' 50 51 print ' nodenumber is the rank number of the node allocated to the job' 51 52 print ' (default 0)' … … 106 107 sys.exit(1) 107 108 108 if me == ' topjob':109 if me == 'pbs_jobmonitor': 109 110 user=job['Job_Owner'][0].split('@')[0] 110 111 print 'top for node #',num,':',nodes[num],'user:',user … … 112 113 os.system('ssh '+nodes[num]+' top -n1 -b -u ' + user) 113 114 114 if me == ' gojob':115 if me == 'pbs_joblogin': 115 116 user = os.getenv('USER') 116 117 print 'logging in to node #',num,':',nodes[num],'user:',user
Note: See TracChangeset
for help on using the changeset viewer.