Commit e1f6f721 authored by Vivien Raymond's avatar Vivien Raymond
Browse files

Merge branch 'parallel-pptest' into 'master'

Removed the requirement to only have a single approximant or engine for the P-P test.

See merge request !365
parents b7ee1512 a0fe5f84
Pipeline #25612 passed with stages
in 27 minutes and 46 seconds
......@@ -42,6 +42,10 @@ parser.add_argument('--pptest', action='store_true',
default=False,
help='Runs a P-P analysis. Must specify a single engine.')
parser.add_argument('--pp-approximant', action='store', type=str,
default='IMRPhenomPv2pseudoFourPN,SEOBNRv4_ROMpseudoFourPN',
help='Approximant(s) used for the P-P analysis.')
parser.add_argument('--bbh-injection', type=str, nargs='?',
default=False,
const=os.path.join(prefix,'fiducialBBH.xml'),
......@@ -93,7 +97,7 @@ lalinf_prefix=''
try:
lalinf_prefix=os.environ['LALINFERENCE_PREFIX']
except KeyError:
print 'LALINFERENCE_PREFIX variable not defined, could not find LALInference installation.'
print('LALINFERENCE_PREFIX variable not defined, could not find LALInference installation.')
sys.exit()
def init_ini_file(file=args.ini_file):
......@@ -298,18 +302,20 @@ if args.analytic_tests:
############################################################
def set_pptest(cp):
def set_pptest(cp, engine, approximant):
cp.set('paths','webdir',web_outputdir+'/pptest/webdir/')
cp.set('ppanalysis','webdir',web_outputdir+'/PPcheck/')
cp.set('paths','webdir', os.path.join(web_outputdir, 'pptest', engine, approximant, 'webdir/'))
cp.set('ppanalysis','webdir', os.path.join(web_outputdir, 'PPcheck', engine, approximant + '/'))
cp.set('lalinference','fake-cache',"{'H1':'LALSimAdLIGO','L1':'LALSimAdLIGO','V1':'LALSimAdVirgo'}")
cp.set('analysis','dataseed','1234')
cp.set('analysis', 'engine', engine)
cp.remove_option('engine','margphi')
cp.set('engine','margtime','')
cp.set('engine','amporder','-1')
cp.set('engine','fref','0')
cp.set('engine','distance-max','2000')
cp.set('engine', 'approx', approximant)
cp.set('resultspage','deltaLogP','7')
......@@ -317,27 +323,29 @@ def set_pptest(cp):
if args.pptest:
# The PP test needs an engine to be specified
assert ',' not in args.engine, "A single engine must be specified"
# The PP test needs a single engine to be specified
for engine in args.engine.split(','):
for approximant in args.pp_approximant.split(','):
os.makedirs(os.path.join(args.output, 'pptest', engine, approximant + '/'))
os.chdir(os.path.join(args.output, 'pptest', engine, approximant + '/'))
os.makedirs(args.output+'/pptest/')
os.chdir(args.output+'/pptest/')
pptest_ini_file=os.path.join(args.output, 'pptest', engine, approximant, 'pptest.ini')
pptest_ini_file=os.path.join(args.output,'pptest','pptest.ini')
cppptest=set_pptest(init_ini_file(), engine=engine,
approximant=approximant)
with open(pptest_ini_file,'w') as cpfile:
cppptest.write(cpfile)
cppptest=set_pptest(init_ini_file())
with open(pptest_ini_file,'w') as cpfile:
cppptest.write(cpfile)
lalinferenceargs = [ 'lalinference_pp_pipe'
, '-r'
, './run'
, '-N'
, '100'
, pptest_ini_file ]
lalinferenceargs = [ 'lalinference_pp_pipe'
, '-r'
, './run'
, '-N'
, '100'
, pptest_ini_file ]
subprocess.call(lalinferenceargs)
subprocess.call(lalinferenceargs)
if args.condor_submit:
condor_submit_dag = ['condor_submit_dag', os.path.join(args.output, 'pptest', engine, approximant, 'run/priortest.dag')]
subprocess.call(condor_submit_dag)
if args.condor_submit:
condor_submit_dag = ['condor_submit_dag',args.output+'/pptest/run/priortest.dag']
subprocess.call(condor_submit_dag)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment