9 |
|
|
10 |
|
jobnumbers=[] |
11 |
|
totaljobnumber=0 |
12 |
+ |
totjobs=0; |
13 |
|
|
14 |
|
def checklist(joblist,currlist): |
15 |
|
jobfinished=[] |
20 |
|
jobfinished.append(int(i)) |
21 |
|
for job in jobfinished: |
22 |
|
joblist.remove(int(job)) |
23 |
< |
print "Jobs left:"+str(len(joblist))+" / "+str(len(jobnumbers)) |
23 |
> |
print "Jobs left:"+str(len(joblist))+" / "+str(totjobs) |
24 |
> |
|
25 |
> |
def create_config(): |
26 |
> |
command="../../Plotting/Create_All_Plots.exec 1" #this is the command to give us the configuration file :-) |
27 |
> |
print "Creating the configuration" |
28 |
> |
pipe=popen(command) |
29 |
> |
print "Everything is sent up. Your jobs will be submitted in a minute!" |
30 |
> |
|
31 |
> |
def lay_out_groundwork(): |
32 |
> |
if os.path.isfile("../last_configuration.C"): |
33 |
> |
result="fff" |
34 |
> |
while(result!="" and result!="new"): |
35 |
> |
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") |
36 |
> |
if result=="": |
37 |
> |
print "You've hit enter! Using the existing version ... "; |
38 |
> |
else: |
39 |
> |
print "You've written \"new\" - creating a new file!"; |
40 |
> |
create_config() |
41 |
> |
else: |
42 |
> |
create_config() |
43 |
|
|
44 |
|
def printUsage(): |
45 |
|
print "Please provide the following argument: total number of jobs" |
48 |
|
printUsage() |
49 |
|
sys.exit(-1) |
50 |
|
else: |
51 |
+ |
lay_out_groundwork() |
52 |
+ |
print "Will now recompile to account for any possible changes in the configuration (or setup)" |
53 |
+ |
commands.getoutput("make") |
54 |
|
print "Going to submit "+str(sys.argv[1])+" jobs : " |
55 |
|
fusecommand="hadd -f output/all_limits.root" |
56 |
|
path=str(os.path.abspath(os.curdir)) |
66 |
|
jobnumbers.append(thisjobnumber) |
67 |
|
fusecommand=fusecommand+" output/DistributedLimits_job"+str(ijob)+"_of_"+str(sys.argv[1])+".root" |
68 |
|
counter=0 |
69 |
+ |
totjobs=sys.argv[1] |
70 |
|
while(len(jobnumbers)>0 and counter<300) : |
71 |
|
counter+=1 |
72 |
|
currlist=[] |