Changeset 256 for trunk/jobmond
- Timestamp:
- 06/22/06 14:53:16 (18 years ago)
- Location:
- trunk/jobmond
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jobmond/examples/lisa_production.conf
r218 r256 2 2 DEBUG_LEVEL : 0 3 3 DAEMONIZE : 1 4 TORQUE_SERVER : batch-ng.irc.sara.nl 5 TORQUE_POLL_INTERVAL : 10 4 BATCH_API : pbs 5 BATCH_SERVER : batch-ng.irc.sara.nl 6 BATCH_POLL_INTERVAL : 30 6 7 GMOND_CONF : /etc/gmond/lisa_production.conf 7 8 DETECT_TIME_DIFFS : 1 -
trunk/jobmond/examples/lisa_test.conf
r218 r256 2 2 DEBUG_LEVEL : 0 3 3 DAEMONIZE : 1 4 TORQUE_SERVER : gb-r7n15.irc.sara.nl 5 TORQUE_POLL_INTERVAL : 10 4 BATCH_API : pbs 5 BATCH_SERVER : gb-r7n15.irc.sara.nl 6 BATCH_POLL_INTERVAL : 10 6 7 GMOND_CONF : /etc/gmond/lisa_test.conf 7 8 DETECT_TIME_DIFFS : 1 -
trunk/jobmond/jobmond.conf
r224 r256 10 10 DAEMONIZE : 1 11 11 12 # Which Torque server to monitor 12 # What Batch type is the system 13 # 14 # Currently supported: pbs, sge 13 15 # 14 TORQUE_SERVER : localhost 16 BATCH_API : pbs 17 18 # Which Batch server to monitor 19 # 20 BATCH_SERVER : localhost 15 21 16 22 # How many seconds interval for polling of jobs … … 19 25 # end time of a job can be determined 20 26 # 21 TORQUE_POLL_INTERVAL : 1027 BATCH_POLL_INTERVAL : 10 22 28 23 29 # Location of gmond.conf … … 37 43 # Regexp style hostname translation 38 44 # 39 # Usefull if your Torquehostnames are not the same as your45 # Usefull if your Batch hostnames are not the same as your 40 46 # Ganglia hostnames (different network interfaces) 41 47 # -
trunk/jobmond/jobmond.py
r255 r256 90 90 cfg.read( filename ) 91 91 92 global DEBUG_LEVEL, DAEMONIZE, TORQUE_SERVER, TORQUE_POLL_INTERVAL, GMOND_CONF, DETECT_TIME_DIFFS, BATCH_HOST_TRANSLATE92 global DEBUG_LEVEL, DAEMONIZE, BATCH_SERVER, BATCH_POLL_INTERVAL, GMOND_CONF, DETECT_TIME_DIFFS, BATCH_HOST_TRANSLATE, BATCH_API 93 93 94 94 DEBUG_LEVEL = cfg.getint( 'DEFAULT', 'DEBUG_LEVEL' ) … … 96 96 DAEMONIZE = cfg.getboolean( 'DEFAULT', 'DAEMONIZE' ) 97 97 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' ) 101 101 102 102 GMOND_CONF = cfg.get( 'DEFAULT', 'GMOND_CONF' ) … … 106 106 BATCH_HOST_TRANSLATE = getlist( cfg.get( 'DEFAULT', 'BATCH_HOST_TRANSLATE' ) ) 107 107 108 BATCH_API = cfg.get( 'DEFAULT', 'BATCH_API' ) 109 108 110 return True 109 111 110 from PBSQuery import PBSQuery111 112 112 113 import time, os, socket, string, re … … 132 133 # DMAX=0 means eternal life.' 133 134 134 self.dmax = str( int( int( TORQUE_POLL_INTERVAL ) * 2 ) )135 self.dmax = str( int( int( BATCH_POLL_INTERVAL ) * 2 ) ) 135 136 136 137 try: … … 209 210 os.system( cmd ) 210 211 211 class DataGatherer: 212 class 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 224 class PbsDataGatherer: 225 226 """This is the DataGatherer for PBS and Torque""" 212 227 213 228 jobs = { } 229 230 global PBSQuery 214 231 215 232 def __init__( self ): … … 224 241 225 242 self.pq = None 226 if( TORQUE_SERVER ):227 self.pq = PBSQuery( TORQUE_SERVER )243 if( BATCH_SERVER ): 244 self.pq = PBSQuery( BATCH_SERVER ) 228 245 else: 229 246 self.pq = PBSQuery() … … 373 390 myAttrs['nodes'] = nodeslist 374 391 myAttrs['domain'] = string.join( socket.getfqdn().split( '.' )[1:], '.' ) 375 myAttrs['poll_interval'] = str( TORQUE_POLL_INTERVAL )392 myAttrs['poll_interval'] = str( BATCH_POLL_INTERVAL ) 376 393 377 394 if self.jobDataChanged( jobs, job_id, myAttrs ) and myAttrs['status'] in [ 'R', 'Q' ]: … … 534 551 self.jobs = self.getJobData( self.jobs ) 535 552 self.submitJobData( self.jobs ) 536 time.sleep( TORQUE_POLL_INTERVAL )553 time.sleep( BATCH_POLL_INTERVAL ) 537 554 538 555 def printTime( ): … … 550 567 """Application start""" 551 568 569 global PBSQuery 570 552 571 if not processArgs( sys.argv[1:] ): 553 572 sys.exit( 1 ) 554 573 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 556 605 if DAEMONIZE: 557 606 gather.daemon() … … 559 608 gather.run() 560 609 561 # w 00t someone started me610 # wh00t? someone started me! :) 562 611 # 563 612 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.