22 |
|
print "Jobs left:"+str(len(joblist))+" / "+str(len(jobnumbers)) |
23 |
|
|
24 |
|
def printUsage(): |
25 |
< |
print "Please provide the following two argument: total number of jobs" |
25 |
> |
print "Please provide the following argument: total number of jobs" |
26 |
|
|
27 |
|
if(len(sys.argv) != 2 or sys.argv[1] == "-h"): |
28 |
|
printUsage() |
32 |
|
fusecommand="hadd -f output/all_systematics.root" |
33 |
|
path=str(os.path.abspath(os.curdir)) |
34 |
|
path=path.replace("/","\/"); |
35 |
< |
confcommand="cat Source/calcSys.sh_template | sed 's/SETJZBCUT/"+str(sys.argv[1])+"/' | sed 's/SETNJOBS/"+str(sys.argv[1])+"/' | sed 's/THISDIR/"+str(path)+"/' > output/calcLim.sh" |
35 |
> |
confcommand="cat Source/calcSys.sh_template | sed 's/SETJZBCUT/"+str(sys.argv[1])+"/' | sed 's/SETNJOBS/"+str(sys.argv[1])+"/' | sed 's/THISDIR/"+str(path)+"/' > output/calcSys.sh" |
36 |
|
commands.getoutput(confcommand) |
37 |
|
for ijob in range(0,int(sys.argv[1])): |
38 |
< |
pipe=popen("qsub -e /tmp/ -o /tmp/ -N " + "LimCalc"+str(ijob)+ " " + os.curdir + "/output/calcLim.sh"+ " "+str(ijob)) |
38 |
> |
pipe=popen("qsub -e /tmp/ -o /tmp/ -N " + "SysCalc"+str(ijob)+ " " + os.curdir + "/output/calcSys.sh"+ " "+str(ijob)) |
39 |
|
for l in pipe.readlines(): |
40 |
|
if l.find("Your job")>-1: |
41 |
|
thisjobnumber=int(l[l.index('job ')+4:l.index(' (')]) |