CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
runTheMatrix_dev.MatrixRunner Class Reference
Inheritance diagram for runTheMatrix_dev.MatrixRunner:

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.

547  def __init__(self, wfIn=None, nThrMax=8):
549  self.workFlows = wfIn
551  self.threadList = []
552  self.maxThreads = int(nThrMax) # make sure we get a number ...
553 

Member Function Documentation

def runTheMatrix_dev.MatrixRunner.activeThreads (   self)

Definition at line 554 of file runTheMatrix_dev.py.

References runTheMatrix.MatrixRunner.threadList, and runTheMatrix_dev.MatrixRunner.threadList.

Referenced by addOnTests.StandardTester.runTests(), runTheMatrix_dev.MatrixRunner.runTests(), and addOnTests.StandardTester.upload().

555  def activeThreads(self):
556 
557  nActive = 0
558  for t in self.threadList:
559  if t.isAlive() : nActive += 1
560 
561  return nActive
562 
def runTheMatrix_dev.MatrixRunner.runTests (   self,
  testList = None 
)

Definition at line 563 of file runTheMatrix_dev.py.

References runTheMatrix.MatrixRunner.activeThreads(), runTheMatrix_dev.MatrixRunner.activeThreads(), runTheMatrix.MatrixRunner.maxThreads, runTheMatrix_dev.MatrixRunner.maxThreads, runTheMatrix.MatrixReader.workFlows, runTheMatrix_dev.MatrixReader.workFlows, runTheMatrix.MatrixRunner.workFlows, and runTheMatrix_dev.MatrixRunner.workFlows.

564  def runTests(self, testList=None):
565 
566  startDir = os.getcwd()
567 
568  # make sure we have a way to set the environment in the threads ...
569  if not os.environ.has_key('CMS_PATH'):
570  cmsPath = '/afs/cern.ch/cms'
571  print "setting default for CMS_PATH to", cmsPath
572  os.environ['CMS_PATH'] = cmsPath
573 
574  report=''
575  print 'Running in %s thread(s)' % self.maxThreads
576 
577  for wf in self.workFlows:
578 
579  if testList and float(wf.numId) not in [float(x) for x in testList]: continue
580 
581  item = wf.nameId
582  if os.path.islink(item) : continue # ignore symlinks
583 
584  # make sure we don't run more than the allowed number of threads:
585  while self.activeThreads() >= self.maxThreads:
586  time.sleep(10)
587  continue
588 
589  print '\nPreparing to run %s %s' % (wf.numId, item)

Member Data Documentation

runTheMatrix_dev.MatrixRunner.maxThreads

Definition at line 551 of file runTheMatrix_dev.py.

Referenced by addOnTests.StandardTester.runTests(), and runTheMatrix_dev.MatrixRunner.runTests().

runTheMatrix_dev.MatrixRunner.threadList

Definition at line 550 of file runTheMatrix_dev.py.

Referenced by addOnTests.StandardTester.activeThreads(), runTheMatrix_dev.MatrixRunner.activeThreads(), and addOnTests.StandardTester.runTests().

runTheMatrix_dev.MatrixRunner.workFlows

Definition at line 548 of file runTheMatrix_dev.py.

Referenced by runTheMatrix_dev.MatrixRunner.runTests().