Checkpoints

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Vinicius Miranda
Posts: 9
Joined: August 20 2014
Affiliation: Upenn
Contact:

Checkpoints

Post by Vinicius Miranda » August 20 2014

Dear All,

I opened this topic because I am currently facing some issues in CosmoMC that seems to be related with checkpoints.

I have a modified version of CosmoMC (July 2014) that contains 20 extra semi-slow (inflation) parameters. Here is a list of the main changes I applied in order to add semi-slow parameters.

- Copy of the extra parameters to CAMB
(1) Calculator_Camb.f90, subroutine CAMBCalc_SetCAMBInitPower

- Increase of space to allocate the extra parameters
(2) CosmologyParametrizations.f90, subroutine TP_Init, line
call this%SetTheoryParameterNumbers(15, last_power_index+20)

(3) CosmologyTypes.f90, line
integer, parameter :: max_inipower_params = 30

(4) Settings.f90, line
integer, parameter :: max_theory_params = 50

Finally, I added a list of 20 names after "Aphiphi" and before "H0*" on params_CMB.paramnames. I also setup their initial values and ranges on params_CMB_defaults.ini file.

In addition to the extra semi-slow parameters, I added one likelihood similar to the H0 likelihood.

Everything seems to work fine until I restart CosmoMC using checkpoints. Here is a list of the main changes I observed after a checkpoint restart.

(1) some MPI processes stop writing lines like this on the output

Chain:0 drag accpt: 0.5986696 fast/slow 54.01863 slow: 859

Immediately before the checkpoint all MPI processes were writing lines like this one.

(2) Some MPI processes spend many hours changing cosmology parameters together with inflationary parameters at every single step. Immediately before the checkpoint this was not true. Even after many hours (after a checkpoint restart) I still see lines like this

slow changes 46664 power changes 0

on the output/log. According to the source code, "power changes" variable keep track of acceptable steps that change inflation variables at fixed slow cosmological parameter. Again, this behavior was not seen before a checkpoint restart.

(3) Before a checkpoint restart, the .chk and .txt files of all MPI processes were periodic updated by the program. After a checkpoint, however, this changed. In some MPI processes, I couldn't observe a single update in .chk and .txt (chain) files for more than a day after a checkpoint restart.

(4) R-1 decrease rate slow down a lot if you compare the evolution of R-1 between a chain without checkpoint and a chain with same parameters where I forced a checkpoint.

This doesn't seem to be a good behavior. I appreciate some insight on this possible problem.

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Checkpoints

Post by Antony Lewis » August 21 2014

Do standard chains restart for you? (i.e. is this a general checkpointing bug, or is it an issue with your code modifications?)

Vinicius Miranda
Posts: 9
Joined: August 20 2014
Affiliation: Upenn
Contact:

Checkpoints

Post by Vinicius Miranda » August 21 2014

Dear

I believe I better understand the problem. It is also related to my new likelihood.

There is a derived variable [tex]I_1[/tex] thad only depends on the extra semi-slow parameters I introduced + [tex]n_s[/tex] (slow roll tilt). For physical reasons, it is important that [tex]I_1 \sqrt{2} <1[/tex]. So I introduced a likelihood penalty such that

Penalty ([tex]\chi^2[/tex]) ~ 0 if I_1 \sqrt{2} <1
Penalty ([tex]\chi^2[/tex]) ~ 30 if I_1 \sqrt{2} > 1

Here is the link to my new likelihood (it is a short simple code)

http://tardis.viniciusmiranda.com:7990/ ... wse/I1.f90

To code the likelihood, I followed the example given in HST.f90 very closely. However, while H0 likelihood only depends on background parameters, my penalty also depends on primordial power spectrum parameters.

To problem is that all points in the parameter space have [tex]I_1 \sqrt{2} > 1[/tex] immediately after a checkpoint and this was not true before the checkpoint. Then, the chain in some MPI processes spend hours/days rejecting all the points after a checkpoint because of the large penalty, without being able to find the volume in parameter space where [tex]I_1 \sqrt{2} < 1[/tex]. Again, without checkpoints everything looked fine. When I turned the penalty off, the problem disappeared.

So my question is: is HST.f90 the best example to introduce a new likelihood that depends on primordial power spectrum parameters? My likelihood is actually calculated by replacing the procedure

procedure :: LogLikeTheory => I1_LnLike

Is this the correct procedure to override?

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Checkpoints

Post by Antony Lewis » August 22 2014

The best place to put new hard priors on derived parameters is in NonBaseParameterPriors (see CosmologyParameterizations.f90) - like the one on H0.

Note sure why your points are moving after the checkpoint though, that may indicate of some more general problem if standard chains work OK. You can of course also just run for longer without stopping and re-starting with checkpointing if your cluster allows it.

Post Reply