aboutsummaryrefslogtreecommitdiffstats
path: root/submitter
diff options
context:
space:
mode:
authorshivesh <s.p.mandalia@qmul.ac.uk>2019-04-25 17:01:48 +0100
committershivesh <s.p.mandalia@qmul.ac.uk>2019-04-25 17:01:48 +0100
commit349a48bf498c3cd342876eb9e66110fd8dbf8b9b (patch)
tree63eec258df1b77da5a9d627f2e0865f83e0a8fb0 /submitter
parentff83600b0ac2f2ed9f0270b905313ea42c90e3f3 (diff)
downloadGolemFlavor-349a48bf498c3cd342876eb9e66110fd8dbf8b9b.tar.gz
GolemFlavor-349a48bf498c3cd342876eb9e66110fd8dbf8b9b.zip
refactor emcee scripts
Diffstat (limited to 'submitter')
-rw-r--r--submitter/contour_dag.py3
-rw-r--r--submitter/mc_texture_dag.py73
-rw-r--r--submitter/mc_texture_submit.sub39
-rw-r--r--submitter/mcmc_dag.py123
-rw-r--r--submitter/mcmc_submit.sub41
5 files changed, 112 insertions, 167 deletions
diff --git a/submitter/contour_dag.py b/submitter/contour_dag.py
index 49c0fa9..0dcdf1e 100644
--- a/submitter/contour_dag.py
+++ b/submitter/contour_dag.py
@@ -3,9 +3,6 @@
import os
import numpy as np
-gfsource = os.environ['GOLEMSOURCEPATH'] + '/GolemFit'
-condor_script = gfsource + '/scripts/flavour_ratio/submitter/contour_submit.sub'
-
injected_ratios = [
(1, 1, 1),
(1, 0, 0),
diff --git a/submitter/mc_texture_dag.py b/submitter/mc_texture_dag.py
new file mode 100644
index 0000000..f37b231
--- /dev/null
+++ b/submitter/mc_texture_dag.py
@@ -0,0 +1,73 @@
+#! /usr/bin/env python
+
+import os
+import numpy as np
+
+source_ratios = [
+ (1, 0, 0),
+ (0, 1, 0)
+]
+
+textures = [
+ 'OET', 'OUT'
+]
+
+datadir = '/data/user/smandalia/flavour_ratio/data/mc_texture'
+
+prefix = ''
+# prefix = '_noprior'
+
+golemfitsourcepath = os.environ['GOLEMSOURCEPATH'] + '/GolemFit'
+condor_script = golemfitsourcepath + '/scripts/flavour_ratio/submitter/mc_texture_submit.sub'
+
+GLOBAL_PARAMS = {}
+
+GLOBAL_PARAMS.update(dict(
+ threads = 1,
+ seed = 26
+))
+
+# Emcee
+GLOBAL_PARAMS.update(dict(
+ run_mcmc = 'True',
+ burnin = 200,
+ nsteps = 1000,
+ nwalkers = 60,
+ mcmc_seed_type = 'uniform'
+))
+
+# FR
+GLOBAL_PARAMS.update(dict(
+ binning = '6e4 1e7 20',
+ dimension = 6,
+ no_bsm = 'False'
+))
+
+# Plot
+GLOBAL_PARAMS.update(dict(
+ plot_angles = 'False',
+ plot_elements = 'False',
+))
+
+dagfile = 'dagman_mc_texture_{0}'.format(GLOBAL_PARAMS['data'])
+dagfile += prefix + '.submit'
+
+with open(dagfile, 'w') as f:
+ job_number = 1
+ for src in source_ratios:
+ print 'src', src
+ for tex in textures:
+ print 'texture', tex
+ f.write('JOB\tjob{0}\t{1}\n'.format(job_number, condor_script))
+ f.write('VARS\tjob{0}\tsr0="{1}"\n'.format(job_number, src[0]))
+ f.write('VARS\tjob{0}\tsr1="{1}"\n'.format(job_number, src[1]))
+ f.write('VARS\tjob{0}\tsr2="{1}"\n'.format(job_number, src[2]))
+ f.write('VARS\tjob{0}\ttexture="{1}"\n'.format(job_number, tex))
+ 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}\tdatadir="{1}"\n'.format(job_number, datadir))
+ job_number += 1
+
+print 'total jobs = {0}'.format(job_number - 1)
+print 'dag file = {0}'.format(dagfile)
+
diff --git a/submitter/mc_texture_submit.sub b/submitter/mc_texture_submit.sub
new file mode 100644
index 0000000..7dccb81
--- /dev/null
+++ b/submitter/mc_texture_submit.sub
@@ -0,0 +1,39 @@
+Executable = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/mc_texture.py
+Arguments = "--source-ratio $(sr0) $(sr1) $(sr2) --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) --binning $(binning) --dimension $(dimension) --no-bsm $(no_bsm) --texture $(texture)"
+
+# All logs will go to a single file
+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"
+
+request_memory = 8GB
+request_cpus = 1
+
+initialdir = /home/smandalia/condor
+
+Universe = vanilla
+Notification = never
+
+# +AccountingGroup="quicktest.$ENV(USER)"
+# +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/mcmc_dag.py b/submitter/mcmc_dag.py
deleted file mode 100644
index 1356965..0000000
--- a/submitter/mcmc_dag.py
+++ /dev/null
@@ -1,123 +0,0 @@
-#! /usr/bin/env python
-
-import os
-import numpy as np
-
-full_scan_mfr = [
- # (1, 1, 1), (1, 0, 0)
-]
-
-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),
-]
-
-GLOBAL_PARAMS = {}
-
-# MCMC
-GLOBAL_PARAMS.update(dict(
- run_mcmc = 'True',
- burnin = 250,
- nsteps = 1000,
- nwalkers = 60,
- seed = 25,
- mcmc_seed_type = 'uniform'
-))
-
-# FR
-dimension = [6]
-# dimension = [4, 5, 7, 8]
-# 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 = 'T13',
- fix_mixing_almost = 'False',
- fold_index = 'True'
-))
-
-# 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_angles = 'True',
- plot_elements = 'False',
-))
-
-outfile = 'dagman_FR_MCMC_{0}_{1}.submit'.format(GLOBAL_PARAMS['likelihood'],
- GLOBAL_PARAMS['fix_mixing'])
-golemfitsourcepath = os.environ['GOLEMSOURCEPATH'] + '/GolemFit'
-condor_script = golemfitsourcepath + '/scripts/flavour_ratio/submitter/mcmc_submit.sub'
-
-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
- outchains = outchain_head + '/fix_ifr/' + '{0}/'.format(GLOBAL_PARAMS['fix_mixing'])
- if GLOBAL_PARAMS['likelihood'].lower() == 'gaussian':
- outchains += '{0}/'.format(str(GLOBAL_PARAMS['sigma_ratio']).replace('.', '_'))
- outchains += '{0}/'.format(GLOBAL_PARAMS['data'].lower())
- outchains += 'mcmc_chain'
- 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]))
- 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, outchains))
- job_number += 1
-
- # for frs in full_scan_mfr:
- # print 'frs', frs
- # outchains = outchain_head + '/full/'
- # if GLOBAL_PARAMS['likelihood'].lower() == 'gaussian':
- # outchains += '{0}/'.format(str(GLOBAL_PARAMS['sigma_ratio']).replace('.', '_'))
- # outchains += 'mcmc_chain'
- # 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))
- # 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, outchains))
- # job_number += 1
-
- print 'dag file = {0}'.format(outfile)
diff --git a/submitter/mcmc_submit.sub b/submitter/mcmc_submit.sub
deleted file mode 100644
index f98049c..0000000
--- a/submitter/mcmc_submit.sub
+++ /dev/null
@@ -1,41 +0,0 @@
-Executable = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/fr.py
-Arguments = "--ast $(ast) --burnin $(burnin) --data $(data) --dimension $(dimension) --fix-mixing $(fix_mixing) --fix-source-ratio $(fix_source_ratio) --likelihood $(likelihood) --measured-ratio $(mr0) $(mr1) $(mr2) --no-bsm $(no_bsm) --nsteps $(nsteps) --nwalkers $(nwalkers) --outfile $(outfile) --plot-angles $(plot_angles) --plot-elements $(plot_elements) --run-mcmc $(run_mcmc) --scale-region $(scale_region) --seed $(seed) --sigma-ratio $(sigma_ratio) --source-ratio $(sr0) $(sr1) $(sr2) --threads $(threads) --energy-dependance $(energy_dependance) --spectral-index $(spectral_index) --binning $(binning) --fix-mixing-almost $(fix_mixing_almost) --fold-index $(fold_index) --mcmc-seed-type $(mcmc_seed_type)"
-
-# 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