forked from ram1123/MadGraph_With_Condor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_lhe_condor.py
47 lines (35 loc) · 1.39 KB
/
generate_lhe_condor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /usr/bin/env python
from general_condor_functions import getbasic_parser
from general_condor_functions import create_output_directory
from general_condor_functions import create_jdl_file_for_condor
from general_condor_functions import create_sh_file_for_condor
def getargs():
parser = getbasic_parser()
parser.add_argument('-cpu', '--ncpu',
default=8,
help='number of cpu to run'
)
parser.add_argument('-r', '--randomnumber',
default=11,
help='random seed'
)
return parser.parse_args()
def main():
# get input arguments
args = getargs()
# list of input files to be added in jdl file
inputlist = args.jdlfilename+".sh, "+args.InProcCardPath+"/"+args.tarfile
# command to run
command = './bin/mg5_aMC '+args.tarfile
# Get Output directory name
output_folder, output_log_path = create_output_directory(args)
# create the jdl file for condor
create_jdl_file_for_condor(args, inputlist, output_log_path)
# create the sh file for condor
create_sh_file_for_condor(args, command, output_folder)
# running help
print "===> Set Proxy Using:"
print "\tvoms-proxy-init --voms cms --valid 168:00"
print "\"condor_submit "+args.jdlfilename+".jdl\" to submit"
if __name__ == "__main__":
main()