CMS 3D CMS Logo

Public Member Functions | Public Attributes

runTheMatrix::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 532 of file runTheMatrix.py.


Constructor & Destructor Documentation

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

Definition at line 534 of file runTheMatrix.py.

00535                                             :
00536 
00537         self.workFlows = wfIn
00538 
00539         self.threadList = []
00540         self.maxThreads = int(nThrMax) # make sure we get a number ...
00541 


Member Function Documentation

def runTheMatrix::MatrixRunner::activeThreads (   self)

Definition at line 542 of file runTheMatrix.py.

00543                            :
00544 
00545         nActive = 0
00546         for t in self.threadList:
00547             if t.isAlive() : nActive += 1
00548 
00549         return nActive
00550 
        
def runTheMatrix::MatrixRunner::runTests (   self,
  testList = None 
)

Definition at line 551 of file runTheMatrix.py.

00552                                      :
00553 
00554         startDir = os.getcwd()
00555 
00556         # make sure we have a way to set the environment in the threads ...
00557         if not os.environ.has_key('CMS_PATH'):
00558             cmsPath = '/afs/cern.ch/cms'
00559             print "setting default for CMS_PATH to", cmsPath
00560             os.environ['CMS_PATH'] = cmsPath
00561 
00562         report=''       
00563         print 'Running in %s thread(s)' % self.maxThreads
00564                 
00565         for wf in self.workFlows:
00566 
00567             if testList and float(wf.numId) not in [float(x) for x in testList]: continue
00568 
00569             # don't know yet how to treat real data WF ...
00570             if wf.real : continue
00571 
00572             item = wf.nameId
00573             if os.path.islink(item) : continue # ignore symlinks
00574             
00575             # make sure we don't run more than the allowed number of threads:
00576             while self.activeThreads() >= self.maxThreads:
00577                 time.sleep(10)
00578                 continue
00579             
00580             print '\nPreparing to run %s %s' % (wf.numId, item)
          

Member Data Documentation

Definition at line 534 of file runTheMatrix.py.

Definition at line 534 of file runTheMatrix.py.

Definition at line 534 of file runTheMatrix.py.