ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/submitThem.py
(Generate patch)

Comparing UserCode/VHbb/python/submitThem.py (file contents):
Revision 1.33 by nmohr, Thu Feb 28 16:38:49 2013 UTC vs.
Revision 1.34 by nmohr, Thu Feb 28 16:59:09 2013 UTC

# Line 92 | Line 92 | shutil.copyfile(os.path.basename(btagLib
92   shutil.copyfile('/scratch/%s/%s'%(getpass.getuser(),os.path.basename(btagLibrary)),btagLibrary)
93   os.chdir(submitDir)
94   logPath = config.get("Directories","logpath")
95 + logo = open('%s/data/submit.txt' %config.get('Directories','vhbbpath')).readlines()
96 + counter = 0
97 +
98   #check if the logPath exist. If not exit
99   if( not os.path.isdir(logPath) ):
100 <        print 'ERROR: ' + logPath + ': dir not found.'
101 <        print 'ERROR: Create it before submitting '
102 <        print 'Exit'
103 <        sys.exit(-1)
100 >    print 'ERROR: ' + logPath + ': dir not found.'
101 >    print 'ERROR: Create it before submitting '
102 >    print 'Exit'
103 >    sys.exit(-1)
104 >    
105  
106   repDict = {'en':en,'logpath':logPath,'job':'','task':opts.task,'queue': 'all.q','timestamp':timestamp,'additional':'','job_id':''}
107   def submit(job,repDict):
108 <        repDict['job'] = job
109 <        command = 'qsub -V -cwd -q %(queue)s -l h_vmem=6G -N %(job)s_%(en)s%(task)s -o %(logpath)s/%(timestamp)s_%(job)s_%(en)s_%(task)s.out -e %(logpath)s/%(timestamp)s_%(job)s_%(en)s_%(task)s.err runAll.sh %(job)s %(en)s ' %(repDict) + opts.task + ' ' + repDict['job_id'] + ' ' + repDict['additional']
110 <        print command
111 <        subprocess.call([command], shell=True)
108 >    global counter
109 >    repDict['job'] = job
110 >    nJob = counter % len(logo)
111 >    counter += 1
112 >    if opts.philipp_love_progress_bars:
113 >        repDict['name'] = '"%s"' %logo[nJob].strip()
114 >    else:
115 >        repDict['name'] = '%(job)s_%(en)s%(task)s' %repDict
116 >    command = 'qsub -V -cwd -q %(queue)s -l h_vmem=6G -N %(name)s -o %(logpath)s/%(timestamp)s_%(job)s_%(en)s_%(task)s.out -e %(logpath)s/%(timestamp)s_%(job)s_%(en)s_%(task)s.err runAll.sh %(job)s %(en)s ' %(repDict) + opts.task + ' ' + repDict['job_id'] + ' ' + repDict['additional']
117 >    print command
118 >    subprocess.call([command], shell=True)
119  
120   if opts.task == 'train':
121      train_list = (config.get('MVALists','List_for_submitscript')).split(',')
# Line 157 | Line 168 | elif opts.task == 'sys' or opts.task ==
168      info = ParseInfo(samplesinfo,path)
169      if ( opts.samples == ""):
170          for job in info:
171 <            if (job.subsample): continue #avoid multiple submissions form subsamples
172 <            # TO FIX FOR SPLITTED SAMPLE
171 >            if (job.subsample):
172 >                continue #avoid multiple submissions form subsamples
173 >            # TO FIX FOR SPLITTED SAMPLE
174              submit(job.name,repDict)
175      else:
176          for sample in samplesList:
# Line 170 | Line 182 | elif opts.task == 'eval':
182      info = ParseInfo(samplesinfo,path)
183      if ( opts.samples == ""):
184          for job in info:
185 <            if (job.subsample): continue #avoid multiple submissions from subsamples
186 <            if(info.checkSplittedSampleName(job.identifier)): # if multiple entries for one name  (splitted samples) use the identifier to submit
187 <                    print '@INFO: Splitted samples: submit through identifier'
188 <                    submit(job.identifier,repDict)
189 <            else: submit(job.name,repDict)
185 >            if (job.subsample):
186 >                continue #avoid multiple submissions from subsamples
187 >            if(info.checkSplittedSampleName(job.identifier)): # if multiple entries for one name  (splitted samples) use the identifier to submit
188 >                print '@INFO: Splitted samples: submit through identifier'
189 >                submit(job.identifier,repDict)
190 >            else: submit(job.name,repDict)
191      else:
192          for sample in samplesList:
193              submit(sample,repDict)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines