Changeset 256 for trunk


Ignore:
Timestamp:
06/22/06 14:53:16 (18 years ago)
Author:
bastiaans
Message:

jobmond/jobmond.conf, jobmond/examples/lisa_production.conf, jobmond/examples/lisa_test.conf:

  • changed: TORQUE_SERVER is now BATCH_SERVER
  • changed: TORQUE_POLL_INTERVAL is now BATCH_POLL_INTERVAL
  • added: BATCH_API to select which api to use for batch system polling

jobmond/jobmond.py:

  • changed DataGatherer? to PbsDataGatherer?
  • changed creation of gather() object: will now select appropriate module and gatherer for each BATCH_API that is supported
Location:
trunk/jobmond
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/jobmond/examples/lisa_production.conf

    r218 r256  
    22DEBUG_LEVEL             : 0
    33DAEMONIZE               : 1
    4 TORQUE_SERVER           : batch-ng.irc.sara.nl
    5 TORQUE_POLL_INTERVAL    : 10
     4BATCH_API               : pbs
     5BATCH_SERVER            : batch-ng.irc.sara.nl
     6BATCH_POLL_INTERVAL     : 30
    67GMOND_CONF              : /etc/gmond/lisa_production.conf
    78DETECT_TIME_DIFFS       : 1
  • trunk/jobmond/examples/lisa_test.conf

    r218 r256  
    22DEBUG_LEVEL             : 0
    33DAEMONIZE               : 1
    4 TORQUE_SERVER           : gb-r7n15.irc.sara.nl
    5 TORQUE_POLL_INTERVAL    : 10
     4BATCH_API               : pbs
     5BATCH_SERVER            : gb-r7n15.irc.sara.nl
     6BATCH_POLL_INTERVAL     : 10
    67GMOND_CONF              : /etc/gmond/lisa_test.conf
    78DETECT_TIME_DIFFS       : 1
  • trunk/jobmond/jobmond.conf

    r224 r256  
    1010DAEMONIZE               : 1
    1111
    12 # Which Torque server to monitor
     12# What Batch type is the system
     13#
     14# Currently supported: pbs, sge
    1315#
    14 TORQUE_SERVER           : localhost
     16BATCH_API               : pbs
     17
     18# Which Batch server to monitor
     19#
     20BATCH_SERVER            : localhost
    1521
    1622# How many seconds interval for polling of jobs
     
    1925# end time of a job can be determined
    2026#
    21 TORQUE_POLL_INTERVAL    : 10
     27BATCH_POLL_INTERVAL     : 10
    2228
    2329# Location of gmond.conf
     
    3743# Regexp style hostname translation
    3844#
    39 # Usefull if your Torque hostnames are not the same as your
     45# Usefull if your Batch hostnames are not the same as your
    4046# Ganglia hostnames (different network interfaces)
    4147#
  • trunk/jobmond/jobmond.py

    r255 r256  
    9090        cfg.read( filename )
    9191
    92         global DEBUG_LEVEL, DAEMONIZE, TORQUE_SERVER, TORQUE_POLL_INTERVAL, GMOND_CONF, DETECT_TIME_DIFFS, BATCH_HOST_TRANSLATE
     92        global DEBUG_LEVEL, DAEMONIZE, BATCH_SERVER, BATCH_POLL_INTERVAL, GMOND_CONF, DETECT_TIME_DIFFS, BATCH_HOST_TRANSLATE, BATCH_API
    9393
    9494        DEBUG_LEVEL = cfg.getint( 'DEFAULT', 'DEBUG_LEVEL' )
     
    9696        DAEMONIZE = cfg.getboolean( 'DEFAULT', 'DAEMONIZE' )
    9797
    98         TORQUE_SERVER = cfg.get( 'DEFAULT', 'TORQUE_SERVER' )
    99 
    100         TORQUE_POLL_INTERVAL = cfg.getint( 'DEFAULT', 'TORQUE_POLL_INTERVAL' )
     98        BATCH_SERVER = cfg.get( 'DEFAULT', 'BATCH_SERVER' )
     99
     100        BATCH_POLL_INTERVAL = cfg.getint( 'DEFAULT', 'BATCH_POLL_INTERVAL' )
    101101
    102102        GMOND_CONF = cfg.get( 'DEFAULT', 'GMOND_CONF' )
     
    106106        BATCH_HOST_TRANSLATE = getlist( cfg.get( 'DEFAULT', 'BATCH_HOST_TRANSLATE' ) )
    107107
     108        BATCH_API = cfg.get( 'DEFAULT', 'BATCH_API' )
     109
    108110        return True
    109111
    110 from PBSQuery import PBSQuery
    111112
    112113import time, os, socket, string, re
     
    132133                # DMAX=0 means eternal life.'
    133134
    134                 self.dmax = str( int( int( TORQUE_POLL_INTERVAL ) * 2 ) )
     135                self.dmax = str( int( int( BATCH_POLL_INTERVAL ) * 2 ) )
    135136
    136137                try:
     
    209210                os.system( cmd )
    210211
    211 class DataGatherer:
     212class SgeDataGatherer:
     213
     214        """Placeholder for Babu Sundaram's SGE implementation"""
     215
     216        def daemon( self ):
     217
     218                pass
     219
     220        def run( self ):
     221
     222                pass
     223
     224class PbsDataGatherer:
     225
     226        """This is the DataGatherer for PBS and Torque"""
    212227
    213228        jobs = { }
     229
     230        global PBSQuery
    214231
    215232        def __init__( self ):
     
    224241
    225242                self.pq = None
    226                 if( TORQUE_SERVER ):
    227                         self.pq = PBSQuery( TORQUE_SERVER )
     243                if( BATCH_SERVER ):
     244                        self.pq = PBSQuery( BATCH_SERVER )
    228245                else:
    229246                        self.pq = PBSQuery()
     
    373390                        myAttrs['nodes'] = nodeslist
    374391                        myAttrs['domain'] = string.join( socket.getfqdn().split( '.' )[1:], '.' )
    375                         myAttrs['poll_interval'] = str( TORQUE_POLL_INTERVAL )
     392                        myAttrs['poll_interval'] = str( BATCH_POLL_INTERVAL )
    376393
    377394                        if self.jobDataChanged( jobs, job_id, myAttrs ) and myAttrs['status'] in [ 'R', 'Q' ]:
     
    534551                        self.jobs = self.getJobData( self.jobs )
    535552                        self.submitJobData( self.jobs )
    536                         time.sleep( TORQUE_POLL_INTERVAL )     
     553                        time.sleep( BATCH_POLL_INTERVAL )       
    537554
    538555def printTime( ):
     
    550567        """Application start"""
    551568
     569        global PBSQuery
     570
    552571        if not processArgs( sys.argv[1:] ):
    553572                sys.exit( 1 )
    554573
    555         gather = DataGatherer()
     574        if BATCH_API == 'pbs':
     575
     576                try:
     577                        from PBSQuery import PBSQuery
     578
     579                except ImportError:
     580
     581                        debug_msg( 0, "fatal error: BATCH_API set to 'pbs' but python module 'pbs_python' is not installed" )
     582                        sys.exit( 1 )
     583
     584                gather = PbsDataGatherer()
     585
     586        elif BATCH_API == 'sge':
     587
     588                pass
     589                # import Babu's code here
     590                #
     591                #try:
     592                #       import sge_drmaa
     593                #
     594                #except ImportError:
     595                #
     596                #       debug_msg( 0, "fatal error: BATCH_API set to 'pbs' but python module 'pbs_python' is not installed' )
     597                #       sys.exit( 1 )
     598                #
     599                #gather = SgeDataGatherer()
     600
     601        else:
     602                debug_msg( 0, "fatal error: unknown BATCH_API '" + BATCH_API + "' is not supported" )
     603                sys.exit( 1 )
     604
    556605        if DAEMONIZE:
    557606                gather.daemon()
     
    559608                gather.run()
    560609
    561 # w00t someone started me
     610# wh00t? someone started me! :)
    562611#
    563612if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.