log Zero error in CosmoMC with very small but non-zero neutrino masses

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Shouvik Roychoudhury
Posts: 31
Joined: August 14 2016
Affiliation: IIT Bombay

log Zero error in CosmoMC with very small but non-zero neutrino masses

Post by Shouvik Roychoudhury » August 27 2020

Hi Antony,

I am getting a log Zero error with action = 4 (with the latest CosmoMC version downloaded from github) whenever the mass of an individual neutrino eigenstate falls in the range of 0.00053 eV down to 0.0000094 eV. Masses below 0.0000094 eV seem to produce a proper likelihood equal to the massless case.

Code: Select all

Test likelihoods done, parameter point rejected (logZero or outside prior)
This basically means that for MCMC runs the above range is excluded from the runs. Since the masses are very small, I don't think they cause any conceivable error in the analysis but still it would be good if this bug is fixed. It seems that last year you had already updated CosmoMC with a fix: https://github.com/cmbant/CAMB/commit/65b3f21dad9579266552f5568beb5ce6590502ac.

But somehow this fix is not working for the range I mentioned. Please check if you can reproduce the logZero error.

Regards,
Shouvik

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

Re: log Zero error in CosmoMC with very small but non-zero neutrino masses

Post by Antony Lewis » August 28 2020

Do you get the "find_nu_mass_for_rho failed to find neutrino mass" error?

Shouvik Roychoudhury
Posts: 31
Joined: August 14 2016
Affiliation: IIT Bombay

Re: log Zero error in CosmoMC with very small but non-zero neutrino masses

Post by Shouvik Roychoudhury » August 28 2020

No. If I use the cosmomc_debug option this is what I get as error:

Code: Select all

Caught signal 8 (Floating point exception: floating-point divide by zero)
==== backtrace ====
    0  /opt/ucx-1.7.0/lib/libucs.so.0(+0x21a44) [0x7fa9d16d8a44]
    1  /opt/ucx-1.7.0/lib/libucs.so.0(+0x21dc3) [0x7fa9d16d8dc3]
    2  ./cosmomc_debug() [0xa781f1]
    3  ./cosmomc_debug() [0xa7c2a2]
    4  ./cosmomc_debug() [0xa5c8b5]
    5  ./cosmomc_debug() [0xb087b9]
    6  ./cosmomc_debug() [0x5b38fd]
    7  ./cosmomc_debug() [0x5a67b7]
    8  ./cosmomc_debug() [0x82a603]
    9  ./cosmomc_debug() [0x82260c]
   10  ./cosmomc_debug() [0x56cd31]
   11  ./cosmomc_debug() [0x846da6]
   12  ./cosmomc_debug() [0x416632]
   13  /lib64/libc.so.6(__libc_start_main+0xf5) [0x7fa9e3648b15]
   14  ./cosmomc_debug() [0x416529]
===================
forrtl: error (75): floating point exception
Image              PC                Routine            Line        Source
cosmomc_debug      0000000000CF7ACB  Unknown               Unknown  Unknown
libpthread-2.17.s  00007FA9E3BFC100  Unknown               Unknown  Unknown
cosmomc_debug      0000000000A781F1  cambmain_mp_getta         703  cmbmain.f90
cosmomc_debug      0000000000A7C2A2  cambmain_mp_initv         806  cmbmain.f90
cosmomc_debug      0000000000A5C8B5  cambmain_mp_cmbma         147  cmbmain.f90
cosmomc_debug      0000000000B087B9  camb_mp_camb_getr         109  camb.f90
cosmomc_debug      00000000005B38FD  calculator_camb_m         219  Calculator_CAMB.f90
cosmomc_debug      00000000005A67B7  calclike_cosmolog          88  CalcLike_Cosmology.f90
cosmomc_debug      000000000082A603  calclike_mp_theor         308  calclike.f90
cosmomc_debug      000000000082260C  calclike_mp_getlo         146  calclike.f90
cosmomc_debug      000000000056CD31  generalsetup_mp_t         161  GeneralSetup.f90
cosmomc_debug      0000000000846DA6  MAIN__                    281  driver.F90
cosmomc_debug      0000000000416632  Unknown               Unknown  Unknown
libc-2.17.so       00007FA9E3648B15  __libc_start_main     Unknown  Unknown
cosmomc_debug      0000000000416529  Unknown               Unknown  Unknown
Aborted
If I do not use the debug mode:

Code: Select all

WARNING: NaN CL?           1           1
        Time for theory:    0.89387
    loglike     chi-sq
      0.000      0.000   CMB: BKPLANCK = BK15_dust
      0.000      0.000   CMB: lensing = smicadx12_Dec5_ftl_mv2_ndclpp_p_teb_consext8
      0.000      0.000   CMB: plik = plik_rd12_HM_v22b_TTTEEE
      0.000      0.000   CMB: lowl = commander_dx12_v3_2_29
      0.000      0.000   CMB: simall = simall_100x143_offlike5_EE_Aplanck_B
      0.000      0.000   SN: JLA Pantheon18
      0.000      0.000   BAO: 6DF
      0.000      0.000   BAO: MGS
      0.000      0.000   BAO: DR12BAO
      0.000      0.000   WL: DES = DES_1YR_final
 Test likelihoods done, parameter point rejected (logZero or outside prior)
I have tried three different compilers. Same result for the same mass range I mentioned before. Maybe a correction/approximation involved in the low mass range which is causing some quantity (nu energy density?) to become zero?

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

Re: log Zero error in CosmoMC with very small but non-zero neutrino masses

Post by Antony Lewis » August 31 2020

Yes. There are various possible fixes, e.g. try changing line 702 of cmbmain.f90 to also check that

Code: Select all

maxval(State%nu_masses(1:CP%Nu_mass_eigenstates)) >0
?

Sunny Vagnozzi
Posts: 53
Joined: August 15 2016
Affiliation: Kavli Institute for Cosmology (KICC), University of Cambridge

Re: log Zero error in CosmoMC with very small but non-zero neutrino masses

Post by Sunny Vagnozzi » September 08 2020

I encountered this problem too and just brute-forced went around it by setting the prior on mnu appropriately, e.g. param[mnu] = 0.3 X 1.0 0.01 0.01, where X is something small but non-zero...less than ideal I know!!

Post Reply