In this tutorial, we assume the user installed Cocoa via the Conda installation method, and the name of the Conda environment is cocoa
. We also presume the user's terminal is in the folder where Cocoa was cloned.
Step 1️⃣: activate the cocoa Conda environment, go to the cocoa/Cocoa/projects
folder, and clone the Cosmolike LSST-Y1 project:
conda activate cocoa
cd ./cocoa/Cocoa/projects
${CONDA_PREFIX}/bin/git clone --depth 1 https://github.com/CosmoLike/cocoa_lsst_y1.git --branch v4.0-beta5 lsst_y1
cocoa_
prefix when cloning the repository.
${CONDA_PREFIX}/bin/git clone [email protected]:CosmoLike/cocoa_lsst_y1.git lsst_y1
Step 2️⃣: go back to the Cocoa main folder and activate the private Python environment
cd ../
source start_cocoa.sh
start_cocoa.sh
shell script only after cloning the project repository (or if you already in the (.local)
environment, run start_cocoa.sh
again).
Step 3️⃣: compile the project
source ./projects/lsst_y1/scripts/compile_lsst_y1
compile_cocoa.sh
also compiles every Cosmolike project on the cocoa/Cocoa/projects/
folder.
Step 4️⃣: select the number of OpenMP cores (below, we set it to 4), and run a template YAML file
export OMP_PROC_BIND=close; export OMP_NUM_THREADS=8
One model evaluation:
mpirun -n 1 --oversubscribe --mca btl vader,tcp,self --bind-to core:overload-allowed --rank-by core --map-by numa:pe=${OMP_NUM_THREADS} cobaya-run ./projects/lsst_y1/EXAMPLE_EVALUATE1.yaml -f
MCMC:
mpirun -n 4 --oversubscribe --mca btl vader,tcp,self --bind-to core:overload-allowed --rank-by core --map-by numa:pe=${OMP_NUM_THREADS} cobaya-run ./projects/lsst_y1/EXAMPLE_MCMC1.yaml -f
Do not delete the lsst_y1
folder from the project folder without first running the shell script stop_cocoa.sh
. Otherwise, Cocoa will have ill-defined soft links.
Cocoa/cobaya/cobaya/likelihoods/
Cocoa/external_modules/code/
Cocoa/external_modules/data/
start_cocoa.sh
creates symbolic links so Cobaya can see the likelihood and data files. Cocoa also adds the Cobaya-Cosmolike interface of all cosmolike-related projects to the LD_LIBRARY_PATH
and PYTHONPATH
environmental variables.
We are strict in our convergence criteria on EXAMPLE_MCMC[0-9].YAML
MCMC examples.
Rminus1_stop: 0.005
# Gelman-Rubin R-1 on std deviations
Rminus1_cl_stop: 0.15
These settings are overkill for most applications, except when computing some tension and goodness of fit metrics. Please adjust these settings to your needs.