30 |
|
print "Everything is sent up. Your jobs will be submitted in a minute!" |
31 |
|
|
32 |
|
def lay_out_groundwork(): |
33 |
< |
if os.path.isfile("../last_configuration.C"): |
33 |
> |
if os.path.isfile("../last_configuration.C") and os.path.isfile("../StoredShapes.root"): |
34 |
|
result="fff" |
35 |
|
while(result!="" and result!="new"): |
36 |
|
result="" |
37 |
< |
# result=raw_input("Configuration file exists - would you like to use this one or create a new one? if you want to create a new one, please write new, if you want to use the existing one please either hit enter\n new = generate a new file \n [ENTER] = use existing file: \n") |
37 |
> |
result=raw_input("Configuration file exists - would you like to use this one or create a new one? if you want to create a new one, please write new, if you want to use the existing one please either hit enter\n new = generate a new file \n [ENTER] = use existing file: \n") |
38 |
|
if result=="": |
39 |
|
print "You've hit enter! Using the existing version ... "; |
40 |
|
else: |
45 |
|
|
46 |
|
def do_simple_submit(): |
47 |
|
print "Going to submit "+str(sys.argv[1])+" jobs : " |
48 |
< |
fusecommand="hadd -f output/Asymptotic_Limits.root" |
48 |
> |
fusecommand="hadd -f output/Shape_N_CnC_Limits.root" |
49 |
|
path=str(os.path.abspath(os.curdir)) |
50 |
|
path=path.replace("/","\/"); |
51 |
– |
savearg=(sys.argv[2]).replace("/","\/") |
51 |
|
confcommand="cat Source/ShapeLimWorker.sh_template | sed 's/SETJZBCUT/"+str(sys.argv[1])+"/' | sed 's/SETNJOBS/"+str(sys.argv[1])+"/' | sed 's/THISDIR/"+str(path)+"/' > output/ShapeLimWorker.sh" |
52 |
< |
print confcommand |
52 |
> |
# print confcommand |
53 |
|
commands.getoutput(confcommand) |
54 |
< |
# sys.exit(-1) |
54 |
> |
# sys.exit(0) |
55 |
|
for ijob in range(0,int(sys.argv[1])): |
56 |
< |
pipe=popen("qsub -q short.q -e /tmp/ -o /tmp/ -N " + "ShaLimA"+str(ijob)+ " " + os.curdir + "/output/ShapeLimWorker.sh"+ " "+str(ijob)) |
56 |
> |
pipe=popen("qsub -q all.q -e /tmp/ -o /tmp/ -N " + "ShaLimA"+str(ijob)+ " " + os.curdir + "/output/ShapeLimWorker.sh"+ " "+str(ijob)) |
57 |
|
for l in pipe.readlines(): |
58 |
|
if l.find("Your job")>-1: |
59 |
|
thisjobnumber=int(l[l.index('job ')+4:l.index(' (')]) |
85 |
|
commands.getoutput(confcommand) |
86 |
|
|
87 |
|
def printUsage(): |
88 |
< |
print "Please provide the following argument: (total number of jobs) (abs path to syst file)" |
89 |
< |
# print "You can also, on top of the number of jobs, provide a list of names (e.g. Adam Barbara Carl Debra ... ) to share the computational load" |
88 |
> |
print "Please provide the following argument: (total number of jobs)" |
89 |
> |
|
90 |
|
|
91 |
< |
if(len(sys.argv) < 3 or sys.argv[1] == "-h"): |
91 |
> |
if(len(sys.argv) < 2 or len(sys.argv) > 2 or sys.argv[1] == "-h"): |
92 |
|
printUsage() |
93 |
|
sys.exit(-1) |
94 |
|
else: |
95 |
|
lay_out_groundwork() |
96 |
|
print "Will now recompile to account for any possible changes in the configuration (or setup)" |
97 |
|
# commands.getoutput("make") |
98 |
< |
if(len(sys.argv) ==3): |
100 |
< |
do_simple_submit() |
101 |
< |
else: |
102 |
< |
printUsage() |
103 |
< |
# Note: advanced submitting has not been implemented yet for limit calculations |
104 |
< |
# do_advanced_submit() |
98 |
> |
do_simple_submit() |
99 |
|
|