/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
prodIHEP::SingleJob Class Reference

List of all members.

Public Member Functions

def __init__
def makeOutputName
def recJob
def fillBkk

Public Attributes

 inputname
 options
 fileyear
 filedate
 filename
 inputpath
 streamtype
 runnum
 runtype
 sitedet
 site
 findex
 failed_path
 job_path
 rec_name
 minirec_name
 job_name
 log_name
 sem_name
 valid_name
 odm_name

Detailed Description

Definition at line 278 of file prodIHEP.py.


Constructor & Destructor Documentation

def prodIHEP::SingleJob::__init__ (   self,
  inputname,
  options 
)

Definition at line 280 of file prodIHEP.py.

00281                                         :
00282 
00283         self.inputname = inputname
00284         self.options = options
00285 
00286         if self.options.debug > 0:
00287             print '-------- This is a new job for: %s --------' % inputname.split('/')[-1]


Member Function Documentation

def prodIHEP::SingleJob::makeOutputName (   self)

Definition at line 288 of file prodIHEP.py.

00289                             :
00290 
00291         words = []
00292         if self.inputname[0:7] == '/besfs2':
00293             words = self.inputname[7:].split('/')
00294         else:
00295             words = self.inputname.split('/')
00296         self.fileyear = words[7]
00297         self.filedate = words[10]
00298         self.filename = words[11]
00299         self.inputpath = '/'.join(words[0:-1])
00300 
00301         namelist = self.filename.split('.')
00302         self.streamtype = namelist[1]
00303         self.runnum = int(namelist[2])
00304         self.runtype = namelist[3]
00305         self.sitedet = namelist[4]
00306         self.site = self.sitedet.split('-')[0]
00307         self.findex = int(namelist[6][1:])
00308 
00309         #if self.options.debug > 0:
00310             #print 'Input file path: %s' % self.inputpath
00311             #print 'Year:%s,date:%s,run:%s,file:%s,site-det:%s,steam-type:%s,run-type:%s' \
00312             #        % (self.fileyear,self.filedate,self.runnum,self.findex,\
00313             #        self.sitedet,self.streamtype,self.runtype)
00314 
00315         # output file name
00316         namelist[7] = 'root'
00317         namelist[0] = 'recon'
00318         namelist[5] = self.options.data_type + '-I'
00319         recname = '.'.join(namelist)
00320         namelist[7] = 'log'
00321         logname = '.'.join(namelist)
00322         namelist[7] = 'sem'
00323         semname = '.'.join(namelist)
00324         namelist[0] = 'minirecon'
00325         namelist[7] = 'root'
00326         minirecname = '.'.join(namelist)
00327 
00328         job_path_base = self.options.job_path + self.options.data_type + '/'
00329         rec_path_base = self.options.rec_path + self.options.data_type + '/'
00330 
00331         if self.options.query:
00332             rec_path_base = '/dybfs/rec/' + self.options.data_type + '/'
00333             if(self.options.data_type=="KUP11A"):
00334                 rec_path_base = '/publicfs/dyb/data/rec/' + self.options.data_type + '/'
00335             if(self.options.data_type=="P14A" and self.runnum>=39501):
00336                 rec_path_base = '/publicfs/dyb/data/rec/' + self.options.data_type + '/'
00337 
00338         # output file path
00339         job_path = job_path_base + 'job/' + self.fileyear + '/' + self.filedate + '/'
00340         rec_path = rec_path_base + self.fileyear + '/' + self.filedate + '/'
00341         log_path = job_path_base + 'log/' + self.fileyear + '/' + self.filedate + '/'
00342         val_path = job_path_base + 'validation/'
00343         minirec_path = rec_path
00344         self.failed_path = job_path_base + 'fail_job/'
00345 
00346         # Use run number to define data path since P12C
00347         run1 = '%07d'%self.runnum
00348         run2 = '%07d'%(100*int(self.runnum/100))
00349         run3 = '%07d'%(1000*int(self.runnum/1000))
00350         run_path = 'runs_' + run3 + '/runs_' + run2 + '/run_' + run1 +'/'
00351 
00352         if(self.options.data_type=="P12C" or self.options.data_type=="P12D" \
00353                 or self.options.data_type=="P12E" or self.options.data_type=="P13A" \
00354                 or self.options.data_type=="P14A"):
00355             job_path_base = rec_path_base
00356             job_path = job_path_base + 'job/' + run_path
00357             rec_path = rec_path_base + 'rec/' + run_path
00358             minirec_path = rec_path_base + 'minirec/' + run_path
00359             log_path = job_path_base + 'log/' + run_path
00360             val_path = job_path_base + 'validation/'
00361             self.failed_path = job_path_base + 'fail_job/'
00362 
00363         # output file path and name
00364         self.job_path = job_path
00365         self.rec_name = rec_path + recname
00366         self.minirec_name = minirec_path + minirecname
00367         self.job_name = job_path + 'recjob_' + str(self.runnum) + '_' + str(self.findex) + '.csh'
00368         self.log_name = log_path + logname
00369         self.sem_name = rec_path + semname
00370         self.valid_name = val_path + logname
00371 
00372         # Directory for ODM histograms
00373         #run1 = '%07d'%self.runnum
00374         #run2 = '%07d'%(100*int(self.runnum/100))
00375         #run3 = '%07d'%(1000*int(self.runnum/1000))
00376         #odmhistpath = self.options.odm_path + 'diagnostics/runs_' + run3 + '/runs_' + run2 + '/run_' + run1 + '/root/'
00377         odmhistpath = self.options.odm_path + 'diagnostics/' + run_path + 'root/'
00378         odmname = 'odm_v11_ihep_run' + run1 + '_seq' + '%04d'%self.findex + '.root'
00379         self.odm_name = odmhistpath + odmname
00380 
00381         
00382         if self.options.query and not self.options.missing:
00383             if os.path.isfile(self.rec_name):
00384                 print self.rec_name
00385             else:
00386                 print 'Can not find recon data: %s' %self.rec_name
00387 
00388         if self.options.query and self.options.missing:
00389             if not self.options.sem:
00390                 if not os.path.isfile(self.rec_name):
00391                     print self.inputname
00392             else:
00393                 if not os.path.isfile(self.sem_name):
00394                     print self.inputname
00395 
00396         if self.options.production:
00397             if not os.path.exists(job_path):
00398                 os.makedirs(job_path)
00399             if not os.path.exists(rec_path):
00400                 os.makedirs(rec_path)
00401             if not os.path.exists(minirec_path):
00402                 os.makedirs(minirec_path)
00403             if not os.path.exists(log_path):
00404                 os.makedirs(log_path)
00405             if not os.path.exists(val_path):
00406                 os.makedirs(val_path)
00407             if not os.path.exists(self.failed_path):
00408                 os.makedirs(self.failed_path)
00409             if not os.path.exists(odmhistpath):
00410                 os.makedirs(odmhistpath)
00411 
00412         if self.options.debug > 0:
00413             print 'Recon data: %s' % self.rec_name
00414             print 'Recon job: %s' % self.job_name
00415             print 'Log file: %s' % self.log_name
00416             print 'Odm file: %s' % self.odm_name

def prodIHEP::SingleJob::recJob (   self)

Definition at line 417 of file prodIHEP.py.

00418                     :
00419         #self.makeOutputName()
00420 
00421         runnum = self.runnum
00422         catalog = self.inputpath
00423         findex = self.findex
00424 
00425         fjob = open(self.job_name, 'w')
00426         fjob.write('#!/bin/tcsh\n')
00427         #fjob.write('source /afs/ihep.ac.cn/soft/dayabay/NuWa-64/env/NuWa-trunk/nuwa-opt.tcsh\n')
00428         #if runnum > run_old:
00429         #    fjob.write('source /afs/ihep.ac.cn/soft/dayabay/NuWa-64/env/NuWa-KUP2/nuwa-opt.tcsh\n')
00430         #else:
00431         fjob.write('source /afs/ihep.ac.cn/soft/dayabay/NuWa-64/env/NuWa-' + self.options.nuwa + '/nuwa-opt.tcsh\n')
00432         nuwa_command = '(time nuwa.py --random=off --repack-rpc=off -n -1 '
00433         if self.options.data_type == 'P14A':
00434             nuwa_command = '(time nuwa.py --random=off --repack-rpc=on -n -1 '
00435         if self.options.data_type == 'P12A':
00436             nuwa_command += '-m "SpadeSvc -C p12a -H '
00437             nuwa_command += self.site
00438             nuwa_command += ' -S Neutrino" --dbirollback=\'* = 2012-01-17 00:00:00\' '
00439         elif self.options.data_type == 'P12B':
00440             nuwa_command += '-m "SpadeSvc -C p12b -H '
00441             nuwa_command += self.site
00442             nuwa_command += ' -S Neutrino" --dbirollback=\'* = ' + self.options.dbirollback + '\' '
00443         elif self.options.data_type == 'P12C':
00444             nuwa_command += '-m "SpadeSvc -C p12c -H '
00445             nuwa_command += self.site
00446             nuwa_command += ' -S Neutrino" --dbirollback=\'* = ' + self.options.dbirollback + '\' '
00447         elif self.options.data_type == 'P12D':
00448             nuwa_command += '-l 5 -m "SpadeSvc -C p12d -H '
00449             nuwa_command += self.site
00450             nuwa_command += ' -S Neutrino" --dbirollback=\'* = ' + self.options.dbirollback + '\' '
00451         elif self.options.data_type == 'P12E':
00452             nuwa_command += '-m "SpadeSvc -C p12e -H '
00453             nuwa_command += self.site
00454             nuwa_command += ' -S Neutrino" --dbirollback=\'* = ' + self.options.dbirollback + '\' '
00455         elif self.options.data_type == 'P13A':
00456             nuwa_command += '-m "SpadeSvc -C p13a -H '
00457             nuwa_command += self.site
00458             nuwa_command += ' -S Neutrino" --dbirollback=\'* = ' + self.options.dbirollback + '\' '
00459         elif self.options.data_type == 'P14A':
00460             nuwa_command += '-m "SpadeSvc -C p14a -H '
00461             nuwa_command += self.site
00462             nuwa_command += ' -S Neutrino" --dbirollback=\'* = ' + self.options.dbirollback + '\' '
00463         nuwa_command += '--output-stats="file1:' + self.odm_name
00464         nuwa_command += '" @$KUP11AROOT/share/runReco @$KUP11AROOT/share/runTags '
00465         nuwa_command += '@$KUP11AROOT/share/runODM '
00466         nuwa_command += '@$KUP11AROOT/share/runFilters -o ' + self.rec_name + ' '
00467         nuwa_command += self.inputname + ') >&! ' + self.log_name + '\n'
00468         fjob.write(nuwa_command)
00469         #fjob.write('(time nuwa.py --random=off -n -1 --output-stats="file1:' + self.odm_name + '" @$KUP11AROOT/share/runReco @$KUP11AROOT/share/runTags @$KUP11AROOT/share/runODM @$KUP11AROOT/share/runFilters -o ' + self.rec_name + ' ' + self.inputname + ') >&! ' + self.log_name + '\n')
00470         fjob.write('/afs/ihep.ac.cn/users/d/dyboffline/dyb/production/vallog.py ' + self.log_name + ' > ' + self.valid_name + '\n')
00471         #fjob.write('if( `ls -l ' + self.valid_name + ' | awk \'{print $5}\'` == 0 ) rm ' + self.valid_name + '\n')
00472         fjob.write('if( `ls -l ' + self.valid_name + ' | awk \'{print $5}\'` == 0 ) then\n')
00473         fjob.write('  rm ' + self.valid_name + '\n')
00474         fjob.write('else\n')
00475         fjob.write('  echo ' + self.inputname + ' > ' + self.failed_path + 'job_' + str(runnum) + '_' + str(findex) + '\n')
00476         fjob.write('endif\n')
00477         #fjob.write('/home/dyb/dyboffline/job/P12b/evtNum.py ' + self.inputname + ' ' + self.rec_name + '\n')
00478         if self.options.dq_dump :
00479             fjob.write('source /afs/ihep.ac.cn/users/d/dyboffline/dyb/production/dqdump.csh\n')
00480             fjob.write('$DQDUMPROOT/share/DumpDqChannel.py ' + self.odm_name + '\n')
00481             fjob.write('runProcess.py --cluster=ihep --clear-sequence-dump-dq-all -j odm_v11_ihep -r ' + str(runnum) + ' -s ' + str(findex) + ' --catalog=' + catalog + '\n')
00482             fjob.write('runProcess.py --cluster=ihep --dump-dq-all -j odm_v11_ihep -r ' + str(runnum) + ' -s ' + str(findex) + ' --catalog=' + catalog + '\n')
00483             fjob.write('$DQDUMPROOT/share/DumpDqLivetime.py ' + self.rec_name + '\n')
00484         if self.options.odm :
00485             fjob.write('runProcess.py --cluster=ihep --add-stats -j odm_v11_ihep -r ' + str(runnum) + ' -s ' + str(findex) + ' --catalog=' + catalog + '\n')
00486             fjob.write('runProcess.py --cluster=ihep --summarize-run -j odm_v11_ihep -r ' + str(runnum) + ' --catalog=' + catalog + '\n')
00487         if self.options.minirec:
00488             fjob.write('/afs/ihep.ac.cn/users/d/dyboffline/dyb/production/Rec2Mini ' + self.rec_name + ' ' + self.minirec_name + '\n')
00489         fjob.close()
00490 
00491         # Submit job
00492         if self.options.submit:
00493             os.chdir(self.job_path)
00494             os.system('qsub -q ' + self.options.job_queue + ' ' + self.job_name)
00495             #os.chdir(curpath)

def prodIHEP::SingleJob::fillBkk (   self)

Definition at line 496 of file prodIHEP.py.

00497                      :
00498         pass


Member Data Documentation

Definition at line 280 of file prodIHEP.py.

Definition at line 280 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.py.

Definition at line 288 of file prodIHEP.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:55 for KUP11a by doxygen 1.7.4