ns_ombh2_BBN.png

References

Introduction

COSMOMC(Cosmological Monte Carlo) is a software to estimate certain cosmological parameters by Markov Chain Mote Carlo(MCMC) using various datasets, basically CMB power spectrum.

Install

1. wmap_likelihood

Download the source file from here(need "*_full_*" ver. to perform "test") and unzip and untar (tar zxvf) it. Modify "Makefile" to fit your environment:

CFITSIO=/opt/cfitsio
WMAPFLAGS  = -DOPTIMIZE
LAPACK = -L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_lapack -lmkl -lguide -lpthread
F90    = ifort
FFLAGS = -O2 $(WMAPFLAGS) -u -g -O2 -CB -traceback -warn all -warn noerrors \
-check all -check noarg_temp_created -fpe0 -zero -Vaxlib -fpp
INCS   = -I. -I$(CFITSIO)/include
LIBS   = -L. -L$(CFITSIO)/lib -lcfitsio $(LAPACK)

You also have to edit a variable of "WMAP_data_dir" in "WMAP_7yr_options.F90" from "data/" to certain absolute path like:

!---------------------------------------------------
! location of input data
! ---------------------------------------------------
   character(len=*), parameter :: WMAP_data_dir = '/global/homes/c/chinoney/opt_hopper/wmap_likelihood/data/'

Then, you make them:

make
make check
./test
 
WMAP 7-year likelihood test program
 ===================================
 
 NOTE: This code uses a different CMB spectrum than previous versions.
       The new spectrum (data/test_cls_v4.dat) is a better fit to the data
       than the old one (data/test_cls_v3.dat).
 
       As before, a constant offset is now being subtracted from ln(L).
       The value of the offset is the sum of the determinant
       contributions to ln(L) computed for the CMB spectrum in
       data/test_cls_v4.dat, ln_det_C_f:
 
         -2ln(L) = chi^2 + ln_det_C - ln_det_C_f

 Reading in Cls from: /home/username/data/wmap_likelihood/data/test_cls_v4.dat
 Initializing WMAP likelihood, version v4.1
 ------------------------------------------------------------
 WMAP likelihood evaluation report:
 no errors
 ------------------------------------------------------------
------------------------------------------------------------------
Breakdown of -2ln(L)
------------------------------------------------------------------
MASTER TTTT              =   1249.018875 for   1168 ls
Beam/ptsrc TT correction =     -3.607327
low-l TTTT gibbs         =     -9.380526
MASTER TETE chi2         =    818.570514 for    777 ls
MASTER TETE det          =   3775.082049
TT/TE/EE/BB low-l chi2   =   1263.436569 for   1170 pixels
TT/TE/EE/BB low-l det    =    384.536614
------------------------------------------------------------------
TOTAL -2ln(L)            =   7477.656769
------------------------------------------------------------------
Expected -2ln(L)         =   7477.656769
      Difference         =      0.000000
------------------------------------------------------------------
 
 Differences on the order of O(0.001) are normal between platforms.

e.g. @NERSC for Intel compiler (hopper)

Edit Makefile like below:

3c3
< CFITSIO = /project/projectdirs/cmb/modules/hopper/pgi/cmb/2.5.1/cfitsio_3.25-2.5.1/
---
> CFITSIO=/usr/local
37,41d36
< F90    = ftn
< FFLAGS = -fast -mp=nonuma -Mipa=fast $(WMAPFLAGS)
< INCS   = -I$(CFITSIO)/include
< LIBS   = -L.
< LIBS  += -L/project/projectdirs/cmb/modules/hopper/pgi/cmb/2.5.1/cfitsio_3.25-2.5.1/lib -lcfitsio -lm
50,53c45,48
< #F90    = ifort
< #FFLAGS = -O $(WMAPFLAGS)
< #INCS   = -I. -I$(CFITSIO)/include
< #LIBS   = -L. -L$(CFITSIO)/lib -lcfitsio -lscs_mp -lpthread
---
> F90    = ifort
> FFLAGS = -O $(WMAPFLAGS)
> INCS   = -I. -I$(CFITSIO)/include
> LIBS   = -L. -L$(CFITSIO)/lib -lcfitsio -lscs_mp -lpthread

then make it:

make 
make check

2. cosmomc

Download the source from here (direct link!) and unzip and untar it. move to cosmomc/source dir, then modify "Makefile", then "make all":

WMAP = /usr/local/wmap_likelihood/v4p1/likelihood_v4p1
cfitsio = /opt/cfitsio

F90C     = ifort
FFLAGS = -O2 -Vaxlib -ip -W0 -WB -openmp -fpp
LAPACKL = -L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_lapack -lmkl -lguide -lpthread

e.g. @NERSC (hopper)

Edit Makefile like below:

9c9
< WMAP = /home/username/opt/wmap_likelihood/
---
> WMAP = /home/aml1005/WMAP7/likelihood_v4
12c12
< cfitsio = /project/projectdirs/cmb/modules/hopper/pgi/cmb/2.5.1/cfitsio_3.25-2.5.1/
---
> cfitsio = /usr/local/cfitsio/intel10/64/3.040
15c15
< #GSLPATH = /home/aml1005/libs/gsl
---
> GSLPATH = /home/aml1005/libs/gsl
20,23d19
< F90C = ftn
< FFLAGS = -fast -mp=nonuma -Mipa=fast -DESCAPEBACKSLASH -Mpreprocess
< LAPACKL = -lm
<
26,28c22,24
< #F90C     = mpif90
< #FFLAGS = -O2 -ip -W0 -WB -openmp -fpp -DMPI -vec_report0 -mkl=parallel
< #LAPACKL = -lmkl_lapack
---
> F90C     = mpif90
> FFLAGS = -O2 -ip -W0 -WB -openmp -fpp -DMPI -vec_report0 -mkl=parallel
> LAPACKL = -lmkl_lapack
40,47c36,43
< #ifeq ($(COSMOHOST),cosmos)
< #F90C = ifort
< #FFLAGS = -openmp -O3 -w -fpp2 -DMPI
< #LAPACKL = -mkl=sequential -lmkl_lapack -lmpi
< #cfitsio = $(CFITSIO)
< #WMAP = $(COSMOLIB)/WMAP7
< #GSLPATH = $(GSL_ROOT)
< #endif
---
> ifeq ($(COSMOHOST),cosmos)
> F90C = ifort
> FFLAGS = -openmp -O3 -w -fpp2 -DMPI
> LAPACKL = -mkl=sequential -lmkl_lapack -lmpi
> cfitsio = $(CFITSIO)
> WMAP = $(COSMOLIB)/WMAP7
> GSLPATH = $(GSL_ROOT)
> endif

3. FuturCMB

Download source file from here(direct link) and untar it.

mkdir FUTURCMB
cd FUTURCMB
wget http://lpsc.in2p3.fr/perotto/FUTURCMB.tar.gz
tar zxvf FUTURCMB.tar.gz
ls
FUTURCMB.f90  FUTURCMB_lensnoise.f90  FUTURCMB_params.ini  FUTURCMB_random.f90  FUTURCMB_README
cd ../

FuturCMB needs cosmomc cources. You had better create new cosmomc directory and FuturCMB codes are to be moved in cosmomc/source/ directory:

ls
cosmomc.July.2011.tar.gz  FUTURCMB
tar zxvf cosmomc.July.2011.tar.gz
mv cosmomc cosmomc_for_futurcmb
cd cosmomc_for_futurcmb
cp ../../FUTURCMB/*.f90 ./
cp ../../cosmomc.July.2011/source/Makefile ./

You have to add certain lines to Makefile on "cosmomc/source" to compile "futurcmb" like below:

ALMFILES = FUTURCMB_lensnoise.o FUTURCMB_random.o FUTURCMB.o
futurcmb: $(ALMFILES)
      $(F90C) -o ../FuturCMB $(ALMFILES) ../camb/utils.o $(LINKFLAGS) $(F90FLAGS)

Edit "cmbtypes.f90" as follows:

9,10c9
<   integer, parameter  :: num_cls  = 5
<   integer :: num_clsS=min(num_cls,5)
---
>   integer, parameter  :: num_cls  = 4

And also edit "CMB_Cls_simple.f90" as follows:

206c206
<        if (num_cls == 5) then
---
>        if (CMB_Lensing) then
468c468
<         if (num_cls == 5 ) then
---
>         if (CMB_Lensing) then

Then make it:

make all
make futurcmb

e.g. @NERSC (hopper)

You have to edit "FUTURCMB.f90" as follows:

94c94
<   if (IARGC < 1) then 
---
>   if (iarg() < 1) then 

(4. CAMB)

You can make "camb" from cosmomc source even though cmsmomc uses "camb" via library(libcamb.a).

How to use