aboutsummaryrefslogtreecommitdiffstats
path: root/submitter
diff options
context:
space:
mode:
Diffstat (limited to 'submitter')
-rwxr-xr-xsubmitter/clean.sh3
-rw-r--r--submitter/contour_dag.py51
-rw-r--r--submitter/contour_emcee_dag.py77
-rw-r--r--submitter/contour_emcee_submit.sub42
-rw-r--r--submitter/contour_submit.sub16
-rw-r--r--submitter/out0
-rw-r--r--submitter/sens_dag.py6
-rw-r--r--submitter/sens_dag_source.py183
8 files changed, 34 insertions, 344 deletions
diff --git a/submitter/clean.sh b/submitter/clean.sh
index d669683..a56d7f1 100755
--- a/submitter/clean.sh
+++ b/submitter/clean.sh
@@ -2,9 +2,6 @@
rm -f dagman_*.submit.*
rm -f logs/*
-rm -f metaouts/*
-rm -rf mnrun/
-mkdir mnrun
rm -f /scratch/smandalia/flavour_ratio/submitter/dagman_*.submit.*
rm -f /scratch/smandalia/flavour_ratio/submitter/logs/*
diff --git a/submitter/contour_dag.py b/submitter/contour_dag.py
index 634801b..8b3c11c 100644
--- a/submitter/contour_dag.py
+++ b/submitter/contour_dag.py
@@ -13,50 +13,46 @@ injected_ratios = [
(0, 0, 1)
]
-GLOBAL_PARAMS = {}
+datadir = '/data/user/smandalia/flavour_ratio/data/contour'
-GLOBAL_PARAMS.update(dict(
- threads = 1,
- save_measured_fr = 'False',
- output_measured_fr = './frs/',
- seed = None
-))
+prefix = ''
+# prefix = '_noprior'
+
+golemfitsourcepath = os.environ['GOLEMSOURCEPATH'] + '/GolemFit'
+condor_script = golemfitsourcepath + '/scripts/flavour_ratio/submitter/contour_submit.sub'
+
+GLOBAL_PARAMS = {}
-# MultiNest
GLOBAL_PARAMS.update(dict(
- mn_live_points = 5000,
- mn_tolerance = 0.3,
+ threads = 12,
+ seed = 26
))
-# Likelihood
+# Emcee
GLOBAL_PARAMS.update(dict(
- likelihood = 'golemfit',
+ run_mcmc = 'True',
+ burnin = 200,
+ nsteps = 1000,
+ nwalkers = 60,
+ mcmc_seed_type = 'uniform'
))
# GolemFit
GLOBAL_PARAMS.update(dict(
ast = 'p2_0',
- # data = 'realisation'
- # data = 'asimov'
data = 'real'
))
# Plot
GLOBAL_PARAMS.update(dict(
- plot_chains = 'False',
- plot_triangle = 'False'
+ plot_angles = 'False',
+ plot_elements = 'False',
))
-outfile = 'dagman_FR_CONTOUR_{0}'.format(GLOBAL_PARAMS['data'])
-outfile += '.submit'
-output = '/data/user/smandalia/flavour_ratio/data/contour/{0}/{1}/'.format(
- GLOBAL_PARAMS['likelihood'], GLOBAL_PARAMS['data']
-)
-# output += 'nosyst/'
-# output += 'noprompt/'
-# output += 'strictpriors/'
+dagfile = 'dagman_CONTOUR_{0}'.format(GLOBAL_PARAMS['data'])
+dagfile += prefix + '.submit'
-with open(outfile, 'w') as f:
+with open(dagfile, 'w') as f:
job_number = 1
for inj in injected_ratios:
print 'inj', inj
@@ -66,8 +62,9 @@ with open(outfile, 'w') as f:
f.write('VARS\tjob{0}\tir2="{1}"\n'.format(job_number, inj[2]))
for key in GLOBAL_PARAMS.iterkeys():
f.write('VARS\tjob{0}\t{1}="{2}"\n'.format(job_number, key, GLOBAL_PARAMS[key]))
- f.write('VARS\tjob{0}\toutfile="{1}"\n'.format(job_number, output))
+ f.write('VARS\tjob{0}\tdatadir="{1}"\n'.format(job_number, datadir))
job_number += 1
if GLOBAL_PARAMS['data'] == 'real': break
-print 'dag file = {0}'.format(outfile)
+print 'total jobs = {0}'.format(job_number - 1)
+print 'dag file = {0}'.format(dagfile)
diff --git a/submitter/contour_emcee_dag.py b/submitter/contour_emcee_dag.py
deleted file mode 100644
index b16312a..0000000
--- a/submitter/contour_emcee_dag.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#! /usr/bin/env python
-
-import os
-import numpy as np
-
-gfsource = os.environ['GOLEMSOURCEPATH'] + '/GolemFit'
-condor_script = gfsource + '/scripts/flavour_ratio/submitter/contour_emcee_submit.sub'
-
-injected_ratios = [
- (1, 1, 1),
- (1, 0, 0),
- (0, 1, 0),
- (0, 0, 1)
-]
-
-GLOBAL_PARAMS = {}
-
-GLOBAL_PARAMS.update(dict(
- threads = 1,
-))
-
-# Emcee
-GLOBAL_PARAMS.update(dict(
- run_mcmc = 'True',
- burnin = 250,
- nsteps = 500,
- nwalkers = 60,
- seed = 25,
- mcmc_seed_type = 'uniform'
-))
-
-# Likelihood
-GLOBAL_PARAMS.update(dict(
- likelihood = 'golemfit',
-))
-
-# GolemFit
-GLOBAL_PARAMS.update(dict(
- ast = 'p2_0',
- # data = 'realisation'
- # data = 'asimov'
- data = 'real'
-))
-
-# Plot
-GLOBAL_PARAMS.update(dict(
- plot_angles = 'False',
- plot_elements = 'False',
-))
-
-outfile = 'dagman_FR_CONTOUR_EMCEE_{0}'.format(GLOBAL_PARAMS['data'])
-outfile += 'more_sys_flat'
-outfile += '.submit'
-
-output = '/data/user/smandalia/flavour_ratio/data/contour_emcee/{0}/{1}/'.format(
- GLOBAL_PARAMS['likelihood'], GLOBAL_PARAMS['data']
-)
-# output += 'more_sys/'
-output += 'more_sys_flat/'
-# output += 'noprompt/'
-# output += 'strictpriors/'
-
-with open(outfile, 'w') as f:
- job_number = 1
- for inj in injected_ratios:
- print 'inj', inj
- f.write('JOB\tjob{0}\t{1}\n'.format(job_number, condor_script))
- f.write('VARS\tjob{0}\tir0="{1}"\n'.format(job_number, inj[0]))
- f.write('VARS\tjob{0}\tir1="{1}"\n'.format(job_number, inj[1]))
- f.write('VARS\tjob{0}\tir2="{1}"\n'.format(job_number, inj[2]))
- for key in GLOBAL_PARAMS.iterkeys():
- f.write('VARS\tjob{0}\t{1}="{2}"\n'.format(job_number, key, GLOBAL_PARAMS[key]))
- f.write('VARS\tjob{0}\toutfile="{1}"\n'.format(job_number, output))
- job_number += 1
- if GLOBAL_PARAMS['data'] == 'real': break
-
-print 'dag file = {0}'.format(outfile)
diff --git a/submitter/contour_emcee_submit.sub b/submitter/contour_emcee_submit.sub
deleted file mode 100644
index df47cb7..0000000
--- a/submitter/contour_emcee_submit.sub
+++ /dev/null
@@ -1,42 +0,0 @@
-Executable = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/contour_emcee.py
-Arguments = "--ast $(ast) --data $(data) --likelihood $(likelihood) --injected-ratio $(ir0) $(ir1) $(ir2) --outfile $(outfile) --seed $(seed) --threads $(threads) --run-mcmc $(run_mcmc) --burnin $(burnin) --nsteps $(nsteps) --nwalkers $(nwalkers) --seed $(seed) --mcmc-seed-type $(mcmc_seed_type) --plot-angles $(plot_angles) --plot-elements $(plot_elements)"
-
-# All logs will go to a single file
-log = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/submitter/logs/job_$(Cluster).log
-output = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/submitter/logs/job_$(Cluster).out
-error = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/submitter/logs/job_$(Cluster).err
-
-getenv = True
-# environment = "X509_USER_PROXY=x509up_u14830"
-
-# Stage user cert to the node (Gridftp-Users is already on CVMFS)
-# transfer_input_files = /tmp/x509up_u14830
-
-# but do not try to copy outputs back (see: https://htcondor-wiki.cs.wisc.edu/index.cgi/tktview?tn=3081)
-# +TransferOutput=""
-Transfer_output_files = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/submitter/metaouts/
-
-request_memory = 3GB
-request_cpus = 1
-
-Universe = vanilla
-Notification = never
-
-# +AccountingGroup="sanctioned.$ENV(USER)"
-# run on both SL5 and 6
-# +WantRHEL6 = True
-# +WantSLC6 = False
-
-# # run on OSG
-# +WantGlidein = True
-
-# +TransferOutput=""
-
-+NATIVE_OS = True
-# Requirements = IS_GLIDEIN && HAS_CVMFS_icecube_opensciencegrid_org && (OpSysAndVer =?= "CentOS6" || OpSysAndVer =?= "RedHat6" || OpSysAndVer =?= "SL6")
-# Requirements = IS_GLIDEIN
-# Requirements = (OpSysMajorVer =?= 6)
-
-# GO!
-queue
-
diff --git a/submitter/contour_submit.sub b/submitter/contour_submit.sub
index f4e13e9..c507ec2 100644
--- a/submitter/contour_submit.sub
+++ b/submitter/contour_submit.sub
@@ -1,27 +1,23 @@
Executable = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/contour.py
-Arguments = "--ast $(ast) --data $(data) --likelihood $(likelihood) --injected-ratio $(ir0) $(ir1) $(ir2) --outfile $(outfile) --seed $(seed) --threads $(threads) --mn-live-points $(mn_live_points) --mn-tolerance $(mn_tolerance) --plot-chains $(plot_chains) --plot-triangle $(plot_triangle) --save-measured-fr $(save_measured_fr) --output-measured-fr=$(output_measured_fr)"
+Arguments = "--ast $(ast) --data $(data) --injected-ratio $(ir0) $(ir1) $(ir2) --datadir $(datadir) --seed $(seed) --threads $(threads) --run-mcmc $(run_mcmc) --burnin $(burnin) --nsteps $(nsteps) --nwalkers $(nwalkers) --mcmc-seed-type $(mcmc_seed_type) --plot-angles $(plot_angles) --plot-elements $(plot_elements)"
# All logs will go to a single file
-log = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/submitter/logs/job_$(Cluster).log
+log = /scratch/smandalia/flavour_ratio/submitter/logs/job_$(Cluster).log
output = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/submitter/logs/job_$(Cluster).out
error = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/submitter/logs/job_$(Cluster).err
getenv = True
# environment = "X509_USER_PROXY=x509up_u14830"
-# Stage user cert to the node (Gridftp-Users is already on CVMFS)
-# transfer_input_files = /tmp/x509up_u14830
-
-# but do not try to copy outputs back (see: https://htcondor-wiki.cs.wisc.edu/index.cgi/tktview?tn=3081)
-# +TransferOutput=""
-Transfer_output_files = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/submitter/metaouts/
-
request_memory = 3GB
-request_cpus = 1
+request_cpus = 12
+
+initialdir = /home/smandalia/condor
Universe = vanilla
Notification = never
++AccountingGroup="quicktest.$ENV(USER)"
# +AccountingGroup="sanctioned.$ENV(USER)"
# run on both SL5 and 6
# +WantRHEL6 = True
diff --git a/submitter/out b/submitter/out
deleted file mode 100644
index e69de29..0000000
--- a/submitter/out
+++ /dev/null
diff --git a/submitter/sens_dag.py b/submitter/sens_dag.py
index 160e590..f30d420 100644
--- a/submitter/sens_dag.py
+++ b/submitter/sens_dag.py
@@ -9,10 +9,12 @@ import numpy as np
# (0, 1, 0),
# ]
-x_bins = 20
-x_array = np.linspace(0, 1, x_bins)
+MASK_X = (0.3, 0.8)
+x_segments = 20
+x_array = np.linspace(0, 1, x_segments)
sources = []
for x in x_array:
+ if x > MASK_X[0] and x < MASK_X[1]: continue
sources.append([x, 1-x, 0])
dims = [
diff --git a/submitter/sens_dag_source.py b/submitter/sens_dag_source.py
deleted file mode 100644
index bdb5924..0000000
--- a/submitter/sens_dag_source.py
+++ /dev/null
@@ -1,183 +0,0 @@
-#! /usr/bin/env python
-
-import os
-import numpy as np
-
-full_scan_mfr = [
- # (1, 1, 1), (1, 2, 0)
-]
-
-bins = 5
-binning = np.linspace(0, 1, bins)
-grid = np.dstack(np.meshgrid(binning, binning)).reshape(bins*bins, 2)
-sources = []
-for x in grid:
- if x[0]+x[1] > 1:
- continue
- sources.append([x[0], x[1], 1-x[0]-x[1]])
-
-# fix_sfr_mfr = [
-# (1, 1, 1, 1, 2, 0),
-# (1, 1, 1, 1, 0, 0),
-# (1, 1, 1, 0, 1, 0),
-# # (1, 1, 1, 0, 0, 1),
-# # (1, 1, 0, 1, 2, 0),
-# # (1, 1, 0, 1, 0, 0),
-# # (1, 1, 0, 0, 1, 0),
-# # (1, 0, 0, 1, 0, 0),
-# # (0, 1, 0, 0, 1, 0),
-# # (1, 2, 0, 1, 2, 0),
-# # (1, 2, 0, 0, 1, 0),
-# ]
-fix_sfr_mfr = []
-for s in sources:
- fix_sfr_mfr.append((1, 1, 1, s[0], s[1], s[2]))
-print 'fix_sfr_mfr', fix_sfr_mfr
-print 'len(fix_sfr_mfr)', len(fix_sfr_mfr)
-
-GLOBAL_PARAMS = {}
-
-# Bayes Factor
-sens_eval_bin = 'true' # set to 'all' to run normally
-GLOBAL_PARAMS.update(dict(
- sens_run = 'True',
- run_method = 'fixed_angle', # full, fixed_angle, corr_angle
- stat_method = 'bayesian',
- sens_bins = 10,
- seed = None
-))
-
-# MultiNest
-GLOBAL_PARAMS.update(dict(
- # mn_live_points = 1000,
- # mn_live_points = 600,
- mn_live_points = 100,
- # mn_tolerance = 0.1,
- mn_tolerance = 0.3,
- mn_output = './mnrun'
-))
-
-# FR
-dimension = [6]
-# dimension = [3, 6]
-# dimension = [3, 4, 5, 6, 7, 8]
-GLOBAL_PARAMS.update(dict(
- threads = 1,
- binning = '6e4 1e7 20',
- no_bsm = 'False',
- scale_region = "1E10",
- energy_dependance = 'spectral',
- spectral_index = -2,
- fix_mixing = 'None',
- fix_mixing_almost = 'False',
- fold_index = 'True',
- save_measured_fr = 'False',
- output_measured_fr = './frs/'
-))
-
-# Likelihood
-GLOBAL_PARAMS.update(dict(
- likelihood = 'golemfit',
- sigma_ratio = '0.01'
-))
-
-# GolemFit
-GLOBAL_PARAMS.update(dict(
- ast = 'p2_0',
- data = 'real'
-))
-
-# Plot
-GLOBAL_PARAMS.update(dict(
- plot_statistic = 'True'
-))
-
-outfile = 'dagman_FR_SENS_{0}_{1}_{2}_{3}'.format(
- GLOBAL_PARAMS['stat_method'], GLOBAL_PARAMS['run_method'],
- GLOBAL_PARAMS['likelihood'], GLOBAL_PARAMS['data']
-)
-# outfile += '_seed2'
-# outfile += '_tol03'
-# outfile += '_NULL'
-# outfile += '_prior'
-# outfile += '_strictprior'
-# outfile += '_noprior'
-outfile += '_sourcescan'
-outfile += '.submit'
-golemfitsourcepath = os.environ['GOLEMSOURCEPATH'] + '/GolemFit'
-condor_script = golemfitsourcepath + '/scripts/flavour_ratio/submitter/sens_submit.sub'
-
-if sens_eval_bin.lower() != 'all':
- if GLOBAL_PARAMS['run_method'].lower() == 'corr_angle':
- raise NotImplementedError
- sens_runs = GLOBAL_PARAMS['sens_bins']**2
- else:
- sens_runs = GLOBAL_PARAMS['sens_bins'] + 1
-else: sens_runs = 1
-
-with open(outfile, 'w') as f:
- job_number = 1
- for dim in dimension:
- print 'dimension', dim
- outchain_head = '/data/user/smandalia/flavour_ratio/data/{0}/DIM{1}'.format(
- GLOBAL_PARAMS['likelihood'], dim
- )
- for frs in fix_sfr_mfr:
- print 'frs', frs
- output = outchain_head + '/fix_ifr/'
- if GLOBAL_PARAMS['likelihood'].lower() == 'gaussian':
- output += '{0}/'.format(str(GLOBAL_PARAMS['sigma_ratio']).replace('.', '_'))
- # output += 'seed2/'
- # output += 'mn_noverlap/'
- # output += 'tol_03/'
- # output += 'prior/'
- # output += 'strictprior/'
- # output += 'noprior/'
- output += 'sourcescan/'
- for r in xrange(sens_runs):
- print 'run', r
- f.write('JOB\tjob{0}\t{1}\n'.format(job_number, condor_script))
- f.write('VARS\tjob{0}\tdimension="{1}"\n'.format(job_number, dim))
- f.write('VARS\tjob{0}\tmr0="{1}"\n'.format(job_number, frs[0]))
- f.write('VARS\tjob{0}\tmr1="{1}"\n'.format(job_number, frs[1]))
- f.write('VARS\tjob{0}\tmr2="{1}"\n'.format(job_number, frs[2]))
- f.write('VARS\tjob{0}\tfix_source_ratio="{1}"\n'.format(job_number, True))
- f.write('VARS\tjob{0}\tsr0="{1}"\n'.format(job_number, frs[3]))
- f.write('VARS\tjob{0}\tsr1="{1}"\n'.format(job_number, frs[4]))
- f.write('VARS\tjob{0}\tsr2="{1}"\n'.format(job_number, frs[5]))
- if sens_eval_bin.lower() != 'all':
- f.write('VARS\tjob{0}\tsens_eval_bin="{1}"\n'.format(job_number, r))
- else:
- f.write('VARS\tjob{0}\tsens_eval_bin="{1}"\n'.format(job_number, 'all'))
- for key in GLOBAL_PARAMS.iterkeys():
- f.write('VARS\tjob{0}\t{1}="{2}"\n'.format(job_number, key, GLOBAL_PARAMS[key]))
- f.write('VARS\tjob{0}\toutfile="{1}"\n'.format(job_number, output))
- job_number += 1
- # break
-
- # for frs in full_scan_mfr:
- # print 'frs', frs
- # output = outchain_head + '/full/'
- # if GLOBAL_PARAMS['likelihood'].lower() == 'gaussian':
- # output += '{0}/'.format(str(GLOBAL_PARAMS['sigma_ratio']).replace('.', '_'))
- # for r in xrange(sens_runs):
- # print 'run', r
- # f.write('JOB\tjob{0}\t{1}\n'.format(job_number, condor_script))
- # f.write('VARS\tjob{0}\tdimension="{1}"\n'.format(job_number, dim))
- # f.write('VARS\tjob{0}\tmr0="{1}"\n'.format(job_number, frs[0]))
- # f.write('VARS\tjob{0}\tmr1="{1}"\n'.format(job_number, frs[1]))
- # f.write('VARS\tjob{0}\tmr2="{1}"\n'.format(job_number, frs[2]))
- # f.write('VARS\tjob{0}\tfix_source_ratio="{1}"\n'.format(job_number, False))
- # f.write('VARS\tjob{0}\tsr0="{1}"\n'.format(job_number, 0))
- # f.write('VARS\tjob{0}\tsr1="{1}"\n'.format(job_number, 0))
- # f.write('VARS\tjob{0}\tsr2="{1}"\n'.format(job_number, 0))
- # if sens_eval_bin.lower() != 'all':
- # f.write('VARS\tjob{0}\tsens_eval_bin="{1}"\n'.format(job_number, r))
- # else:
- # f.write('VARS\tjob{0}\tsens_eval_bin="{1}"\n'.format(job_number, 'all'))
- # for key in GLOBAL_PARAMS.iterkeys():
- # f.write('VARS\tjob{0}\t{1}="{2}"\n'.format(job_number, key, GLOBAL_PARAMS[key]))
- # f.write('VARS\tjob{0}\toutfile="{1}"\n'.format(job_number, output))
- # job_number += 1
-
- print 'dag file = {0}'.format(outfile)