CMS 3D CMS Logo

Public Member Functions | Public Attributes

runTheMatrix_dev::MatrixRunner Class Reference

List of all members.

Public Member Functions

def __init__
def activeThreads
def runTests

Public Attributes

 maxThreads
 threadList
 workFlows

Detailed Description

Definition at line 544 of file runTheMatrix_dev.py.


Constructor & Destructor Documentation

def runTheMatrix_dev::MatrixRunner::__init__ (   self,
  wfIn = None,
  nThrMax = 8 
)

Definition at line 546 of file runTheMatrix_dev.py.

00547                                             :
00548 
00549         self.workFlows = wfIn
00550 
00551         self.threadList = []
00552         self.maxThreads = int(nThrMax) # make sure we get a number ...
00553 


Member Function Documentation

def runTheMatrix_dev::MatrixRunner::activeThreads (   self)

Definition at line 554 of file runTheMatrix_dev.py.

00555                            :
00556 
00557         nActive = 0
00558         for t in self.threadList:
00559             if t.isAlive() : nActive += 1
00560 
00561         return nActive
00562 
        
def runTheMatrix_dev::MatrixRunner::runTests (   self,
  testList = None 
)

Definition at line 563 of file runTheMatrix_dev.py.

00564                                      :
00565 
00566         startDir = os.getcwd()
00567 
00568         # make sure we have a way to set the environment in the threads ...
00569         if not os.environ.has_key('CMS_PATH'):
00570             cmsPath = '/afs/cern.ch/cms'
00571             print "setting default for CMS_PATH to", cmsPath
00572             os.environ['CMS_PATH'] = cmsPath
00573 
00574         report=''       
00575         print 'Running in %s thread(s)' % self.maxThreads
00576                 
00577         for wf in self.workFlows:
00578 
00579             if testList and float(wf.numId) not in [float(x) for x in testList]: continue
00580 
00581             item = wf.nameId
00582             if os.path.islink(item) : continue # ignore symlinks
00583             
00584             # make sure we don't run more than the allowed number of threads:
00585             while self.activeThreads() >= self.maxThreads:
00586                 time.sleep(10)
00587                 continue
00588             
00589             print '\nPreparing to run %s %s' % (wf.numId, item)
          

Member Data Documentation

Definition at line 546 of file runTheMatrix_dev.py.

Definition at line 546 of file runTheMatrix_dev.py.

Definition at line 546 of file runTheMatrix_dev.py.