Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
Xavier Garrido
CAMEL
Commits
069b144a
Commit
069b144a
authored
Feb 16, 2017
by
perdereau
Browse files
test
parents
95029c63
76813f8d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
177 additions
and
55 deletions
+177
-55
cmt/camel_setup.sh
cmt/camel_setup.sh
+1
-0
cmt/requirements-gcc
cmt/requirements-gcc
+16
-14
lik/BAO/BAO1D_dr12_mgs.lik
lik/BAO/BAO1D_dr12_mgs.lik
+11
-0
lik/BAO/BAO1D_new_mgs.lik
lik/BAO/BAO1D_new_mgs.lik
+11
-0
par/examples/hlpPS_tauprior.par
par/examples/hlpPS_tauprior.par
+84
-0
src/camel/BAO/BAO_chi2.cc
src/camel/BAO/BAO_chi2.cc
+3
-1
src/camel/Chi2Combiner.cc
src/camel/Chi2Combiner.cc
+1
-6
src/camel/Class/ClassEngine.cc
src/camel/Class/ClassEngine.cc
+1
-1
src/camel/exec/writeSpectraPk.cc
src/camel/exec/writeSpectraPk.cc
+45
-29
work/batch/cc/Profile.sh
work/batch/cc/Profile.sh
+3
-3
work/tools/idl/mnufit.pro
work/tools/idl/mnufit.pro
+1
-1
No files found.
cmt/camel_setup.sh
View file @
069b144a
...
...
@@ -79,3 +79,4 @@ echo "your CAMELROOT is $CAMELROOT"
# put 1 at the end of next line if you want a closer look at compilaton
export
VERBOSE
=
echo
"if you want more verbose compilation define VERBOSE environement variable to 1: export VERBOSE=1"
cmt/requirements-gcc
View file @
069b144a
...
...
@@ -3,12 +3,13 @@ package CAMEL
use
class
HEAD
#
compiler
options
#
macro
cpp
"icpc"
#
macro
cppflags
" -O2 -ip -ansi_alias -align -Wbrief "
#
default
is
gcc
here
are
the
C
++
compiler
options
macro
cppflags
" -O2 -pipe -ansi -Woverloaded-virtual -Wpedantic -Wunused -Wmaybe-uninitialized -Wno-deprecated -Wno-div-by-zero -Wno-variadic-macros"
macro
cflags
" -O2 -fopenmp "
macro
cppflags
" -O3 -pipe -ansi -Woverloaded-virtual -Wpedantic -Wunused -Wmaybe-uninitialized -Wno-deprecated -Wno-div-by-zero "
#
although
it
may
be
strange
we
do
not
compile
CAMEL
with
OMP
because
CLASS
is
not
thread
safe
#
no
worries
:
CLASS
is
compiled
with
OMP
#
macro_append
cppflags
"-fopenmp "
macro_append
cpplinkflags
" -fopenmp "
#
CAMEL
includes
...
...
@@ -23,8 +24,9 @@ include_dirs "../src/camel/JLA/jla_likelihood_v3/src"
#
cfitsio
include_dirs
"$(CLIKDIR)/include"
macro_append
CAMEL_linkopts
" -L$(CLIKDIR) -lcfitsio"
#
include_dirs
"$(CLIKDIR)/include"
#
macro_append
CAMEL_linkopts
" -L$(CLIKDIR) -lcfitsio"
macro_append
CAMEL_linkopts
" -lcfitsio"
#
JLA
:
requires
cblas
/
lapack
macro_append
cppflags
' -DJLA '
...
...
@@ -34,9 +36,9 @@ application test_jla -group=test -s=../src/camel test/test_jla.cc
#
PLANCK
macro_append
cppflags
" -DCLIK $(CLIKCFLAGS)"
macro_append
cflags
" -DCLIK $(CLIKCFLAGS)"
macro_append
CAMEL_linkopts
" $(CLIKLIBS) "
#
macro_append
cppflags
" -DCLIK $(CLIKCFLAGS)"
#
macro_append
cflags
" -DCLIK $(CLIKCFLAGS)"
#
macro_append
CAMEL_linkopts
" $(CLIKLIBS) "
#
include_dirs
"$(CLIKDIR)/include"
#
include_dirs
"$(CLIKDIR)/src"
...
...
@@ -47,13 +49,13 @@ macro_append CAMEL_linkopts " $(CLIKLIBS) "
#
PICO
macro_append
cppflags
" -DPICO $(PICOINC) "
macro_append
CAMEL_linkopts
" -L$(PICO_CODE) -lpico -lpython2.7 "
#
macro_append
cppflags
" -DPICO $(PICOINC) "
#
macro_append
CAMEL_linkopts
" -L$(PICO_CODE) -lpico -lpython2.7 "
#
the
previous
line
should
be
sufficient
otherwise
try
the
PICOLIBS
#
(
set
in
camel_setup
.
sh
)
#
macro_append
CAMEL_linkopts
" $(PICOLIBS)"
macro_append
cppflags
' -DPICODATA=\"$(PICO_DATA)\" '
application
testPico
-
group
=
test
-
s
=../
src
/
camel
/
pico
/
exec
testPico
.
cc
#
macro_append
cppflags
' -DPICODATA=\"$(PICO_DATA)\" '
#
application
testPico
-
group
=
test
-
s
=../
src
/
camel
/
pico
/
exec
testPico
.
cc
###
FROM
THERE
YOU
DONT
NEED
TO
TOUCH
###########################################################################################
...
...
lik/BAO/BAO1D_dr12_mgs.lik
0 → 100644
View file @
069b144a
# for adding comment # followed by a space (only on a new line)
# input data for BAO
# in/fix | name | num of data | z | value | error | out of diag| elements (eventually)
in 6dF 1 0.106 457 27
fix SDSS(R) 1 0.35 8.88 0.17
fix BOSS(DR9) 1 0.57 13.67 0.22
fix BOSS-CMASS(DR11) 1 0.57 2056 20
fix BOSS-LOWZ(DR11) 1 0.32 1264 25
fix WiggleZ 3 0.44 0.0916 0.0071 0.60 0.0726 0.0034 0.73 0.0592 0.0032 0.003068 0.0 0.00222005
fix SDSS 2 0.20 0.1905 0.0061 0.35 0.1097 0.0036 0.002723
in SDSS-MGS 1 0.15 664 25
lik/BAO/BAO1D_new_mgs.lik
0 → 100644
View file @
069b144a
# for adding comment # followed by a space (only on a new line)
# input data for BAO
# in/fix | name | num of data | z | value | error | out of diag| elements (eventually)
in 6dF 1 0.106 457 27
fix SDSS(R) 1 0.35 8.88 0.17
fix BOSS(DR9) 1 0.57 13.67 0.22
fix BOSS-CMASS(DR11) 1 0.57 2056 20
in BOSS-LOWZ(DR11) 1 0.32 1264 25
fix WiggleZ 3 0.44 0.0916 0.0071 0.60 0.0726 0.0034 0.73 0.0592 0.0032 0.003068 0.0 0.00222005
fix SDSS 2 0.20 0.1905 0.0061 0.35 0.1097 0.0036 0.002723
in SDSS-MGS 1 0.15 664 25
par/examples/hlpPS_tauprior.par
0 → 100644
View file @
069b144a
###############################################################
#Boltzman Engine
engine=pico
###############################################################
#Cosmological model
par omega_b cosm 0.02224 0.00027 0.017 0.027
par omega_cdm cosm 0.1192 0.0026 0.09 0.15
par 100*theta_s cosm 1.0418 0.6E-04 1.03 1.05
par tau_reio cosm 0.07 0.13E-01 0.01 0.20
par log(10^10A_s) cosm 3.07 0.025 2.7 3.5
par n_s cosm 0.96 0.0070 0.9 1.1
###############################################################
gauss1 tau_reio 0.058 0.012
###############################################################
#LIKELIHOODS
#-----------------------------
#CMB high-l (HILLIPOP)
Hillipop=HiLLiPOP/DX11dHM_superExt_CO_TT.lik
par A_planck nui 1. 0.001 0.9 1.1
par c0 nui 0. 0.001 -0.05 0.05
par c1 nui 0. 0.001 -0.05 0.05
fix c2 nui 0. 0.001 -0.05 0.05
par c3 nui 0. 0.001 -0.05 0.05
par c4 nui 0.004 0.001 -0.05 0.05
par c5 nui 0.004 0.001 -0.05 0.05
par Aradio nui 1. 1E-01 0.0 2
par Adusty nui 1. 1E-01 0.0 2
par Asz nui 1. 0.1 0.0 10
par Acib nui 1. 0.1 0.0 10
par AdustTT nui 1. 0.1 0.0 2
fix AdustPP nui 0. 0.1 0.0 2
fix AdustTP nui 0. 0.1 0.0 2
par Aksz nui 0. 1.0 0.0 10
par Aszxcib nui 0. 1.0 0.0 10
#PRIORS
gauss1 AdustTT 1 0.2
gauss1 Asz 1 0.2
gauss1 Acib 1 0.2
gauss1 Aradio 1 0.2
gauss1 Adusty 1 0.2
gauss1 A_planck 1 0.0025
gauss1 c0 0 2e-3
gauss1 c1 0 2e-3
gauss1 c3 0 2e-3
gauss1 c4 0.002 2e-3
gauss1 c5 0.002 2e-3
#-----------------------------
###############################################################
###############################################################
#pico neutrino setup
# 1 degenerated massive neutrino
fix m_ncdm cosm 0.06
fix N_nu cosm 3.046
fix YHe cosm 0.248
fix Alens cosm 1
###############################################################
###############################################################
#fitter
nitermax=50000
set_stra=2
set_tol=0.00001
#output options
remove_cosmo_limits=false
doHesse=true
###############################################################
src/camel/BAO/BAO_chi2.cc
View file @
069b144a
...
...
@@ -64,6 +64,8 @@ double BAO_chi2::chi2_eff(const std::vector<double>& par) const
if
((
_data_name
[
i
]
==
"BOSS-CMASS(DR11)"
)
&&
(
_data
[
i
]
==
1421
))
cosmo
[
i
]
=
(
engine
->
get_Da
(
_z
[
i
]))
*
149.28
/
rs_drag
;
// if((_data_name[i]=="BOSS-CMASS(DR11)")&&(_data[i]==1421)) cout <<"Da(z=0.57) ="<< engine->get_Da(_z[i]) <<endl;
if
((
_data_name
[
i
]
==
"BOSS-CMASS(DR11)"
)
&&
(
_data
[
i
]
==
96.8
))
cosmo
[
i
]
=
(
engine
->
get_H
(
_z
[
i
]))
*
rs_drag
/
149.28
;
if
((
_data_name
[
i
]
==
"SDSS-MGS"
)
&&
(
_data
[
i
]
==
664.
))
cosmo
[
i
]
=
engine
->
get_Dv
(
_z
[
i
])
*
rs_drag
/
149.69
;
//cout << " _data_name[i] "<< cosmo[i]<<" "<< _data[i] << endl;
// if((_data_name[i]=="BOSS-CMASS(DR11)")&&(_data[i]==96.8)) cout <<"H(z=0.57) ="<< engine->get_H(_z[i]) <<endl;
}
...
...
@@ -75,7 +77,7 @@ double BAO_chi2::chi2_eff(const std::vector<double>& par) const
//chi2 actual calculation
HepVector
diff
;
diff
=
cosmo
-
_data
;
//this computes xT*_inv_cov*x
chi2
=
_inv_cov
.
similarity
(
diff
);
//cout<< "chi2 bao="<< chi2 <<endl;
...
...
src/camel/Chi2Combiner.cc
View file @
069b144a
...
...
@@ -86,15 +86,10 @@ Chi2Combiner::chi2_eff(const std::vector<double>& par) const {
copy
(
par
.
begin
(),
par
.
end
(),
ostream_iterator
<
double
>
(
os
,
"
\t
"
));
}
//update Engine
//1 seul thread
#pragma omp critical
#pragma omp critical
{
self
->
OK
=
engine
->
updateParValues
(
par
);
}
if
(
!
OK
)
{
//A TUNER!!!!!!!!!!!!!1
chi2
=
chi2_prev
*
10.
;
...
...
src/camel/Class/ClassEngine.cc
View file @
069b144a
...
...
@@ -623,7 +623,7 @@ double ClassEngine::get_Dv(double z)
double
*
pvecback
;
//transform redshift in conformal time
background_tau_of_z
(
&
ba
,
z
,
&
tau
);
cout
<<
" dv : tau= "
<<
tau
<<
endl
;
//
cout << " dv : tau= "<< tau <<endl;
//pvecback must be allocated
pvecback
=
(
double
*
)
malloc
(
ba
.
bg_size
*
sizeof
(
double
));
...
...
src/camel/exec/writeSpectraPk.cc
View file @
069b144a
...
...
@@ -15,18 +15,17 @@ using namespace std;
v
ector
<
double
>
logspace
(
double
kmin
,
double
kmax
,
int
npks
){
v
oid
logspace
(
double
kmin
,
double
kmax
,
int
npks
,
vector
<
double
>&
v
){
double
lmax
=
std
::
log
(
kmax
);
double
lmin
=
std
::
log
(
kmin
);
double
step
=
(
lmax
-
lmin
)
/
(
npks
-
1
);
v
ector
<
double
>
v
(
npks
);
v
.
resize
(
npks
);
for
(
size_t
i
=
0
;
i
<
npks
;
i
++
){
double
lval
=
lmin
+
step
*
i
;
v
[
i
]
=
std
::
exp
(
lval
);
}
return
v
;
}
...
...
@@ -59,11 +58,11 @@ int main(int argc,char** argv){
classparms
.
add
(
"z_pk"
,
z0
);
//polar +lens+clphi
classparms
.
add
(
"z_max_pk"
,
z0
);
//polar +lens+clphi
int
do_nl
=
0
;
bool
do_nl
=
false
;
try
{
size_t
test
=
classparms
.
findIndex
(
"non linear"
);
cout
<<
" >>> CLASS nl par found !! "
<<
test
<<
endl
;
do_nl
=
1
;
do_nl
=
true
;
}
catch
(
Message_error
&
msg
){
cout
<<
" >>> CLASS nl par NOT found !! "
<<
endl
;
...
...
@@ -89,28 +88,33 @@ int main(int argc,char** argv){
double
H0
=
e
->
get_H0
();
double
h
=
H0
/
100
;
double
theta
=
e
->
theta
();
cout
<<
" expansion: H0="
<<
H0
<<
" 100*theta_s="
<<
100
*
theta
<<
endl
<<
endl
;
;
cout
<<
endl
<<
" expansion: H0="
<<
H0
<<
" 100*theta_s="
<<
100
*
theta
<<
endl
;
cout
<<
" Omega_m="
<<
e
->
Omega_m
()
<<
" Omega_m*h2="
<<
e
->
Omega_m
()
*
h
*
h
<<
endl
;
//reio
double
tau
=
e
->
get
(
"tau_reio"
);
double
zreio
=
e
->
get
(
"z_reio"
);
cout
<<
" reio : tau_reio="
<<
tau
<<
" z_reio="
<<
zreio
<<
endl
<<
endl
;;
//sigma8
double
s8
=
e
->
get_sigma8
(
0.
);
cout
<<
" sigma8="
<<
s8
<<
endl
;
cout
<<
" f sigma8="
<<
e
->
get_f
(
0.
)
*
e
->
get_sigma8
(
0.
)
<<
endl
;
cout
<<
" reio : tau_reio="
<<
tau
<<
" z_reio="
<<
zreio
<<
endl
;
//YHE
cout
<<
" YHe="
<<
e
->
YHe
()
<<
endl
<<
endl
;
;
cout
<<
" YHe="
<<
e
->
YHe
()
<<
endl
;
cout
<<
"recombination: zrec="
<<
e
->
z_rec
()
<<
" rs(zrec)="
<<
e
->
rs_rec
()
<<
endl
;
cout
<<
"
recombination: zrec="
<<
e
->
z_rec
()
<<
" rs(zrec)="
<<
e
->
rs_rec
()
<<
endl
;
//BAO
cout
<<
"BAO: zd="
<<
e
->
z_drag
()
<<
" rs(zd)="
<<
e
->
rs_drag
()
<<
endl
;
cout
<<
" BAO: zdrag="
<<
e
->
z_drag
()
<<
" rs(zd)="
<<
e
->
rs_drag
()
<<
endl
;
//sigma8/f
cout
<<
" z0="
<<
z0
<<
"-> sigma8="
<<
e
->
get_sigma8
(
z0
)
<<
" f="
<<
e
->
get_f
(
z0
)
<<
" f*sigma8="
<<
e
->
get_sigma8
(
z0
)
*
e
->
get_f
(
z0
)
<<
endl
<<
endl
;
/*
double zval[]={0.,0.5,1.,1.5,2.};
const int nval=sizeof(zval)/sizeof(double);
for (size_t i=0;i<nval;i++){
double z=zval[i];
//cout << "z=" << z<< ": s8=" << e->get_sigma8(z) << ", f=" << e->get_f(z)<< ", f*s8=" << e->get_sigma8(z)*e->get_f(z)<< endl;
}
*/
//ecriture output fits
const
std
::
string
fileName
(
argv
[
3
]);
...
...
@@ -180,10 +184,10 @@ int main(int argc,char** argv){
}
}
// pk
// pk
cout
<<
"Computing P(k) at z="
<<
z0
<<
endl
;
cout
<<
"NL spectrum will"
<<
(
do_nl
==
0
?
" NOT "
:
" "
)
<<
"be computed"
<<
endl
;
cout
<<
"NL spectrum will"
<<
(
!
do_nl
?
" NOT "
:
" "
)
<<
"be computed"
<<
endl
;
//ecriture output fits
std
::
vector
<
fitscolumn
>
pkcols
;
...
...
@@ -192,27 +196,39 @@ int main(int argc,char** argv){
pkcols
.
push_back
(
fitscolumn
(
"Pknl"
,
"(1/Mpc)^-3"
,
1
,
TDOUBLE
));
fout
.
insert_bintab
(
pkcols
);
// def values
vector
<
double
>
kval
;
string
kvfile
=
parser
.
params
.
find
<
string
>
(
"kval_file"
,
""
);
if
(
kvfile
.
size
()
!=
0
)
{
ifstream
f
(
kvfile
.
c_str
());
double
kk
;
while
(
f
>>
kk
)
kval
.
push_back
(
kk
);
}
else
{
const
int
npks
=
parser
.
params
.
find
<
int
>
(
"n_pks"
,
1000
);
const
double
kmin
=
parser
.
params
.
find
<
double
>
(
"k_beg"
,
8.e-4
);
const
double
kmax
=
parser
.
params
.
find
<
double
>
(
"k_end"
,
1
);
logspace
(
kmin
,
kmax
,
npks
,
kval
)
;
}
const
int
npks
=
1000
;
const
double
kmin
=
8.e-4
;
const
double
kmax
=
5
;
vector
<
double
>
kval
=
logspace
(
kmin
,
kmax
,
npks
)
;
vector
<
double
>
pklin
;
vector
<
double
>
pknl
;
for
(
int
k
=
0
;
k
<
npks
;
k
++
){
for
(
int
k
=
0
;
k
<
kval
.
size
()
;
k
++
){
double
myk
=
kval
[
k
];
pklin
.
push_back
(
e
->
get_Pk
(
myk
,
z0
)
);
if
(
do_nl
==
1
)
pknl
.
push_back
(
e
->
get_PkNL
(
myk
,
z0
)
);
if
(
do_nl
)
pknl
.
push_back
(
e
->
get_PkNL
(
myk
,
z0
)
);
}
arr
<
double
>
apk
(
npks
);
for
(
size_t
i
=
0
;
i
<
npks
;
i
++
)
apk
[
i
]
=
kval
[
i
];
arr
<
double
>
apk
(
kval
.
size
()
);
for
(
size_t
i
=
0
;
i
<
kval
.
size
()
;
i
++
)
apk
[
i
]
=
kval
[
i
];
fout
.
write_column
(
1
,
apk
);
for
(
size_t
i
=
0
;
i
<
npks
;
i
++
)
apk
[
i
]
=
pklin
[
i
];
for
(
size_t
i
=
0
;
i
<
kval
.
size
()
;
i
++
)
apk
[
i
]
=
pklin
[
i
];
fout
.
write_column
(
2
,
apk
);
if
(
do_nl
==
1
){
for
(
size_t
i
=
0
;
i
<
npks
;
i
++
)
apk
[
i
]
=
pknl
[
i
];
if
(
do_nl
){
for
(
size_t
i
=
0
;
i
<
kval
.
size
()
;
i
++
)
apk
[
i
]
=
pknl
[
i
];
fout
.
write_column
(
3
,
apk
);
}
...
...
work/batch/cc/Profile.sh
View file @
069b144a
...
...
@@ -138,14 +138,14 @@ echo "fix $var \$type $zeval" >> parfile_in
#special case of degenerate neutrinos (need to decrement Neff by 1 when mass=0)
if [ "
$var
" == "m_ncdm" ] ; then
grep -v ncdm parfile_in | grep -v N_
eff
> tmp
grep -v ncdm parfile_in | grep -v N_
ur
> tmp
if [ "
$zeval
" == "0" ] ; then
echo "class N_
eff
3.046" >> tmp
echo "class N_
ur
3.046" >> tmp
echo "fix N_ncdm cosmo 0" >> tmp
else
echo "class N_ncdm 1" >> tmp
echo "class
N_eff
2.0
46
" >> tmp
echo "class
N_ur
2.0
328
" >> tmp
echo "fix m_ncdm cosmo
$zeval
" >> tmp
fi
...
...
work/tools/idl/mnufit.pro
View file @
069b144a
...
...
@@ -69,7 +69,7 @@ endfor
cgplot
,[
0
,
0
],
yr
,
/
over
al_legend
,
label
,
textcol
=
cgcolor
(
cols
),
box
=
0
,
pos
=
[
0.05
,
0.85
],
/
norm
;
al_legend
,
label
,
textcol
=
cgcolor
(
cols
),
box
=
0
,
pos
=
[
0.05
,
0.85
],
/
norm
if
keyword_set
(
write
)
then
closeplot
,
_extra
=
extra_keywords
...
...
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