Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
cosmotools
CAMEL
Commits
ea9ea8c1
Commit
ea9ea8c1
authored
Jul 02, 2019
by
Plaszczynski Stephane
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
Dev See merge request
!15
parents
4fda1034
a9ad2912
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
73 additions
and
48 deletions
+73
-48
cmt/requirements-lite.generic
cmt/requirements-lite.generic
+1
-1
cmt/requirements-lsst.cc
cmt/requirements-lsst.cc
+1
-1
src/AbsRand/OofNoise.cc
src/AbsRand/OofNoise.cc
+3
-1
src/camel/CMB/Lollipop.cc
src/camel/CMB/Lollipop.cc
+1
-1
src/camel/Class/ClassAdapters.hh
src/camel/Class/ClassAdapters.hh
+1
-0
src/camel/Class/ClassEngine.cc
src/camel/Class/ClassEngine.cc
+7
-17
src/camel/Class/MnClassEngine.hh
src/camel/Class/MnClassEngine.hh
+1
-1
src/camel/Lensing/Chi2Lensing.hh
src/camel/Lensing/Chi2Lensing.hh
+1
-1
src/camel/Lensing/LensingLikelihood.hh
src/camel/Lensing/LensingLikelihood.hh
+1
-1
src/camel/MCMC/MCMC_adaptive.cc
src/camel/MCMC/MCMC_adaptive.cc
+2
-1
src/camel/MCMC/MCMC_sampler.cc
src/camel/MCMC/MCMC_sampler.cc
+2
-2
src/camel/MCMC/MCMC_sampler.hh
src/camel/MCMC/MCMC_sampler.hh
+2
-2
src/camel/MCMC/exec/mainMCMC.cc
src/camel/MCMC/exec/mainMCMC.cc
+17
-7
src/cxxsupport/cxxutils.cc
src/cxxsupport/cxxutils.cc
+12
-0
src/cxxsupport/cxxutils.h
src/cxxsupport/cxxutils.h
+2
-0
work/batch/cc/Minimize5.sh
work/batch/cc/Minimize5.sh
+2
-3
work/batch/cc/runMCMC_class.sh
work/batch/cc/runMCMC_class.sh
+5
-6
work/ref/hlpTT_PS_H0.cml
work/ref/hlpTT_PS_H0.cml
+12
-3
work/ref/hlpTT_PS_H0_min_ref/covmat8.dat
work/ref/hlpTT_PS_H0_min_ref/covmat8.dat
+0
-0
work/ref/hlpTT_PS_H0_min_ref/hlpTT_PS_H0_min.o8236803.8
work/ref/hlpTT_PS_H0_min_ref/hlpTT_PS_H0_min.o8236803.8
+0
-0
No files found.
cmt/requirements-lite.generic
View file @
ea9ea8c1
...
@@ -4,7 +4,7 @@ use class *
...
@@ -4,7 +4,7 @@ use class *
#
compiler
options
#
compiler
options
#
default
is
gcc
here
are
the
C
++
compiler
options
#
default
is
gcc
here
are
the
C
++
compiler
options
macro
cppflags
" -O2 -pipe -fPIC -Wall "
macro
cppflags
" -O2 -pipe -fPIC -Wall
-Wno-reorder -Wno-sign-compare -Wno-unknown-pragmas
"
#
do
we
need
optimzations
here
?
#
do
we
need
optimzations
here
?
#
macro_append
cppflags
"-ffast-math -m64 "
#
macro_append
cppflags
"-ffast-math -m64 "
...
...
cmt/requirements-lsst.cc
View file @
ea9ea8c1
...
@@ -5,7 +5,7 @@ use class HEAD
...
@@ -5,7 +5,7 @@ use class HEAD
#compiler options
#compiler options
macro
cpp
"icpc"
macro
cpp
"icpc"
macro
cppflags
" -O2 -ip -ansi_alias -align -W
brief -Wdeprecated -Wuninitialized -Wbrief -Wunused-function -Wpointer-arith -Wreturn-type
"
macro
cppflags
" -O2 -ip -ansi_alias -align -W
all -Wno-unknown-pragmas
"
#macro_append cppflags " -g "
#macro_append cppflags " -g "
#CAMEL includes
#CAMEL includes
...
...
src/AbsRand/OofNoise.cc
View file @
ea9ea8c1
...
@@ -75,7 +75,9 @@ OofNoise::OofNoise(AbsGauss* r,double slope,double fmin,double fknee,double fsam
...
@@ -75,7 +75,9 @@ OofNoise::OofNoise(AbsGauss* r,double slope,double fmin,double fknee,double fsam
OofNoise
::~
OofNoise
(){
OofNoise
::~
OofNoise
(){
for
(
unsigned
i
=
0
;
i
<
ff
.
size
();
i
++
)
delete
ff
[
i
];
for
(
unsigned
i
=
0
;
i
<
ff
.
size
();
i
++
)
delete
ff
[
i
];
if
(
_r
)
delete
_r
;
_r
=
NULL
;
if
(
_r
)
delete
_r
;
_r
=
NULL
;
}
}
double
double
...
...
src/camel/CMB/Lollipop.cc
View file @
ea9ea8c1
...
@@ -86,7 +86,7 @@ void Lollipop::CreateDataSet( string DataFile)
...
@@ -86,7 +86,7 @@ void Lollipop::CreateDataSet( string DataFile)
fp
.
close
();
fp
.
close
();
if
(
(
long
)
dataset
.
size
()
!=
Lmax
-
Lmin
+
1
)
{
if
(
(
long
)
dataset
.
size
()
!=
Lmax
-
Lmin
+
1
)
{
printf
(
"Wrong number of l in datafile (%d)
\n
"
,
(
long
)
dataset
.
size
());
printf
(
"Wrong number of l in datafile (%
l
d)
\n
"
,
(
long
)
dataset
.
size
());
exit
(
-
1
);
exit
(
-
1
);
}
}
...
...
src/camel/Class/ClassAdapters.hh
View file @
ea9ea8c1
...
@@ -27,6 +27,7 @@ class ClassAdapter
...
@@ -27,6 +27,7 @@ class ClassAdapter
{
{
public:
public:
virtual
std
::
string
className
()
{
return
name
;};
virtual
std
::
string
className
()
{
return
name
;};
virtual
~
ClassAdapter
(){};
virtual
std
::
string
toClass
(
const
std
::
vector
<
double
>&
par
)
const
=
0
;
virtual
std
::
string
toClass
(
const
std
::
vector
<
double
>&
par
)
const
=
0
;
protected:
protected:
...
...
src/camel/Class/ClassEngine.cc
View file @
ea9ea8c1
...
@@ -94,7 +94,7 @@ ClassEngine::ClassEngine(const ClassParams& pars): cl(0),dofree(true),pvecback(0
...
@@ -94,7 +94,7 @@ ClassEngine::ClassEngine(const ClassParams& pars): cl(0),dofree(true),pvecback(0
//prepare fp structure
//prepare fp structure
size_t
n
=
pars
.
size
();
size_t
n
=
pars
.
size
();
//
//
parser_init
(
&
fc
,
n
,
"pipo"
,
_errmsg
);
parser_init
(
&
fc
,
n
,
const_cast
<
char
*>
(
"pipo"
)
,
_errmsg
);
//config
//config
for
(
size_t
i
=
0
;
i
<
pars
.
size
();
i
++
){
for
(
size_t
i
=
0
;
i
<
pars
.
size
();
i
++
){
...
@@ -151,7 +151,7 @@ ClassEngine::ClassEngine(const ClassParams& pars,const string & precision_file):
...
@@ -151,7 +151,7 @@ ClassEngine::ClassEngine(const ClassParams& pars,const string & precision_file):
fc_input
.
filename
=
new
char
[
1
];
fc_input
.
filename
=
new
char
[
1
];
//prepare fc par structure
//prepare fc par structure
size_t
n
=
pars
.
size
();
size_t
n
=
pars
.
size
();
parser_init
(
&
fc_input
,
n
,
"pipo"
,
_errmsg
);
parser_init
(
&
fc_input
,
n
,
const_cast
<
char
*>
(
"pipo"
)
,
_errmsg
);
//config
//config
for
(
size_t
i
=
0
;
i
<
pars
.
size
();
i
++
){
for
(
size_t
i
=
0
;
i
<
pars
.
size
();
i
++
){
strcpy
(
fc_input
.
name
[
i
],
pars
.
key
(
i
).
c_str
());
strcpy
(
fc_input
.
name
[
i
],
pars
.
key
(
i
).
c_str
());
...
@@ -568,9 +568,9 @@ double ClassEngine::get_Pklin(double k, double z){
...
@@ -568,9 +568,9 @@ double ClassEngine::get_Pklin(double k, double z){
#ifdef CLASSV_ABOVE_2_7
#ifdef CLASSV_ABOVE_2_7
double
pk_cb
=
0.
;
double
pk_cb
=
0.
;
double
pk_cb_ic
=
0.
;
double
pk_cb_ic
=
0.
;
int
ret
=
spectra_pk_at_k_and_z
(
&
ba
,
&
pm
,
&
sp
,
k
,
z
,
&
mypk
,
pk_ic
,
&
pk_cb
,
&
pk_cb_ic
);
assert
(
spectra_pk_at_k_and_z
(
&
ba
,
&
pm
,
&
sp
,
k
,
z
,
&
mypk
,
pk_ic
,
&
pk_cb
,
&
pk_cb_ic
)
==
_SUCCESS_
)
;
#else
#else
int
ret
=
spectra_pk_at_k_and_z
(
&
ba
,
&
pm
,
&
sp
,
k
,
z
,
&
mypk
,
pk_ic
);
assert
(
spectra_pk_at_k_and_z
(
&
ba
,
&
pm
,
&
sp
,
k
,
z
,
&
mypk
,
pk_ic
)
==
_SUCCESS_
)
;
#endif
#endif
return
mypk
;
return
mypk
;
...
@@ -587,9 +587,9 @@ double ClassEngine::get_PkNL(double k, double z){
...
@@ -587,9 +587,9 @@ double ClassEngine::get_PkNL(double k, double z){
#ifdef CLASSV_ABOVE_2_7
#ifdef CLASSV_ABOVE_2_7
double
pk_cb_tot
=
0
;
double
pk_cb_tot
=
0
;
int
ret
=
spectra_pk_nl_at_k_and_z
(
&
ba
,
&
pm
,
&
sp
,
k
,
z
,
&
mypk
,
&
pk_cb_tot
);
assert
(
spectra_pk_nl_at_k_and_z
(
&
ba
,
&
pm
,
&
sp
,
k
,
z
,
&
mypk
,
&
pk_cb_tot
)
==
_SUCCESS_
)
;
#else
#else
int
ret
=
spectra_pk_nl_at_k_and_z
(
&
ba
,
&
pm
,
&
sp
,
k
,
z
,
&
mypk
);
assert
(
spectra_pk_nl_at_k_and_z
(
&
ba
,
&
pm
,
&
sp
,
k
,
z
,
&
mypk
)
==
_SUCCESS_
)
;
#endif
#endif
return
mypk
;
return
mypk
;
}
}
...
@@ -654,7 +654,6 @@ double ClassEngine::get_Dv(double z)
...
@@ -654,7 +654,6 @@ double ClassEngine::get_Dv(double z)
//call to fill pvecback
//call to fill pvecback
background_at_tau
(
&
ba
,
tau
,
ba
.
long_info
,
ba
.
inter_normal
,
&
index
,
pvecback
);
background_at_tau
(
&
ba
,
tau
,
ba
.
long_info
,
ba
.
inter_normal
,
&
index
,
pvecback
);
double
H_z
=
pvecback
[
ba
.
index_bg_H
];
double
H_z
=
pvecback
[
ba
.
index_bg_H
];
double
D_ang
=
pvecback
[
ba
.
index_bg_ang_distance
];
double
D_ang
=
pvecback
[
ba
.
index_bg_ang_distance
];
#ifdef DBUG
#ifdef DBUG
...
@@ -663,8 +662,7 @@ double ClassEngine::get_Dv(double z)
...
@@ -663,8 +662,7 @@ double ClassEngine::get_Dv(double z)
#endif
#endif
double
D_v
;
double
D_v
;
D_v
=
pow
(
D_ang
*
(
1
+
z
),
2
)
*
z
/
H_z
;
D_v
=
std
::
pow
(
D_ang
*
(
1
+
z
)
*
D_ang
*
(
1
+
z
)
*
z
/
H_z
,
1.
/
3.
);
D_v
=
pow
(
D_v
,
1.
/
3.
);
#ifdef DBUG
#ifdef DBUG
cout
<<
D_v
<<
endl
;
cout
<<
D_v
<<
endl
;
#endif
#endif
...
@@ -729,17 +727,9 @@ double ClassEngine::get_Da(double z)
...
@@ -729,17 +727,9 @@ double ClassEngine::get_Da(double z)
int
index
;
int
index
;
//transform redshift in conformal time
//transform redshift in conformal time
background_tau_of_z
(
&
ba
,
z
,
&
tau
);
background_tau_of_z
(
&
ba
,
z
,
&
tau
);
//call to fill pvecback
//call to fill pvecback
background_at_tau
(
&
ba
,
tau
,
ba
.
long_info
,
ba
.
inter_normal
,
&
index
,
pvecback
);
background_at_tau
(
&
ba
,
tau
,
ba
.
long_info
,
ba
.
inter_normal
,
&
index
,
pvecback
);
double
H_z
=
pvecback
[
ba
.
index_bg_H
];
double
D_ang
=
pvecback
[
ba
.
index_bg_ang_distance
];
double
D_ang
=
pvecback
[
ba
.
index_bg_ang_distance
];
#ifdef DBUG
cout
<<
"H_z= "
<<
H_z
<<
endl
;
cout
<<
"D_ang= "
<<
D_ang
<<
endl
;
#endif
return
D_ang
;
return
D_ang
;
}
}
...
...
src/camel/Class/MnClassEngine.hh
View file @
ea9ea8c1
...
@@ -38,7 +38,7 @@ public:
...
@@ -38,7 +38,7 @@ public:
const
std
::
string
&
prefile
);
const
std
::
string
&
prefile
);
// destructor
// destructor
~
MnClassEngine
();
virtual
~
MnClassEngine
();
//this will update the CLASS computations for a realization of par
//this will update the CLASS computations for a realization of par
//conistent with the MnUserVariables
//conistent with the MnUserVariables
...
...
src/camel/Lensing/Chi2Lensing.hh
View file @
ea9ea8c1
...
@@ -35,7 +35,7 @@ public:
...
@@ -35,7 +35,7 @@ public:
Chi2Lensing
(
LensingLikelihood
*
ll
,
const
Variables
&
pars
,
Engine
*
_klass
);
Chi2Lensing
(
LensingLikelihood
*
ll
,
const
Variables
&
pars
,
Engine
*
_klass
);
// destructor
// destructor
~
Chi2Lensing
();
virtual
~
Chi2Lensing
();
//operator to override: must return something comptible with -2log(L)
//operator to override: must return something comptible with -2log(L)
double
chi2_eff
(
const
std
::
vector
<
double
>&
par
)
const
;
double
chi2_eff
(
const
std
::
vector
<
double
>&
par
)
const
;
...
...
src/camel/Lensing/LensingLikelihood.hh
View file @
ea9ea8c1
...
@@ -22,7 +22,7 @@ class LensingLikelihood
...
@@ -22,7 +22,7 @@ class LensingLikelihood
{
{
public:
public:
virtual
~
LensingLikelihood
(){};
virtual
int
lmax
()
const
=
0
;
virtual
int
lmax
()
const
=
0
;
//convention: return -log(L)
//convention: return -log(L)
virtual
double
computePPLikelihood
(
const
std
::
vector
<
unsigned
int
>&
l
,
virtual
double
computePPLikelihood
(
const
std
::
vector
<
unsigned
int
>&
l
,
...
...
src/camel/MCMC/MCMC_adaptive.cc
View file @
ea9ea8c1
...
@@ -323,7 +323,8 @@ void MCMC_adaptive::fill_chain(pdf* target_func, pdf* proposal,int init_step, co
...
@@ -323,7 +323,8 @@ void MCMC_adaptive::fill_chain(pdf* target_func, pdf* proposal,int init_step, co
int
gate
=
_bunchSize
;
int
gate
=
_bunchSize
;
if
(
i
%
gate
==
0
)
if
(
i
%
gate
==
0
)
{
{
if
(
_verbose
)
cout
<<
"dump at index "
<<
i
<<
" from "
<<
i
-
gate
<<
" to "
<<
i
-
1
<<
endl
;
//if (_verbose) cout << "dump at index " << i << " from " << i-gate << " to " << i-1 << endl;
cout
<<
i
<<
" written"
<<
endl
;
chain_running
.
open
(
chain_run_name
,
fstream
::
app
);
chain_running
.
open
(
chain_run_name
,
fstream
::
app
);
for
(
int
k
=
i
-
gate
;
k
<
i
;
k
++
)
for
(
int
k
=
i
-
gate
;
k
<
i
;
k
++
)
...
...
src/camel/MCMC/MCMC_sampler.cc
View file @
ea9ea8c1
...
@@ -136,7 +136,7 @@ void MCMC_sampler::write_chain(char* str)
...
@@ -136,7 +136,7 @@ void MCMC_sampler::write_chain(char* str)
}
}
void
MCMC_sampler
::
write_if_useful
(
vector
<
double
>&
vec
,
char
*
str
)
void
MCMC_sampler
::
write_if_useful
(
vector
<
double
>&
vec
,
const
char
*
str
)
{
{
cout
<<
"output written in:"
<<
str
<<
endl
;
cout
<<
"output written in:"
<<
str
<<
endl
;
...
@@ -149,7 +149,7 @@ void MCMC_sampler::write_if_useful(vector<double>& vec,char* str)
...
@@ -149,7 +149,7 @@ void MCMC_sampler::write_if_useful(vector<double>& vec,char* str)
}
}
void
MCMC_sampler
::
write_vecHep
(
vector
<
HepVector
>&
vec
,
char
*
str
)
void
MCMC_sampler
::
write_vecHep
(
vector
<
HepVector
>&
vec
,
const
char
*
str
)
{
{
cout
<<
"output written in:"
<<
str
<<
endl
;
cout
<<
"output written in:"
<<
str
<<
endl
;
...
...
src/camel/MCMC/MCMC_sampler.hh
View file @
ea9ea8c1
...
@@ -67,8 +67,8 @@ public:
...
@@ -67,8 +67,8 @@ public:
void
compute_mean
(
int
stop
,
HepVector
mean
);
void
compute_mean
(
int
stop
,
HepVector
mean
);
void
write_rearranged_chain
(
char
*
str
);
//rec, value, lkh
void
write_rearranged_chain
(
char
*
str
);
//rec, value, lkh
void
set_par
(
Parser
parser
);
// set parameters value using Parser
void
set_par
(
Parser
parser
);
// set parameters value using Parser
void
write_if_useful
(
std
::
vector
<
double
>&
vec
,
char
*
str
);
void
write_if_useful
(
std
::
vector
<
double
>&
vec
,
const
char
*
str
);
void
write_vecHep
(
std
::
vector
<
HepVector
>&
vec
,
char
*
str
);
void
write_vecHep
(
std
::
vector
<
HepVector
>&
vec
,
const
char
*
str
);
//accessors
//accessors
...
...
src/camel/MCMC/exec/mainMCMC.cc
View file @
ea9ea8c1
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
#include "Chi2Factory.hh"
#include "Chi2Factory.hh"
#include "cxxsupport/paramfile.h"
#include "cxxsupport/paramfile.h"
#include "cxxsupport/cxxutils.h"
#include "Chi2Combiner.hh"
#include "Chi2Combiner.hh"
#include "Parser.hh"
#include "Parser.hh"
...
@@ -48,7 +50,17 @@ int main(int argc, char *argv[])
...
@@ -48,7 +50,17 @@ int main(int argc, char *argv[])
std
::
cout
<<
"output file "
+
fileName
+
" already exists: removing it"
<<
endl
;
std
::
cout
<<
"output file "
+
fileName
+
" already exists: removing it"
<<
endl
;
remove_file
(
fileName
);
remove_file
(
fileName
);
}
}
string
base
=
BaseName
(
fileName
);
string
ar_file
=
string
(
"ar_vs_length_"
)
+
base
;
string
scale_file
=
string
(
"scale_"
)
+
base
;
string
cor_file
=
string
(
"last_step_"
)
+
base
;
cout
<<
"MCMC output files:"
<<
endl
;
cout
<<
ar_file
<<
" "
<<
scale_file
<<
" "
<<
cor_file
<<
" "
<<
endl
;
cout
<<
"output files:"
<<
endl
;
cout
<<
ar_file
<<
" "
<<
scale_file
<<
" "
<<
cor_file
<<
" "
<<
endl
;
//MCMC specific parameters
//MCMC specific parameters
const
string
algo
=
parser
.
params
.
find
<
string
>
(
"algo"
,
"ada"
);
const
string
algo
=
parser
.
params
.
find
<
string
>
(
"algo"
,
"ada"
);
...
@@ -77,7 +89,6 @@ int main(int argc, char *argv[])
...
@@ -77,7 +89,6 @@ int main(int argc, char *argv[])
const
int
dim
=
lkh
->
Get_par_num
();
const
int
dim
=
lkh
->
Get_par_num
();
cout
<<
"dim="
<<
dim
<<
endl
;
cout
<<
"dim="
<<
dim
<<
endl
;
//--------defining seeds-----------------------------------------------
//--------defining seeds-----------------------------------------------
unsigned
int
seed
(
0
);
unsigned
int
seed
(
0
);
if
(
parser
.
params
.
param_present
(
"seed"
)){
if
(
parser
.
params
.
param_present
(
"seed"
)){
...
@@ -151,8 +162,7 @@ int main(int argc, char *argv[])
...
@@ -151,8 +162,7 @@ int main(int argc, char *argv[])
if
(
use_ext_cov
)
if
(
use_ext_cov
)
{
{
cout
<<
"Read proposal cov matrix.."
<<
endl
;
cout
<<
"Read proposal cov matrix="
<<
proposal_cov
.
c_str
()
<<
endl
;
cout
<<
proposal_cov
.
c_str
()
<<
endl
;
proposal
->
set_cov
(
proposal_cov
.
c_str
());
proposal
->
set_cov
(
proposal_cov
.
c_str
());
}
}
else
{
else
{
...
@@ -245,21 +255,21 @@ int main(int argc, char *argv[])
...
@@ -245,21 +255,21 @@ int main(int argc, char *argv[])
{
ar_vs_length
.
push_back
(
chain
->
acc_rate
(
0
,
step
));}
{
ar_vs_length
.
push_back
(
chain
->
acc_rate
(
0
,
step
));}
}
}
chain
->
write_if_useful
(
ar_vs_length
,
"
ar_
vs_length.txt"
);
chain
->
write_if_useful
(
ar_vs_length
,
ar_
file
.
c_str
()
);
if
(
algo
==
"ada"
)
if
(
algo
==
"ada"
)
{
{
MCMC_adaptive
*
ada
=
dynamic_cast
<
MCMC_adaptive
*>
(
chain
);
MCMC_adaptive
*
ada
=
dynamic_cast
<
MCMC_adaptive
*>
(
chain
);
chain
->
write_if_useful
(
proposal
->
_scale_vs_length
,
"
scale_
vs_length.txt"
);
chain
->
write_if_useful
(
proposal
->
_scale_vs_length
,
scale_
file
.
c_str
()
);
ofstream
f
(
"
cor
r.txt"
);
ofstream
f
(
cor
_file
.
c_str
()
);
if
(
!
f
)
{
if
(
!
f
)
{
cout
<<
"Error in file creation!"
;
cout
<<
"Error in file creation!"
;
}
}
f
<<
ada
->
mean
()
<<
endl
//mean
f
<<
ada
->
mean
()
<<
endl
//mean
<<
proposal
->
Get_cov_matrix
()
<<
endl
;
//cov matrix
<<
proposal
->
Get_cov_matrix
()
<<
endl
;
//cov matrix
f
.
close
();
f
.
close
();
cout
<<
"
output written in:corr.txt"
<<
endl
;;
cout
<<
"
proposal cov written in "
<<
cor_file
<<
endl
;;
}
}
delete
chi2
;
delete
chi2
;
...
...
src/cxxsupport/cxxutils.cc
View file @
ea9ea8c1
...
@@ -294,3 +294,15 @@ string DirName(string source)
...
@@ -294,3 +294,15 @@ string DirName(string source)
source
.
erase
(
std
::
find
(
source
.
rbegin
(),
source
.
rend
(),
'/'
).
base
(),
source
.
end
());
source
.
erase
(
std
::
find
(
source
.
rbegin
(),
source
.
rend
(),
'/'
).
base
(),
source
.
end
());
return
source
;
return
source
;
}
}
string
BaseName
(
string
source
)
{
if
(
source
.
size
()
<=
1
)
//Make sure it's possible to check the last character.
{
return
source
;
}
planck_assert
(
*
(
source
.
rbegin
()
+
1
)
!=
'/'
,
source
+
" had no BaseName"
);
source
.
erase
(
source
.
begin
(),
std
::
find
(
source
.
rbegin
(),
source
.
rend
(),
'/'
).
base
());
return
source
;
}
src/cxxsupport/cxxutils.h
View file @
ea9ea8c1
...
@@ -264,6 +264,8 @@ inline unsigned int healpix_repcount (int npix)
...
@@ -264,6 +264,8 @@ inline unsigned int healpix_repcount (int npix)
//acess directory name without trailing slash
//acess directory name without trailing slash
std
::
string
DirName
(
std
::
string
x
);
std
::
string
DirName
(
std
::
string
x
);
std
::
string
BaseName
(
std
::
string
x
);
...
...
work/batch/cc/Minimize5.sh
View file @
ea9ea8c1
...
@@ -49,8 +49,7 @@ fi
...
@@ -49,8 +49,7 @@ fi
parbase
=
$(
basename
$file
)
parbase
=
$(
basename
$file
)
dirout
=
$(
echo
$parbase
|
awk
-F
"."
'{NF--;printf($0)}'
)
_
"min"
dirout
=
${
parbase
%
".par"
}
_
"min"
OUTDIR
=
$PWD
/
$dirout
OUTDIR
=
$PWD
/
$dirout
...
@@ -115,7 +114,7 @@ RANDOM=\${SGE_TASK_ID}
...
@@ -115,7 +114,7 @@ RANDOM=\${SGE_TASK_ID}
awk -v seed=
\$
RANDOM -f genrand.awk parfile_in > parfile
awk -v seed=
\$
RANDOM -f genrand.awk parfile_in > parfile
fi
fi
cp parfile
$OUTDIR
/camel
\$
{SGE_TASK_ID}.
par
cp parfile
$OUTDIR
/camel
\$
{SGE_TASK_ID}.
cml
echo "***************************************************************"
echo "***************************************************************"
#================================
#================================
# Camel run
# Camel run
...
...
work/batch/cc/runMCMC_class.sh
View file @
ea9ea8c1
...
@@ -26,7 +26,8 @@ fi
...
@@ -26,7 +26,8 @@ fi
parFile
=
$(
readlink
-e
$file
)
parFile
=
$(
readlink
-e
$file
)
parbase
=
$(
basename
$parFile
)
parbase
=
$(
basename
$parFile
)
dirout
=
${
parbase
%
".par"
}
_
"MC"
#rm extension (whatever it is)
dirout
=
$(
echo
$parbase
|
awk
-F
"."
'{NF--;printf($0)}'
)
_
"MC"
zeroot
=
$PWD
/
$dirout
zeroot
=
$PWD
/
$dirout
...
@@ -59,7 +60,8 @@ if [ $ndim -ne $nlines ] ; then
...
@@ -59,7 +60,8 @@ if [ $ndim -ne $nlines ] ; then
echo
"covariance matrix not compatible in size with parFile"
echo
"covariance matrix not compatible in size with parFile"
exit
1
exit
1
fi
fi
scale
=
$(
echo
"
$ndim
"
|
awk
'{printf(2.38*2.38/$0)}'
)
# now defult behavior of teh application
#scale=$(echo "$ndim" | awk '{printf(2.38*2.38/$0)}')
cat
>
mc_setup
<<
EOF
cat
>
mc_setup
<<
EOF
...
@@ -67,7 +69,6 @@ length=$NSAMPLES
...
@@ -67,7 +69,6 @@ length=$NSAMPLES
proposal_cov=
$cov
proposal_cov=
$cov
derived=sigma8
derived=sigma8
do_mPK=true
do_mPK=true
scale=
$scale
EOF
EOF
echo
"**************************************"
echo
"**************************************"
...
@@ -111,9 +112,7 @@ cp $parbase $PWD/camel.par
...
@@ -111,9 +112,7 @@ cp $parbase $PWD/camel.par
./
$localexec
$parbase
$PWD
/samples
\$
{SGE_TASK_ID}.txt
./
$localexec
$parbase
$PWD
/samples
\$
{SGE_TASK_ID}.txt
cp ar_vs_length.txt
$PWD
/ar_vs_length
\$
{SGE_TASK_ID}.txt
cp *.txt
$PWD
/
cp scale_vs_length.txt
$PWD
/scale_vs_length
\$
{SGE_TASK_ID}.txt
cp corr.txt
$PWD
/corr
\$
{SGE_TASK_ID}.txt
qstat -j
\$
{JOB_ID} -nenv
qstat -j
\$
{JOB_ID} -nenv
eof
eof
...
...
work/ref/hlpTT_PS_H0.
par
→
work/ref/hlpTT_PS_H0.
cml
View file @
ea9ea8c1
...
@@ -71,10 +71,8 @@ class sBBN\ file bbn/sBBN_2017_marcucci.dat
...
@@ -71,10 +71,8 @@ class sBBN\ file bbn/sBBN_2017_marcucci.dat
precisionFile=class_pre/hpjul3.pre
precisionFile=class_pre/hpjul3.pre
###############################################################
###############################################################
# minimization
###############################################################
#fitter
nitermax=50000
nitermax=50000
set_stra=2
set_stra=2
set_tol=0.00001
set_tol=0.00001
...
@@ -83,3 +81,14 @@ set_tol=0.00001
...
@@ -83,3 +81,14 @@ set_tol=0.00001
remove_cosmo_limits=false
remove_cosmo_limits=false
doHesse=true
doHesse=true
###############################################################
###############################################################
#MCMC
#1st samples are drawn up to t0 from given proposal (scaled by scale)
#if your matrix is nice scale_th~2.4**2/ndim otherwise low (default=0.001)
#t0=2000
#scale=0.3
#then cov is adapted up to ts with scale_th. If your matrix is nice do
# not destroy things there.
#ts=0
#then scale will auto-adapt to reach ar~0.25
work/ref/hlpTT_PS_H0_min/covmat8.dat
→
work/ref/hlpTT_PS_H0_min
_ref
/covmat8.dat
View file @
ea9ea8c1
File moved
work/ref/hlpTT_PS_H0_min/hlpTT_PS_H0_min.o8236803.8
→
work/ref/hlpTT_PS_H0_min
_ref
/hlpTT_PS_H0_min.o8236803.8
View file @
ea9ea8c1
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment