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.3 by nmohr, Mon Sep 17 19:06:15 2012 UTC vs.
Revision 1.6 by nmohr, Thu Sep 20 18:20:00 2012 UTC

# Line 1 | Line 1
1   #! /usr/bin/env python
2 < import os,time,subprocess
3 < energy='8TeV'
4 < #energy='7TeV'
2 > import os,sys,pickle,subprocess
3 > from optparse import OptionParser
4 > from BetterConfigParser import BetterConfigParser
5 > from samplesclass import sample
6  
7 < def submit(job,en):
8 <        command = 'qsub -q all.q -N %s_%s -o /shome/nmohr/VHbbAnalysis/LOG/%s.out -e /shome/nmohr/VHbbAnalysis/LOG/%s.err runAll.sh %s %s' %(job,en,job,job,job,en)
7 > parser = OptionParser()
8 > parser.add_option("-T", "--tag", dest="tag", default="",
9 >                      help="Tag to run the analysis with, example '8TeV' uses config8TeV and pathConfig8TeV to run the analysis")
10 >
11 > (opts, args) = parser.parse_args(sys.argv)
12 > if opts.tag == "":
13 >        print "Please provide tag to run the analysis with, example '-T 8TeV' uses config8TeV and pathConfig8TeV to run the analysis."
14 >        sys.exit(123)
15 > en = opts.tag
16 > configs = ['config%s'%(en),'pathConfig%s'%(en)]
17 > print configs
18 > config = BetterConfigParser()
19 > config.read(configs)
20 > logPath = config.get("Directories","logpath")
21 > repDict = {'en':en,'logpath':logPath,'job':''}
22 > def submit(job,repDict):
23 >        repDict['job'] = job
24 >        command = 'qsub -V -cwd -q all.q -N %(job)s_%(en)s -o %(logpath)s/%(job)s_%(en)s.out -e %(logpath)s/%(job)s_%(en)s.err runAll.sh %(job)s %(en)s' %repDict
25          print command
26          subprocess.call([command], shell=True)
27  
28 < theJobs = ['ZH110','ZH125','ZH120','DY','ZH115','ZH130','ZH135','ZZ','DY120','Zmm','ST_s','TT','Zee','STbar_s','STbar_t','WZ','WW','STbar_tW','ST_tW']
29 < if energy=='8TeV':
30 <        theJobs = ['ZH110','ZH125','ZH120','DY','DY5070','DY70100','DY100','ZH115','ZH130','ZH135','ZZ','DY120','Zmm','ST_s','TT','Zee','STbar_s','STbar_t','WZ','WW','STbar_tW','ST_tW']
31 <
28 > path = config.get("Directories","samplepath")
29 > infofile = open(path+'/env/samples.info','r')
30 > info = pickle.load(infofile)
31 > infofile.close()
32  
33 < for job in theJobs:
34 <        submit(job,energy)
18 <        #time.sleep(10)
33 > for job in info:
34 >        submit(job.name,repDict)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines