CAMB seg faults with set_w_a_table

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Adam Ormondroyd
Posts: 9
Joined: August 17 2022
Affiliation: Cavendish Astrophysics, University of Cambridge
Contact:

CAMB seg faults with set_w_a_table

Post by Adam Ormondroyd »

Hi,

I'm using CAMB with a modified version of Cobaya which adds an interface to `set_w_a_table` to allow for more general dark energy models. This seems to work fine for some datasets (such as the new DESI), but when I use a cmb primary (here planck_npipe_highl_camspec.ttteee) I run into segmentation faults:

Code: Select all

[cpu-q-259:34124:0:34124] Caught signal 11 (Segmentation fault: address not mapped to object at address 0xfffffffc03fc9c00)
==== backtrace (tid:  34124) ====
 0 0x0000000000012cf0 __funlockfile()  :0
 1 0x00000000001e7ed7 nonlinear_mp_find_()  ???:0
 2 0x00000000000fa1aa nonlinear_mp_find_pk_()  ???:0
 3 0x00000000001dadac nonlinear_mp_p_lin_()  ???:0
 4 0x00000000001e1bcb nonlinear_mp_sigma_integrand_()  ???:0
 5 0x00000000001dbcfe nonlinear_mp_sigma_integral_()  ???:0
 6 0x00000000001db86c nonlinear_mp_neff_()  ???:0
 7 0x00000000001f30d2 nonlinear_mp_halomod_init_()  ???:0
 8 0x00000000000f8d32 nonlinear_mp_hmcode_()  ???:0
 9 0x00000000000f64b1 nonlinear_mp_thalofit_getnonlinratios_()  ???:0
10 0x0000000000168786 cambmain_mp_makenonlinearsources_()  ???:0
11 0x0000000000163c4d cambmain_mp_timesourcestocl_()  ???:0
12 0x00000000001e99d4 camb_mp_camb_transferstopowers_()  ???:0
13 0x000000000000617e ffi_call_unix64()  ???:0
14 0x0000000000005b2f ffi_call()  ???:0
15 0x00000000000145d6 ???()  /usr/lib64/python3.11/lib-dynload/_ctypes.cpython-311-x86_64-linux-gnu.so:0
16 0x0000000000014ae5 ???()  /usr/lib64/python3.11/lib-dynload/_ctypes.cpython-311-x86_64-linux-gnu.so:0
17 0x000000000023e8c9 _PyObject_MakeTpCall()  ???:0
18 0x00000000001eaa67 _PyEval_EvalFrameDefault()  ???:0
19 0x00000000001f736c _PyEval_EvalFrameDefault()  ???:0
20 0x00000000002c9d73 _PyAST_Compile()  ???:0
21 0x0000000000208445 _PyObject_Call()  ???:0
22 0x00000000001eec60 _PyEval_EvalFrameDefault()  ???:0
23 0x000000000027218d _PyFunction_Vectorcall()  ???:0
24 0x000000000024440c Py_ReprLeave()  ???:0
25 0x000000000024475f PyObject_CallFunctionObjArgs()  ???:0
26 0x0000000000002b4f loglikelihood()  /home/ano23/PolyChordLite/pypolychord/_pypolychord.cpp:43
27 0x00000000000ac77a interfaces_modulepolychord_c_interface_mp_loglikelihood_()  ipo_out.f:0
28 0x0000000000055170 calculate_module_mp_calculate_point_()  ???:0
29 0x0000000000054642 chordal_module_mp_slice_sample_()  ???:0
30 0x0000000000052b13 chordal_module_mp_slicesampling_()  ???:0
31 0x000000000003382b nested_sampling_module_mp_nestedsampling_()  ???:0
32 0x0000000000031e50 interfaces_module_mp_run_polychord_full_()  ???:0
33 0x00000000000ab0da polychord_c_interface()  ???:0
34 0x00000000000aa0eb run_polychord()  ???:0
35 0x00000000000ad632 run_polychord()  ???:0
36 0x0000000000003dfd _INTERNALbc13af1a::run_pypolychord()  /home/ano23/PolyChordLite/pypolychord/_pypolychord.cpp:248
37 0x0000000000243d17 Py_ReprLeave()  ???:0
38 0x000000000020859e _PyObject_Call()  ???:0
39 0x00000000001f3904 _PyEval_EvalFrameDefault()  ???:0
40 0x000000000027266d _PyFunction_Vectorcall()  ???:0
41 0x0000000000208445 _PyObject_Call()  ???:0
42 0x00000000001eec60 _PyEval_EvalFrameDefault()  ???:0
43 0x00000000002ce2a9 PyEval_EvalCode()  ???:0
44 0x000000000035a55d _PyInterpreterState_SetConfig()  ???:0
45 0x000000000035a5fa _PyInterpreterState_SetConfig()  ???:0
46 0x000000000035a6d0 _PyInterpreterState_SetConfig()  ???:0
47 0x000000000035a9a2 _PyRun_SimpleFileObject()  ???:0
48 0x000000000035aa84 _PyRun_AnyFileObject()  ???:0
49 0x000000000035ad8e Py_RunMain()  ???:0
50 0x000000000035ba49 Py_BytesMain()  ???:0
51 0x000000000003ad85 __libc_start_main()  ???:0
52 0x000000000040069e _start()  ???:0
=================================
Is there some CAMB setting that I might be able to tune to improve this? I've tried playing with AccuracyBoost to no avail. I also noticed that "halo" appears in the stack trace, so I also tried a couple of different halofit models.

I've also checked and the seg fault occurs when I record the last attempted sampling point and pass that to camb outside of cobaya.

Thanks for any suggestions!
Adam
Antony Lewis
Posts: 1980
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: CAMB seg faults with set_w_a_table

Post by Antony Lewis »

Halofit doesn't support general dark energy models.
It just uses some "effective" w0-wa numbers set from the table at z=0 that may or may not approximately match the full model. Those parameters are probably going out of range where HMCode works.
Adam Ormondroyd
Posts: 9
Joined: August 17 2022
Affiliation: Cavendish Astrophysics, University of Cambridge
Contact:

Re: CAMB seg faults with set_w_a_table

Post by Adam Ormondroyd »

Thanks Antony, do you know if there's an alternative which doesn't have this problem? I just tried leaving the line `halofit_version:` out of my yaml file (which presumably defaults to "mead"?) which seg faulted almost straight away.
Antony Lewis
Posts: 1980
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: CAMB seg faults with set_w_a_table

Post by Antony Lewis »

You can turn off non-linear corrections, which is probably fine if only using primary lensed CMB rather than lensing reconstruction (can check accuracy).
Adam Ormondroyd
Posts: 9
Joined: August 17 2022
Affiliation: Cavendish Astrophysics, University of Cambridge
Contact:

Re: CAMB seg faults with set_w_a_table

Post by Adam Ormondroyd »

Seems like that has helped, thanks!
Post Reply