brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
93 stars 80 forks source link

Problem (segmentation fault) with different fiducial for Plank fake likelihood #316

Closed mtagliazucchi closed 10 months ago

mtagliazucchi commented 1 year ago

Hi, I have a problem with fake Planck bluebook likelihood.

I want to use it but with a fiducial that reproduces Planck 2018 constraints on the 6 cosmological parameters.

To do that I deleted the fake_planck_bluebook_fiducial.dat file in data/, I written a parameter file fiducial.param with the following lines

data.experiments=['fake_planck_bluebook']

data.parameters['omega_b']      = [  2.2377,   None, None,      0.015, 0.01, 'cosmo']
data.parameters['omega_cdm']    = [ 0.12010,   None, None,     0.0013,    1, 'cosmo']
data.parameters['100*theta_s']  = [ 1.04110,   None, None,    0.00030,    1, 'cosmo']
data.parameters['ln10^{10}A_s'] = [  3.0447,   None, None,      0.015,    1, 'cosmo']
data.parameters['n_s']          = [  0.9659,   None, None,     0.0042,    1, 'cosmo']
data.parameters['tau_reio']     = [  0.0543,  0.004, None,      0.008,    1, 'cosmo']

#data.parameters['A_SZ']         = [0.96,    0, 2,   1, 1,  'nuisance']
data.parameters['P_shot']       = [0.0,       -1, -1, 0,1,  'nuisance']

and then I run python montepython/MontePython.py -p input/fiducial.param -c chains/test_fiducial -f 0. Let me comment the last two lines of the params file:

  1. #data.parameters['A_SZ'] = [0.96, 0, 2, 1, 1, 'nuisance']: I originally put this line because in the original fake_planck_bluebook_fiducial.dat file there was in the first line the parameter A_SZ = 0.96. However, if I uncomment this line I get an error as this parameter is not recognized as a parameter of the likelihood.

  2. data.parameters['P_shot'] = [0.0, -1, -1, 0,1, 'nuisance']: as before I add this line since in the in the originalfake_planck_bluebook_fiducial.datfile there was in the first line the parameterP_shot = 0`.

The generation of the new fiducial works fine. However, I then try to generate 8 MCMC chains by using the command

mpirun -np 4 python montepython/MontePython.py run -p input/example_new.param -o chains/baseline_test --conf default.conf -N 10000000 --update 50 --superupdate 20

where the file example_new.param contains the lines:

# Cosmological parameters list
data.parameters['omega_b']      = [2.249,  -1,-1, 0.016, 0.01,'cosmo']
data.parameters['omega_cdm']    = [0.1120, -1,-1, 0.0016,1,   'cosmo']
data.parameters['n_s']          = [0.963,  -1,-1, 0.004, 1,   'cosmo']
data.parameters['A_s']          = [2.42,   -1,-1, 0.038, 1e-9,'cosmo']
data.parameters['h']            = [0.703,  -1,-1, 0.0065,1,   'cosmo']
data.parameters['tau_reio']     = [0.085,  -1,-1, 0.0044,1,   'cosmo']

# Nuisance parameter list, same call, except the name does not have to be a class name
# For wmap:
#data.parameters['A_SZ']         = [1,    0, 2,   1, 1,  'nuisance']
# For SPT
#data.parameters['SPT_SZ']       = [5.6,  0,-1, 2.5, 1,  'nuisance']
#data.parameters['SPT_PS']       = [20.4,-1,-1, 2.7, 1, 'nuisance']
#data.parameters['SPT_CL']       = [5.3, -1,-1, 2.3, 1, 'nuisance']

# Derived parameter list
data.parameters['z_reio']       = [0,       -1, -1, 0,1,  'derived']
data.parameters['Omega_Lambda'] = [0,       -1, -1, 0,1,  'derived']

After few points (\approx 50 per chains) I get a segmentation fault error:

[node01:21032] *** Process received signal ***
[node01:21032] Signal: Segmentation fault (11)
[node01:21032] Signal code:  (128)
[node01:21032] Failing at address: (nil)

There are no problems when using the original fiducial and input files. Can someone help me?

dchooper commented 11 months ago

Hi,

Sorry for the very late answer here! I'm replying in case it is still relevant. I'm surprised you had to add the P_shot parameter at all, as that doesn't appear in the likelihood data files. There is a default input file for running the fake_planck_bluebook likelihood: it's the default example.param. That should run through without any problems.

If you want to reproduce the Planck 2018 values in a simplified likelihood, we also have the fake_planck_realistic (as described in 1808.05955), which also shouldn't have any nuisance parameters and shouldn't trigger any segfaults. I think your issue might be caused by creating a fiducial file with a nuisance parameter that the likelihood doesn't expect, leading to a wrong fiducial file.

Note that we mainly use the fake likelihoods for doing forecasts. For a simplified Planck likelihood, we would recommend using Planck_lite instead (which then uses actual data instead of just a fiducial file).

Cheers, Deanna