Changeset 451 for trunk


Ignore:
Timestamp:
02/05/08 15:07:08 (16 years ago)
Author:
bastiaans
Message:

jobmond/jobmond.py:

  • bugfix: ticket #40: numeric_node not initialized properly for each Queued job's noderequest
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jobmond/jobmond.py

    r450 r451  
    732732                        elif status == 'Q':
    733733
     734                                # 'mynodequest' can be a string in the following syntax according to the
     735                                # Torque Administator's manual:
     736                                #
     737                                # {<node_count> | <hostname>}[:ppn=<ppn>][:<property>[:<property>]...][+ ...]
     738                                # {<node_count> | <hostname>}[:ppn=<ppn>][:<property>[:<property>]...][+ ...]
     739                                # etc
     740                                #
     741
     742                                #
     743                                # For now we only count the amount of nodes request and ignore properties
     744                                #
     745
    734746                                start_timestamp         = ''
    735747                                count_mynodes           = 0
    736                                 numeric_node            = 1
    737748
    738749                                for node in mynoderequest.split( '+' ):
    739750
     751                                        # Just grab the {node_count|hostname} part and ignore properties
     752                                        #
    740753                                        nodepart        = node.split( ':' )[0]
    741754
     755                                        # Let's assume a node_count value
     756                                        #
     757                                        numeric_node    = 1
     758
     759                                        # Chop the value up into characters
     760                                        #
    742761                                        for letter in nodepart:
    743762
     763                                                # If this char is not a digit (0-9), this must be a hostname
     764                                                #
    744765                                                if letter not in string.digits:
    745766
    746767                                                        numeric_node    = 0
    747768
     769                                        # If this is a hostname, just count this as one (1) node
     770                                        #
    748771                                        if not numeric_node:
    749772
    750773                                                count_mynodes   = count_mynodes + 1
    751774                                        else:
     775
     776                                                # If this a number, it must be the node_count
     777                                                # and increase our count with it's value
     778                                                #
    752779                                                try:
    753780                                                        count_mynodes   = count_mynodes + int( nodepart )
     
    755782                                                except ValueError, detail:
    756783
     784                                                        # When we arrive here I must be bugged or very confused
     785                                                        # THIS SHOULD NOT HAPPEN!
     786                                                        #
    757787                                                        debug_msg( 10, str( detail ) )
    758788                                                        debug_msg( 10, "Encountered weird node in Resources_List?!" )
Note: See TracChangeset for help on using the changeset viewer.