Changeset 253


Ignore:
Timestamp:
04/26/06 17:02:12 (18 years ago)
Author:
bastiaans
Message:

CHANGELOG:

  • lost commit

jobmond/jobmond.py:

  • changed job metric fragmenting. jobinfo fragmented over multiple metrics is now actually WORKING. and there are no more bugs on very big jobs (with lots of nodes)

web/addons/job_monarch/libtoga.php:

  • also read metric increment now
  • changed node assignment to job for new metric fragmentation
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r249 r253  
    44
    55                - fixed: misc. layout bugs for overview & search
     6                - fixed: bug that occured when calculating the number of nodes when there
     7                         was more than one job running on a machine
     8
    69                - changed: column requested memory is now optional through conf.php
    710                - changed: search and overview tables are now full screen (100%)
    811                - changed: overview jobnames are now cutoff at max 9 characters
    912                           to prevent (layout) scews in the tables
     13                - changed: overview graphs are no longer downsized
     14
    1015                - added: (optional) column 'queued' (since) in overview
    1116                - added: search results (can) now have a SEARCH_RESULT_LIMIT
    12                          this increases performance of the database significantly!
     17                         this increases performance of the query's significantly!
     18                - added: date/time format as displayed is now configurable through conf.php
    1319
    1420        jobmond)
     
    1824        documentation)
    1925
    20                 - fixed: e-mail adress in INSTALL
     26                - fixed: wrong e-mail adress in INSTALL (doh!)
    2127
    22280.1.0:
  • trunk/jobmond/jobmond.py

    r244 r253  
    112112import time, os, socket, string, re
    113113
     114METRIC_MAX_VAL_LEN = 900
     115
    114116class DataProcessor:
    115117        """Class for processing of data"""
     
    130132                # DMAX=0 means eternal life.'
    131133
    132                 self.dmax = str( int( int( TORQUE_POLL_INTERVAL ) + 2 ) )
     134                self.dmax = str( int( int( TORQUE_POLL_INTERVAL ) * 2 ) )
    133135
    134136                try:
     
    349351
    350352                        myAttrs = { }
    351                         myAttrs['name'] = name
    352                         myAttrs['queue'] = queue
    353                         myAttrs['owner'] = owner
    354                         myAttrs['requested_time'] = requested_time
    355                         myAttrs['requested_memory'] = requested_memory
    356                         myAttrs['ppn'] = ppn
    357                         myAttrs['status'] = status
    358                         myAttrs['start_timestamp'] = start_timestamp
    359                         myAttrs['queued_timestamp'] = queued_timestamp
     353                        myAttrs['name'] = str( name )
     354                        myAttrs['queue'] = str( queue )
     355                        myAttrs['owner'] = str( owner )
     356                        myAttrs['requested_time'] = str( requested_time )
     357                        myAttrs['requested_memory'] = str( requested_memory )
     358                        myAttrs['ppn'] = str( ppn )
     359                        myAttrs['status'] = str( status )
     360                        myAttrs['start_timestamp'] = str( start_timestamp )
     361                        myAttrs['queued_timestamp'] = str( queued_timestamp )
    360362                        myAttrs['reported'] = str( int( int( self.cur_time ) + int( self.timeoffset ) ) )
    361363                        myAttrs['nodes'] = nodeslist
    362364                        myAttrs['domain'] = string.join( socket.getfqdn().split( '.' )[1:], '.' )
    363                         myAttrs['poll_interval'] = TORQUE_POLL_INTERVAL
     365                        myAttrs['poll_interval'] = str( TORQUE_POLL_INTERVAL )
    364366
    365367                        if self.jobDataChanged( jobs, job_id, myAttrs ) and myAttrs['status'] in [ 'R', 'Q' ]:
     
    389391                        gmetric_val = self.compileGmetricVal( jobid, jobattrs )
    390392
     393                        metric_increment = 0
     394
    391395                        for val in gmetric_val:
    392                                 self.dp.multicastGmetric( 'MONARCH-JOB-' + jobid, val )
    393 
    394         def makeNodeString( self, nodelist ):
    395                 """Make one big string of all hosts"""
    396 
    397                 node_str = None
    398 
    399                 for node in nodelist:
    400                         if not node_str:
    401                                 node_str = node
    402                         else:
    403                                 node_str = node_str + ';' + node
    404 
    405                 return node_str
     396                                self.dp.multicastGmetric( 'MONARCH-JOB-' + jobid + '-' + str(metric_increment), val )
     397                                metric_increment = metric_increment + 1
    406398
    407399        def compileGmetricVal( self, jobid, jobattrs ):
    408400                """Create a val string for gmetric of jobinfo"""
    409401
    410                 appendList = [ ]
    411                 appendList.append( 'name=' + jobattrs['name'] )
    412                 appendList.append( 'queue=' + jobattrs['queue'] )
    413                 appendList.append( 'owner=' + jobattrs['owner'] )
    414                 appendList.append( 'requested_time=' + jobattrs['requested_time'] )
    415 
    416                 if jobattrs['requested_memory'] != '':
    417                         appendList.append( 'requested_memory=' + jobattrs['requested_memory'] )
    418 
    419                 if jobattrs['ppn'] != '':
    420                         appendList.append( 'ppn=' + jobattrs['ppn'] )
    421 
    422                 appendList.append( 'status=' + jobattrs['status'] )
    423 
    424                 if jobattrs['start_timestamp'] != '':
    425                         appendList.append( 'start_timestamp=' + jobattrs['start_timestamp'] )
    426                        
    427                 if jobattrs['queued_timestamp'] != '':
    428                         appendList.append( 'queued_timestamp=' + jobattrs['queued_timestamp'] )
    429 
    430                 appendList.append( 'reported=' + jobattrs['reported'] )
    431                 appendList.append( 'poll_interval=' + str( jobattrs['poll_interval'] ) )
    432                 appendList.append( 'domain=' + jobattrs['domain'] )
    433 
    434                 if jobattrs['status'] == 'R':
    435                         if len( jobattrs['nodes'] ) > 0:
    436                                 appendList.append( 'nodes=' + self.makeNodeString( jobattrs['nodes'] ) )
    437                 elif jobattrs['status'] == 'Q':
    438                         appendList.append( 'nodes=' + str(jobattrs['nodes']) )
    439 
    440                 return self.makeAppendLists( appendList )
    441 
    442         def makeAppendLists( self, append_list ):
    443                 """
    444                 Divide all values from append_list over strings with a maximum
    445                 size of 1400
    446                 """
    447 
    448                 app_lists = [ ]
     402                gval_lists = [ ]
    449403
    450404                mystr = None
    451405
    452                 for val in append_list:
    453 
    454                         if not mystr:
    455                                 mystr = val
    456                         else:
    457                                 if not self.checkValAppendMaxSize( mystr, val ):
    458                                         mystr = mystr + ' ' + val
     406                val_list = { }
     407
     408                for val_name, val_value in jobattrs.items():
     409
     410                        val_list_names_len      = len( string.join( val_list.keys() ) ) + len(val_list.keys())
     411                        val_list_vals_len       = len( string.join( val_list.values() ) ) + len(val_list.values())
     412
     413                        if (val_name != 'nodes' and val_value != '') or (val_name == 'nodes' and jobattrs['status'] == 'Q'):
     414
     415                                if (val_list_names_len + len(val_name) ) + (val_list_vals_len + len(str(val_value)) ) > METRIC_MAX_VAL_LEN:
     416
     417                                        gval_lists.append( val_list )
     418                                        val_list = { }
     419
     420                                val_list[ val_name ] = val_value
     421
     422                        elif val_name == 'nodes' and jobattrs['status'] == 'R':
     423
     424                                node_str = None
     425
     426                                for node in val_value:
     427
     428                                        if node_str:
     429                                                node_str = node_str + ';' + node
     430                                        else:
     431                                                node_str = node
     432
     433                                        if (val_list_names_len + len(val_name) ) + (val_list_vals_len + len(node_str) ) > METRIC_MAX_VAL_LEN:
     434
     435                                                val_list[ val_name ] = node_str
     436                                                gval_lists.append( val_list )
     437                                                val_list = { }
     438                                                node_str = None
     439
     440                                val_list[ val_name ] = node_str
     441                                gval_lists.append( val_list )
     442                                val_list = { }
     443
     444                str_list = [ ]
     445
     446                for val_list in gval_lists:
     447
     448                        my_val_str = None
     449
     450                        for val_name, val_value in val_list.items():
     451
     452                                if my_val_str:
     453
     454                                        my_val_str = my_val_str + ' ' + val_name + '=' + val_value
    459455                                else:
    460                                         # Too big, new appenlist
    461                                         app_lists.append( mystr )
    462                                         mystr = val
    463 
    464                 app_lists.append( mystr )
    465 
    466                 return app_lists
    467 
    468         def checkValAppendMaxSize( self, val, text ):
    469                 """Check if val + text size is not above 1400 (max msg size)"""
    470 
    471                 # Max frame size of a udp datagram is 1500 bytes
    472                 # removing misc header and gmetric stuff leaves about 1300 bytes
    473                 #
    474                 if len( val + text ) > 900:
    475                         return 1
    476                 else:
    477                         return 0
     456                                        my_val_str = val_name + '=' + val_value
     457
     458                        str_list.append( my_val_str )
     459
     460                return str_list
    478461
    479462        def printJobs( self, jobs ):
  • trunk/web/addons/job_monarch/libtoga.php

    r251 r253  
    576576                        } else if( strstr( $attrs[NAME], 'MONARCH-JOB' ) ) {
    577577
    578                                 sscanf( $attrs[NAME], 'MONARCH-JOB-%d', $jobid );
     578                                sscanf( $attrs[NAME], 'MONARCH-JOB-%d-%d', $jobid, $monincr );
    579579
    580580                                //printf( "jobid %s\n", $jobid );
     
    604604                                                        foreach( $mynodes as $node )
    605605
    606                                                                 $jobs[$jobid][$toganame][] = $node;
     606                                                                if( !in_array( $node, $jobs[$jobid][$toganame] ) )
     607                                                                        $jobs[$jobid][$toganame][] = $node;
    607608
    608609                                                } else if( $jobs[$jobid][status] == 'Q' ) {
Note: See TracChangeset for help on using the changeset viewer.