CMS 3D CMS Logo

Public Member Functions | Public Attributes

MatrixRunner::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 10 of file MatrixRunner.py.


Constructor & Destructor Documentation

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

Definition at line 12 of file MatrixRunner.py.

00013                                             :
00014 
00015         self.workFlows = wfIn
00016 
00017         self.threadList = []
00018         self.maxThreads = int(nThrMax) # make sure we get a number ...
00019 


Member Function Documentation

def MatrixRunner::MatrixRunner::activeThreads (   self)

Definition at line 20 of file MatrixRunner.py.

00021                            :
00022 
00023         nActive = 0
00024         for t in self.threadList:
00025             if t.isAlive() : nActive += 1
00026 
00027         return nActive
00028 
        
def MatrixRunner::MatrixRunner::runTests (   self,
  testList = None 
)

Definition at line 29 of file MatrixRunner.py.

00030                                      :
00031 
00032         startDir = os.getcwd()
00033 
00034         report=''       
00035         if self.maxThreads == 0:
00036             print 'resetting to default number of threads'
00037             self.maxThreads=4
00038 
00039         print 'Running in %s thread(s)' % self.maxThreads
00040 
00041             
00042         for wf in self.workFlows:
00043 
00044             if testList and float(wf.numId) not in [float(x) for x in testList]: continue
00045 
00046             item = wf.nameId
00047             if os.path.islink(item) : continue # ignore symlinks
00048             
00049             # make sure we don't run more than the allowed number of threads:
00050             while self.activeThreads() >= self.maxThreads:
00051                 time.sleep(10)
00052                 continue
00053             
00054             print '\nPreparing to run %s %s' % (wf.numId, item)
          

Member Data Documentation

Definition at line 12 of file MatrixRunner.py.

Definition at line 12 of file MatrixRunner.py.

Definition at line 12 of file MatrixRunner.py.