/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
SiteConfig::SiteConfigPdsf Class Reference
Inheritance diagram for SiteConfig::SiteConfigPdsf:
Inheritance graph
[legend]
Collaboration diagram for SiteConfig::SiteConfigPdsf:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def batchCommand
def jobId
def runSepDir
def runSubDir
def statsRelativeDir
def statsDirectory
def statsSeqFile
def statsInstallPath
def statsSumFile
def statsLockFile
def runLockFile
def figuresDirectory
def figuresPathReplace
def xmlRelativeDir
def xmlDirectory
def xmlIndexFile
def runIndexDir
def runIndexFile
def runIndexLockFile
def logDirectory
def logOutFile
def logErrFile
def batchLogDirectory
def batchLogOutFile
def batchLogErrFile
def batchJobFile
def stateFile
def nuwaDataDirectory
def nuwaDataFile
def reconDirectory
def reconFile
def filesInRun
def loadCatalog

Public Attributes

 nuwaDir
 cmtConfig
 outputDir
 jobLogDir
 statsOffsetDir
 figuresOffsetDir
 xmlOffsetDir
 statsRootDir
 figuresRootDir
 xmlRootDir
 runsXmlDir
 batchExec
 batchLogDir
 stateRootDir
 nuwaDataDir
 batchWrapper
 catalog
 catalogPaths

Detailed Description

Configuration information for a given site 

Definition at line 303 of file SiteConfig.py.


Constructor & Destructor Documentation

def SiteConfig::SiteConfigPdsf::__init__ (   self)
Constructor

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

00306                       :
00307         """Constructor"""
00308         SiteConfig.__init__(self)
00309         #self.nuwaDir="/common/dayabay/releases/NuWa/trunk-opt/NuWa-trunk"
00310         self.nuwaDir="/eliza7/dayabay/scratch/dandwyer/NuWa-trunk-opt"
00311         self.cmtConfig="$CMTCONFIG"
00312         self.outputDir="/project/projectdirs/dayabay/www/dybprod"
00313         self.jobLogDir=self.outputDir+"/logs"
00314         self.statsOffsetDir="diagnostics"
00315         self.figuresOffsetDir="diagnostics"
00316         self.xmlOffsetDir="diagnostics"
00317         self.statsRootDir=self.outputDir+'/'+self.statsOffsetDir
00318         self.figuresRootDir=self.outputDir+'/'+self.figuresOffsetDir
00319         self.xmlRootDir=self.outputDir+'/'+self.xmlOffsetDir
00320         self.runsXmlDir=self.outputDir
00321         self.batchExec="qsub"
00322         self.batchLogDir=self.jobLogDir
00323         self.stateRootDir=self.outputDir+"/state"
00324         self.nuwaDataDir="/eliza16/dayabay/nuwaData/exp"
        

Member Function Documentation

def SiteConfig::SiteConfigPdsf::batchCommand (   self,
  batchArgs,
  jobName,
  runNumber,
  seqNumber 
)
Construct a batch command

Reimplemented from SiteConfig::SiteConfig.

Definition at line 325 of file SiteConfig.py.

00326                                                                     :
00327         """Construct a batch command"""
00328         import os
00329         pid = os.getpid()
00330         jobId = "%s_%d" % (jobName[:2],runNumber)
00331         if seqNumber:
00332             jobId += "_%d" % seqNumber
00333         batchCommand = "%(exec)s -o %(outlog)s -e %(errlog)s -N %(jobId)s " % {
00334             'exec':self.batchExec,
00335             'outlog':self.batchLogOutFile(jobName, runNumber, seqNumber),
00336             'errlog':self.batchLogErrFile(jobName, runNumber, seqNumber),
00337             'jobId':jobId}
00338         batchCommand += "%(wrapper)s %(nuwaDir)s %(cmtConfig)s " % {
00339             'wrapper':self.batchWrapper,
00340             'nuwaDir':self.nuwaDir,
00341             'cmtConfig':self.cmtConfig
00342             }
00343         batchCommand += "'runProcess.py %(args)s'" % {
00344             'args': ' '.join(batchArgs) }  
00345         return batchCommand

def SiteConfig::SiteConfig::jobId (   self,
  jobName = None,
  runNumber = None,
  seqNumber = None 
) [inherited]
Return a string to identify the job 

Definition at line 43 of file SiteConfig.py.

00044                                                                  :
00045         """ Return a string to identify the job """
00046         jobId = ""
00047         if jobName:
00048             jobId += jobName
00049         else:
00050             jobId += "noname"
00051         if runNumber:
00052             jobId += "_run%07d" % runNumber
00053         if seqNumber:
00054             jobId += "_seq%04d" % seqNumber
00055         return jobId
        
def SiteConfig::SiteConfig::runSepDir (   self,
  runNumber 
) [inherited]
Make an appropriate structure for run subdirectories

Definition at line 61 of file SiteConfig.py.

00062                                   :
00063         """Make an appropriate structure for run subdirectories"""
00064         # group runs into subdirectories of 1000/100
00065         runK = runNumber / 1000
00066         runH = runNumber / 100
00067         return "runs_%04d000/runs_%05d00" % (runK, runH)

def SiteConfig::SiteConfig::runSubDir (   self,
  runNumber 
) [inherited]
Return run subpath + directory

Definition at line 68 of file SiteConfig.py.

00069                                   :
00070         """Return run subpath + directory"""
00071         return self.runSepDir(runNumber)+"/run_%07d" % runNumber

def SiteConfig::SiteConfig::statsRelativeDir (   self,
  runNumber 
) [inherited]
Construct the relative path of the root files from the index

Definition at line 72 of file SiteConfig.py.

00073                                          :
00074         """Construct the relative path of the root files from the index"""
00075         return self.runSubDir(runNumber)+"/root"

def SiteConfig::SiteConfig::statsDirectory (   self,
  runNumber 
) [inherited]
Construct the absolute path of the root files from the index

Definition at line 76 of file SiteConfig.py.

00077                                        :
00078         """Construct the absolute path of the root files from the index"""
00079         return self.statsRootDir+"/"+self.statsRelativeDir(runNumber)

def SiteConfig::SiteConfig::statsSeqFile (   self,
  jobName,
  runNumber,
  seqNumber 
) [inherited]
Construct the stats ROOT file path and name

Definition at line 80 of file SiteConfig.py.

00081                                                          :
00082         """Construct the stats ROOT file path and name"""
00083         filename = "%s.root" % self.jobId(jobName, runNumber, seqNumber)
00084         return self.statsDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::statsInstallPath (   self,
  jobName,
  runNumber 
) [inherited]
Construct the relative summed stats ROOT file path and name for index lookup

Definition at line 85 of file SiteConfig.py.

00086                                                   :
00087         """Construct the relative summed stats ROOT file path and name for index lookup"""
00088         filename = "%s_total.root" % self.jobId(jobName, runNumber)
00089         return self.statsOffsetDir+'/'+self.statsRelativeDir(runNumber)+"/"+filename

def SiteConfig::SiteConfig::statsSumFile (   self,
  jobName,
  runNumber 
) [inherited]
Construct the summed stats ROOT file path and name

Definition at line 90 of file SiteConfig.py.

00091                                               :
00092         """Construct the summed stats ROOT file path and name"""
00093         filename = "%s_total.root" % self.jobId(jobName, runNumber)
00094         return self.statsDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::statsLockFile (   self,
  jobName,
  runNumber 
) [inherited]
Construct the stats lock file path and name

Definition at line 95 of file SiteConfig.py.

00096                                                :
00097         """Construct the stats lock file path and name"""
00098         filename = "%s_total.lock" % self.jobId(jobName, runNumber)
00099         return self.statsDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::runLockFile (   self,
  runNumber 
) [inherited]
Construct the run summary lock file path and name

Definition at line 100 of file SiteConfig.py.

00101                                     :
00102         """Construct the run summary lock file path and name"""
00103         filename = "run_%07d.lock" % runNumber
00104         return self.xmlRootDir+"/"+self.runSubDir(runNumber)+"/"+filename

def SiteConfig::SiteConfig::figuresDirectory (   self,
  runNumber 
) [inherited]
Construct the figures directory for the given run

Definition at line 105 of file SiteConfig.py.

00106                                          :
00107         """Construct the figures directory for the given run"""
00108         return self.figuresRootDir+"/"+self.runSubDir(runNumber)

def SiteConfig::SiteConfig::figuresPathReplace (   self,
  runNumber 
) [inherited]
Construct the figures directory for the given run

Definition at line 109 of file SiteConfig.py.

00110                                            :
00111         """Construct the figures directory for the given run"""
00112         runPath = "run_%07d" % runNumber
00113         return runPath+","+self.runSubDir(runNumber)

def SiteConfig::SiteConfig::xmlRelativeDir (   self,
  runNumber 
) [inherited]
Construct the xml directory for the given run

Definition at line 114 of file SiteConfig.py.

00115                                        :
00116         """Construct the xml directory for the given run"""
00117         return self.xmlOffsetDir+"/"+self.runSubDir(runNumber)

def SiteConfig::SiteConfig::xmlDirectory (   self,
  runNumber 
) [inherited]
Construct the xml directory for the given run

Definition at line 118 of file SiteConfig.py.

00119                                      :
00120         """Construct the xml directory for the given run"""
00121         return self.outputDir+'/'+self.xmlRelativeDir(runNumber)

def SiteConfig::SiteConfig::xmlIndexFile (   self,
  runNumber 
) [inherited]
Construct the run index file path and name

Definition at line 122 of file SiteConfig.py.

00123                                      :
00124         """Construct the run index file path and name"""
00125         filename = "run_%07d.xml" % runNumber
00126         return self.xmlDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::runIndexDir (   self) [inherited]
Construct the index of all runs file path

Definition at line 127 of file SiteConfig.py.

00128                          :
00129         """Construct the index of all runs file path"""
00130         return self.runsXmlDir

def SiteConfig::SiteConfig::runIndexFile (   self) [inherited]
Construct the index of all runs file path and name

Definition at line 131 of file SiteConfig.py.

00132                           :
00133         """Construct the index of all runs file path and name"""
00134         return self.runIndexDir() + "/runs.xml"

def SiteConfig::SiteConfig::runIndexLockFile (   self) [inherited]
Construct the index of all runs lock file path and name

Definition at line 135 of file SiteConfig.py.

00136                               :
00137         """Construct the index of all runs lock file path and name"""
00138         return self.runsXmlDir + "/runs.lock"

def SiteConfig::SiteConfig::logDirectory (   self,
  runNumber 
) [inherited]
Construct the path for the nuwa log output directory

Definition at line 139 of file SiteConfig.py.

00140                                      :
00141         """Construct the path for the nuwa log output directory"""
00142         return self.jobLogDir+"/"+self.runSepDir(runNumber)

def SiteConfig::SiteConfig::logOutFile (   self,
  jobName,
  runNumber,
  seqNumber = None 
) [inherited]
Construct the path for the nuwa log output file

Definition at line 143 of file SiteConfig.py.

00144                                                             :
00145         """Construct the path for the nuwa log output file"""
00146         import os
00147         filename = "%s_%d.out" % (self.jobId(jobName, runNumber, seqNumber),
00148                                   os.getpid() )
00149         return self.logDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::logErrFile (   self,
  jobName,
  runNumber,
  seqNumber = None 
) [inherited]
Construct the path for the log error file

Definition at line 150 of file SiteConfig.py.

00151                                                             :
00152         """Construct the path for the log error file"""
00153         import os
00154         filename = "%s_%d.err" % (self.jobId(jobName, runNumber, seqNumber),
00155                                   os.getpid() )
00156         return self.logDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::batchLogDirectory (   self,
  runNumber 
) [inherited]
Construct the directory for batch log files

Definition at line 157 of file SiteConfig.py.

00158                                           :
00159         """Construct the directory for batch log files"""
00160         return self.batchLogDir+"/"+self.runSepDir(runNumber)

def SiteConfig::SiteConfig::batchLogOutFile (   self,
  jobName,
  runNumber,
  seqNumber = None 
) [inherited]
Construct the path for the batch log output file

Definition at line 161 of file SiteConfig.py.

00162                                                                  :
00163         """Construct the path for the batch log output file"""
00164         import os
00165         jobId = self.jobId(jobName, runNumber, seqNumber)
00166         filename = "batch_%s_%d.out" % (self.jobId(jobName, runNumber,
00167                                                    seqNumber),
00168                                         os.getpid() )
00169         return self.batchLogDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::batchLogErrFile (   self,
  jobName,
  runNumber,
  seqNumber = None 
) [inherited]
Construct the path for the batch log error file

Definition at line 170 of file SiteConfig.py.

00171                                                                  :
00172         """Construct the path for the batch log error file"""
00173         import os
00174         filename = "batch_%s_%d.err" % (self.jobId(jobName, runNumber,
00175                                                    seqNumber),
00176                                         os.getpid() )
00177         return self.batchLogDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::batchJobFile (   self,
  jobName,
  runNumber,
  seqNumber = None 
) [inherited]
Construct the path for the batch log error file

Definition at line 178 of file SiteConfig.py.

00179                                                               :
00180         """Construct the path for the batch log error file"""
00181         import os
00182         filename = "batch_%s_%d.sh" % (self.jobId(jobName, runNumber,
00183                                                    seqNumber),
00184                                         os.getpid() )
00185         return self.batchLogDirectory(runNumber)+"/"+filename

def SiteConfig::SiteConfig::stateFile (   self,
  jobType,
  jobName,
  runNumber,
  seqNumber 
) [inherited]
Construct the path and filename for logging state of this job

Definition at line 186 of file SiteConfig.py.

00187                                                                :
00188         """Construct the path and filename for logging state of this job"""
00189         filename = "%s_%s.state" % (self.jobId(jobName, runNumber,seqNumber),
00190                                     jobType)
00191         return self.stateRootDir+"/"+self.runSubDir(runNumber)+"/"+filename

def SiteConfig::SiteConfig::nuwaDataDirectory (   self,
  fileName,
  runNumber,
  seqNumber 
) [inherited]
Construct the path for NuWa raw data files (.root)

Definition at line 192 of file SiteConfig.py.

00193                                                                :
00194         """Construct the path for NuWa raw data files (.root)"""
00195         fileOnly = fileName.split('/')[-1]
00196         category = fileOnly.split('.')[1]
00197         return self.nuwaDataDir+"/"+category+"/daq/"+self.runSubDir(runNumber)

def SiteConfig::SiteConfig::nuwaDataFile (   self,
  fileName,
  runNumber,
  seqNumber 
) [inherited]
Construct the path and filename for NuWa raw data files (.root)

Definition at line 198 of file SiteConfig.py.

00199                                                           :
00200         """Construct the path and filename for NuWa raw data files (.root)"""
00201         fileOnly = fileName.split('/')[-1]
00202         if fileOnly.endswith(".data"):
00203             fileOnly = fileOnly[:-5]+".root"
00204         if not fileOnly.startswith("daq."):            
00205             fileOnly = "daq."+fileOnly.partition('.')[2]
00206         return self.nuwaDataDirectory(fileName, runNumber, seqNumber)+"/"+fileOnly

def SiteConfig::SiteConfig::reconDirectory (   self,
  fileName,
  runNumber,
  seqNumber 
) [inherited]
Construct the path for NuWa raw data files (.root)

Definition at line 207 of file SiteConfig.py.

00208                                                             :
00209         """Construct the path for NuWa raw data files (.root)"""
00210         fileOnly = fileName.split('/')[-1]
00211         category = fileOnly.split('.')[1]
00212         return self.nuwaDataDir+"/"+category+"/recon/"+self.runSubDir(runNumber)

def SiteConfig::SiteConfig::reconFile (   self,
  jobName,
  fileName,
  runNumber,
  seqNumber 
) [inherited]
Construct the path and filename for NuWa raw data files (.root)

Definition at line 213 of file SiteConfig.py.

00214                                                                 :
00215         """Construct the path and filename for NuWa raw data files (.root)"""
00216         fileOnly = fileName.split('/')[-1]
00217         fileTokens = fileOnly.split('.')
00218         fileTokens[0] = 'recon'
00219         fileTokens[1] = jobName
00220         fileTokens[-1] = 'root'
00221         reconFileName = '.'.join(fileTokens)
00222         return self.reconDirectory(fileName, runNumber, seqNumber)+"/"+reconFileName

def SiteConfig::SiteConfig::filesInRun (   self,
  runNumber 
) [inherited]
Return the files (with full local path) given this run number

Definition at line 223 of file SiteConfig.py.

00224                                    :
00225         """Return the files (with full local path) given this run number"""
00226         if not self.catalog:
00227             self.loadCatalog()
00228         fileList = []
00229         try:
00230             fileList = self.catalog.runs[runNumber]
00231         except KeyError:
00232            print "SiteConfig: No files in run ", runNumber
00233         return fileList
           
def SiteConfig::SiteConfig::loadCatalog (   self) [inherited]
Load file Catalog entries

Definition at line 234 of file SiteConfig.py.

00235                          :
00236         """Load file Catalog entries"""
00237         if self.catalogPaths:
00238             # Mimic catalog by loading files from directories
00239             self.catalog = CatalogProxy()
00240             import os
00241             for path in self.catalogPaths:
00242                 if not os.path.isdir(path):
00243                     print "SiteConfig: Skipping invalid catalog path: ", path
00244                     continue
00245                 print "SiteConfig: Loading files from path: ", path
00246                 entries = os.listdir(path)
00247                 for entry in entries:
00248                     if len(entry)<6:
00249                         continue
00250                     if entry[-5:]!='.root' and entry[-5:]!='.data':
00251                         continue
00252                     fileDesc = FileDescription(entry)
00253                     if not fileDesc.isValid:
00254                         continue
00255                     if not self.catalog.runs.has_key(fileDesc.runNumber):
00256                         # Add new run
00257                         self.catalog.runs[fileDesc.runNumber] = []
00258                     # Add file to run catalog
00259                     self.catalog.runs[fileDesc.runNumber].append( path+'/'+entry )
00260                     self.catalog.runs[fileDesc.runNumber].sort()
00261         else:    
00262             # Use standard catalog
00263             import DybPython.Catalog as Catalog
00264             self.catalog = Catalog
00265         return    
                

Member Data Documentation

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Reimplemented from SiteConfig::SiteConfig.

Definition at line 305 of file SiteConfig.py.

Definition at line 19 of file SiteConfig.py.

Definition at line 19 of file SiteConfig.py.

Definition at line 19 of file SiteConfig.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:54:05 for ProcessManager by doxygen 1.7.4