43 |
|
shutil.copyfile('/scratch/%s/%s'%(getpass.getuser(),os.path.basename(btagLibrary)),btagLibrary) |
44 |
|
os.chdir(submitDir) |
45 |
|
logPath = config.get("Directories","logpath") |
46 |
< |
repDict = {'en':en,'logpath':logPath,'job':''} |
46 |
> |
#check if the logPath exist. If not exit |
47 |
> |
if( not os.path.isdir(logPath) ): |
48 |
> |
print 'ERROR: ' + logPath + ': dir not found.' |
49 |
> |
print 'ERROR: Create it before submitting ' |
50 |
> |
print 'Exit' |
51 |
> |
sys.exit(-1) |
52 |
> |
|
53 |
> |
repDict = {'en':en,'logpath':logPath,'job':'','task':opts.task} |
54 |
|
def submit(job,repDict): |
55 |
|
repDict['job'] = job |
56 |
< |
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) + opts.task |
56 |
> |
command = 'qsub -V -cwd -q all.q -N %(job)s_%(en)s%(task)s -o %(logpath)s/%(job)s_%(en)s_%(task)s.out -e %(logpath)s/%(job)s_%(en)s_%(task)s.err runAll.sh %(job)s %(en)s ' %(repDict) + opts.task |
57 |
|
print command |
58 |
|
subprocess.call([command], shell=True) |
59 |
|
|
62 |
|
if opts.task == 'plot': |
63 |
|
Plot_vars= config.items('Plot') |
64 |
|
|
65 |
< |
path = config.get("Directories","samplepath") |
66 |
< |
infofile = open(path+'/env/samples.info','r') |
67 |
< |
info = pickle.load(infofile) |
68 |
< |
infofile.close() |
65 |
> |
if not opts.task == 'prep': |
66 |
> |
path = config.get("Directories","samplepath") |
67 |
> |
infofile = open(path+'/env/samples.info','r') |
68 |
> |
info = pickle.load(infofile) |
69 |
> |
infofile.close() |
70 |
|
|
71 |
|
|
72 |
|
if opts.task == 'plot': |