Cobaya/Camb-1.0.7 : issue running more than one newly defined parameter

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Rance Solomon
Posts: 10
Joined: April 21 2020
Affiliation: University at Buffalo

Cobaya/Camb-1.0.7 : issue running more than one newly defined parameter

Post by Rance Solomon » May 02 2020

I am running Cobaya in conjunction with CAMB (1.0.7) to run likelihood plots on a dynamic dark energy model. I have three new parameters (mu, M, lambda) which are accessible to both CAMB and Cobaya. The issue is that no more than one of the new parameters can be set as a sampled parameter in the .yaml file at a time. At least two of the parameters has to be derived for Cobaya to run.

I defined the three new parameters in the CAMBparams type of CAMB's model.f90 file as

Code: Select all

        real(dl) :: mu = 1.
        real(dl) :: M = 1.
        real(dl) :: lmd = 1.
and in the _fields_ list of the model.py file as

Code: Select all

        ("mu", c_double),
        ("M", c_double),
        ("lmd", c_double)
The parameters were added in the same location in both the type and the _fields_ lists.

With one sampled, the parameters are added to the .yaml file as

Code: Select all

  mu:
    prior:
      min: 0.01
      max: 100
    ref:
      dist: norm
      loc: 1.0
      scale: 10
    proposal: 0.01
    latex: /mu
  M:
    min: 0.01
    max: 100
    latex: M
  lmd:
    min: 0.01
    max: 100
    latex: \lambda
Running

Code: Select all

 mpirun -n 1 cobaya-run -f dry_run.yaml 
the run is able to finish but getdist-gui is unable to plot the two derived parameters. The mu parameter plots fine with getdist-gui, but plotting one of the derived parameters returns the error

Code: Select all

Traceback (most recent call last):
  File "/home/garvita/.local/lib/python3.6/site-packages/getdist/gui/mainwindow.py", line 1686, in plotData
    self.errorReport(e, caption=actionText)
  File "/home/garvita/.local/lib/python3.6/site-packages/getdist/gui/mainwindow.py", line 1645, in plotData
    self.plotter.plots_2d(roots, param_pairs=pairs, filled=filled, shaded=shaded)
  File "/home/garvita/.local/lib/python3.6/site-packages/getdist/plots.py", line 2132, in plots_2d
    add_legend_proxy=i == 0, ax=ax, _no_finish=True, **kwargs)
  File "/home/garvita/.local/lib/python3.6/site-packages/getdist/plots.py", line 1654, in plot_2d
    **contour_args[i])
  File "/home/garvita/.local/lib/python3.6/site-packages/getdist/plots.py", line 1037, in add_2d_contours
    likes=self.settings.shade_meanlikes)
  File "/home/garvita/.local/lib/python3.6/site-packages/getdist/plots.py", line 596, in get_density_grid
    density = samples.get2DDensityGridData(param1.name, param2.name, num_plot_contours=conts, meanlikes=likes)
  File "/home/garvita/.local/lib/python3.6/site-packages/getdist/mcsamples.py", line 1679, in get2DDensityGridData
    histbins, flatix = self._make2Dhist(ixs, iys, xsize, ysize)
  File "/home/garvita/.local/lib/python3.6/site-packages/getdist/mcsamples.py", line 1594, in _make2Dhist
    minlength=xsize * ysize).reshape((ysize, xsize)), flatix
ValueError: cannot reshape array of size 148914 into shape (384,384)
It does not seem to depend on which parameter is defined to be sampled as long as only one is.

If I instead run two or three of the new parameters as sampled then

Code: Select all

 cobaya-run 
returns

Code: Select all

[output] Output to be read-from/written-into folder '.', with prefix 'dry_run'
[output] Found existing products with the requested ouput prefix: 'dry_run'
[output] Deleting previous chain ('force' was requested).
[prior] *WARNING* External prior 'SZ' loaded. Mind that it might not be normalized!
[camb] Importing *local* CAMB from /home/garvita/Rance/Research/CAMB-1.0.7
[planck_2018_lowl.TT] Importing clik from /home/garvita/Rance/Research/Cobaya/code/planck
----
clik version 3be036bbb4f9
  gibbs_gauss b13c8fda-1837-41b5-ae2d-78d6b723fcf1
Checking likelihood '/home/garvita/Rance/Research/Cobaya/data/planck_2018/baseline/plc_3.0/low_l/commander/commander_dx12_v3_2_29.clik' on test data. got -11.6257 expected -11.6257 (diff -1.07424e-09)
----
Initializing SimAll
----
clik version 3be036bbb4f9
  simall simall_EE_BB_TE
Checking likelihood '/home/garvita/Rance/Research/Cobaya/data/planck_2018/baseline/plc_3.0/low_l/simall/simall_100x143_offlike5_EE_Aplanck_B.clik' on test data. got -197.99 expected -197.99 (diff -4.1778e-08)
----
----
clik version 3be036bbb4f9
  smica
Checking likelihood '/home/garvita/Rance/Research/Cobaya/data/planck_2018/baseline/plc_3.0/hi_l/plik/plik_rd12_HM_v22b_TTTEEE.clik' on test data. got -1172.47 expected -1172.47 (diff -4.34056e-07)
----
Checking lensing likelihood '/home/garvita/Rance/Research/Cobaya/data/planck_2018/baseline/plc_3.0/lensing/smicadx12_Dec5_ftl_mv2_ndclpp_p_teb_consext8.clik_lensing' on test data. got -4.42102
[likelihood] The theory code will compute the following products, requested by the likelihoods: ['H0', 'omegam', 'omega_de', 'YHe', 'Y_p', 'zre', 'sigma8', 'age', 'rdrag', 'DH', 'Cl']
[mcmc] *WARNING* Number of dragging steps clipped from below: was not enough to efficiently explore the fast directions -- avoid this limit by decreasing 'drag_limits[0]'.
[mcmc] Dragging with oversampling per step:
   1 : ['logA', 'ns', 'theta_MC_100', 'ombh2', 'omch2', 'mu', 'M', 'lmd', 'tau']
   21 : ['A_planck', 'calib_100T', 'calib_217T', 'A_cib_217', 'xi_sz_cib', 'A_sz', 'ksz_norm', 'gal545_A_100', 'gal545_A_143', 'gal545_A_143_217', 'gal545_A_217', 'ps_A_100_100', 'ps_A_143_143', 'ps_A_143_217', 'ps_A_217_217', 'galf_TE_A_100', 'galf_TE_A_100_143', 'galf_TE_A_100_217', 'galf_TE_A_143', 'galf_TE_A_143_217', 'galf_TE_A_217']
[mcmc] Covariance matrix selected automatically: {modules}/data/planck_supp_data_and_covmats/covmats/base_plikHM_TTTEEE_lowl_lowE_lensing_post_Riess18.covmat
[mcmc] Covariance matrix loaded for params ['ombh2', 'omch2', 'theta_MC_100', 'tau', 'logA', 'ns', 'A_planck', 'A_cib_217', 'xi_sz_cib', 'A_sz', 'ps_A_100_100', 'ps_A_143_143', 'ps_A_143_217', 'ps_A_217_217', 'ksz_norm', 'gal545_A_100', 'gal545_A_143', 'gal545_A_143_217', 'gal545_A_217', 'galf_TE_A_100', 'galf_TE_A_100_143', 'galf_TE_A_100_217', 'galf_TE_A_143', 'galf_TE_A_143_217', 'galf_TE_A_217', 'calib_100T', 'calib_217T']
[mcmc] Missing proposal covariance for params ['mu', 'M', 'lmd']
[mcmc] Covariance matrix not complete. We will start learning the covariance of the proposal earlier: R-1 = 30 (was 2).
[mcmc] Initial point:
free(): invalid next size (normal)
[gr:16075] *** Process received signal ***
[gr:16075] Signal: Aborted (6)
[gr:16075] Signal code:  (-6)
[gr:16075] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7f66401e1f20]
[gr:16075] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f66401e1e97]
[gr:16075] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f66401e3801]
[gr:16075] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x89897)[0x7f664022c897]
[gr:16075] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x9090a)[0x7f664023390a]
[gr:16075] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x75d)[0x7f664023b0ad]
[gr:16075] [ 6] /home/garvita/Rance/Research/CAMB-1.0.7/camb/camblib.so(__handles_MOD_f2003class_free+0x46)[0x7f660daee7d6]
[gr:16075] [ 7] /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c)[0x7f6633ca6dae]
[gr:16075] [ 8] /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x22f)[0x7f6633ca671f]
[gr:16075] [ 9] /usr/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(_ctypes_callproc+0x2b4)[0x7f6633eba5c4]
[gr:16075] [10] /usr/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(+0x11c33)[0x7f6633ebac33]
[gr:16075] [11] /usr/bin/python3(_PyObject_FastCallKeywords+0x19c)[0x5a9cbc]
[gr:16075] [12] /usr/bin/python3[0x50a5c3]
[gr:16075] [13] /usr/bin/python3(_PyEval_EvalFrameDefault+0x444)[0x50bfb4]
[gr:16075] [14] /usr/bin/python3(_PyFunction_FastCallDict+0xf5)[0x508e55]
[gr:16075] [15] /usr/bin/python3[0x594931]
[gr:16075] [16] /usr/bin/python3(_PyObject_FastCallDict+0x17c)[0x5a47fc]
[gr:16075] [17] /usr/bin/python3[0x619c31]
[gr:16075] [18] /usr/bin/python3(PyObject_CallFinalizerFromDealloc+0x45)[0x55bf95]
[gr:16075] [19] /usr/bin/python3[0x54f167]
[gr:16075] [20] /usr/bin/python3[0x572890]
[gr:16075] [21] /usr/bin/python3[0x572890]
[gr:16075] [22] /usr/bin/python3[0x4b17e8]
[gr:16075] [23] /usr/bin/python3[0x5080c7]
[gr:16075] [24] /usr/bin/python3(_PyFunction_FastCallDict+0x2e2)[0x509042]
[gr:16075] [25] /usr/bin/python3[0x594931]
[gr:16075] [26] /usr/bin/python3(PyObject_Call+0x3e)[0x59fc4e]
[gr:16075] [27] /usr/bin/python3(_PyEval_EvalFrameDefault+0x17e6)[0x50d356]
[gr:16075] [28] /usr/bin/python3[0x507d64]
[gr:16075] [29] /usr/bin/python3[0x509a90]
[gr:16075] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 0 on node gr exited on signal 6 (Aborted).
--------------------------------------------------------------------------
I have been working on this issue for quite some time now. Any help would be appreciated.

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

Re: Cobaya/Camb-1.0.7 : issue running more than one newly defined parameter

Post by Antony Lewis » May 03 2020

Please try withe Cobaya devel branch

Rance Solomon
Posts: 10
Joined: April 21 2020
Affiliation: University at Buffalo

Re: Cobaya/Camb-1.0.7 : issue running more than one newly defined parameter

Post by Rance Solomon » May 03 2020

Yes, it seems I had originally installed the non-editable version of CAMB. I installed the devel version of CAMB yesterday and so far it seems to be working. If problems persist I will look into the Cobaya devel branch. Thank you for your time.

Post Reply