Changeset 63


Ignore:
Timestamp:
10/21/04 14:11:30 (19 years ago)
Author:
bas
Message:

Deleted obsolete directories:

  • 2.1
  • dist
  • 1.5

Added:

  • Walters rack_pbsmon.py
  • Changed pbsmon.py
Location:
trunk/pbs_swig/distro/examples
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_swig/distro/examples/pbsmon.py

    r54 r63  
    1616import pbs
    1717
     18pbs_ND_free_and_job = 'not_all_procs_used'
     19
    1820translate_state = {
    1921    pbs.ND_free             : '_',
     
    2628    pbs.ND_state_unknown    : '?',   
    2729    pbs.ND_timeshared       : 'T',
    28     pbs.ND_cluster          : 'C'
     30    pbs.ND_cluster          : 'C',
     31    pbs_ND_free_and_job     : 'j'
    2932}
    3033
     
    3740  #
    3841  if len(nl) == 1:
     42    print nl[0]
    3943    width = len( nl[0] )
    4044  else:
     45    print nl[0]
    4146    width = len( nl[1] )
    4247
     
    8186  for key in translate_state.keys():
    8287    value = translate_state[key]
    83     print "%2s %-15s : %d\t |" %( value, key, sl.count(value) ),
     88    print "%3s %-21s : %d\t |" %( value, key, sl.count(value) ),
    8489    if n%2:
    8590      print ''
     
    104109   sys.exit(1)
    105110
    106   # We are only interested in the state of a node
     111  # We are only interested in the state and jobs of a node
    107112  #
    108   attrl = pbs.new_attrl(1);
     113  attrl = pbs.new_attrl(2);
    109114  attrl[0].name='state'
     115  attrl[1].name = 'jobs'
    110116
    111117
     
    123129    #
    124130    temp = string.splitfields(node_attr[0].value, ',')
    125     state_list.append(translate_state[ temp[0] ])
     131    state = temp[0]
     132    state_list.append(translate_state[state])
    126133
     134    # look if on a free node a job is scheduled
     135    #
     136    if state == pbs.ND_free:
     137       if len(node_attr) > 1:
     138          state_list.append(translate_state[pbs_ND_free_and_job])
     139       else:
     140          state_list.append(translate_state[state])
     141    else:
     142          state_list.append(translate_state[state])
     143               
     144               
    127145    re_host = re.compile(r"""
    128146
     
    132150
    133151    result = re_host.search(node.name)
     152    result = None
    134153    if result:
     154      print 'bas'
    135155      node_list.append( result.group('name') )
    136156    else:
Note: See TracChangeset for help on using the changeset viewer.