CMS 3D CMS Logo

Public Member Functions | Public Attributes

MatrixToProcess::MatrixToProcess Class Reference

List of all members.

Public Member Functions

def __init__
def getConfig
def getKey
def getProcess
def identityTest
def listAll
def load

Public Attributes

 configBuilders
 mrd
 processes
 strict

Detailed Description

Definition at line 4 of file MatrixToProcess.py.


Constructor & Destructor Documentation

def MatrixToProcess::MatrixToProcess::__init__ (   self,
  what = 'standard',
  strict = True 
)

Definition at line 6 of file MatrixToProcess.py.

00007                                                   :
00008         from Configuration.PyReleaseValidation.MatrixReader import MatrixReader
00009         self.mrd = MatrixReader(what,noRun=True)
00010         self.mrd.prepare('all','',None)
00011         self.configBuilders={}
00012         self.processes={}
        self.strict=strict

Member Function Documentation

def MatrixToProcess::MatrixToProcess::getConfig (   self,
  wfNumber,
  step 
)

Definition at line 51 of file MatrixToProcess.py.

00052                                      :
00053         key=self.getKey(wfNumber,step)
00054         if not key in self.configBuilders:   self.getProcess(wfNumber,step)
00055         if not key in self.configBuilders: return None
00056         return self.configBuilders[key].pythonCfgCode

def MatrixToProcess::MatrixToProcess::getKey (   self,
  wfNumber,
  step 
)

Definition at line 13 of file MatrixToProcess.py.

00014                                   :
00015         return str(wfNumber)+':'+str(step)
    
def MatrixToProcess::MatrixToProcess::getProcess (   self,
  wfNumber,
  step 
)

Definition at line 16 of file MatrixToProcess.py.

00017                                       :
00018         key=self.getKey(wfNumber,step)
00019         if not key in self.configBuilders:
00020             self.load(wfNumber,step)
00021         if not key in self.configBuilders:
00022             return None
00023         return self.configBuilders[key].process

def MatrixToProcess::MatrixToProcess::identityTest (   self,
  wfNumber,
  step 
)

Definition at line 57 of file MatrixToProcess.py.

00058                                         :
00059         self.getProcess(wfNumber,step)
00060         key=self.getKey(wfNumber,step)
00061         if not key in self.configBuilders: return None
00062 
00063         cb=self.configBuilders[key]
00064         #need to compare those two for identity
00065         cb.process
00066         cd.pythonCfgCode
00067 
                    
def MatrixToProcess::MatrixToProcess::listAll (   self)

Definition at line 68 of file MatrixToProcess.py.

00069                      :
00070         for wf in self.mrd.workFlows:
00071             step=1
00072             print '---------------------' 
00073             print 'process workflow',wf.numId
00074             print
00075             while self.load(float(wf.numId),step):
00076                 p=self.getProcess(float(wf.numId),step)
00077                 print ', '.join(s.label() for s in p.schedule)
00078                 #print p.outputModules()
00079                 step+=1
00080 
def MatrixToProcess::MatrixToProcess::load (   self,
  wfNumber,
  step 
)

Definition at line 24 of file MatrixToProcess.py.

00025                                 :
00026         from Configuration.PyReleaseValidation.ConfigBuilder import ConfigBuilder
00027         from Configuration.PyReleaseValidation.cmsDriverOptions import OptionsFromCommand
00028         import copy
00029 
00030         if len(self.configBuilders)!=0 and self.strict:
00031             raise Exception('one should never be loading more than one process at a time due to python loading/altering feature')
00032         key=self.getKey(wfNumber,step)
00033         if key in self.configBuilders:
00034             return True
00035         
00036         for wf in self.mrd.workFlows:
00037             if float(wf.numId)!=wfNumber: continue
00038 
00039             if not hasattr(wf,'cmdStep%d'%(step)): continue
00040             if not getattr(wf,'cmdStep%d'%(step)): continue
00041             
00042             command=getattr(wf,'cmdStep%d'%(step))
00043             opt=OptionsFromCommand(command)
00044             if opt:
00045                 cb = ConfigBuilder(opt,with_input=True,with_output=True)
00046                 cb.prepare()
00047                 self.configBuilders[key]=copy.copy(cb)
00048                 return True
00049         print "could not satisfy the request for step",step,"of workflow",wfNumber
00050         return False
                             

Member Data Documentation

Definition at line 6 of file MatrixToProcess.py.

Definition at line 6 of file MatrixToProcess.py.

Definition at line 6 of file MatrixToProcess.py.

Definition at line 6 of file MatrixToProcess.py.