Problems with calculating the primordial bispectrum using CAMB

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Adam Becker
Posts: 3
Joined: June 30 2009
Affiliation: University of Michigan

Problems with calculating the primordial bispectrum using CA

Post by Adam Becker » May 04 2011

Hi all,

I'm having a couple of issues with calculating the primordial bispectrum using CAMB, and I'd be really grateful if someone could point me in the right direction here.

To calculate the primordial bispectrum, I started by modifying the default params.ini on the following two lines:

do_primordial_bispectrum = T
...
bispectrum_full_output_file= bispectrum

But CAMB failed to run at all with this params.ini file -- it gave me the message "key not found : bispectrum_full_output_sparse". Adding the following line into params.ini solved the problem:

bispectrum_full_output_sparse = T

While this issue wasn't too difficult to resolve, it'd be nice if this key were in the default params.ini file with a better explanation of what it does. Furthermore, using a params.ini file with these three changes causes CAMB to fail in a different way, at least when CAMB is compiled with gfortran. (I haven't tried any other compilers.) After working for a few minutes, CAMB comes back with:

*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Operating system error: Cannot allocate memory
Out of memory

This happened on two different machines: one with 2 GB of RAM and one with 16 GB of RAM. I can't imagine that CAMB actually needs that much RAM to run. This is especially puzzling to me because I don't encounter this problem when I only want the temperature bispectrum (which I can get by setting bispectrum_nfields = 1 in params.ini). For whatever reason, adding in the polarization bispectrum seems to require a fabulously huge amount of RAM, even though the calculations involved are almost identical to the calculations needed for the temperature bispectrum. Is this a memory leak? Is there an easy fix? Any light that anyone can shed on this would be really helpful. Thanks.

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

Re: Problems with calculating the primordial bispectrum usin

Post by Antony Lewis » May 04 2011

I'll add bispectrum_full_output_sparse to the default params.ini. As you note this output option is not well tested (files get large so usually best to keep things in code).

I can't remember how much RAM exactly it uses, but depending on the Lmax you are using storing the bispectrum does require quite a lot - and 8x more for polarization than just temperature. I'd have thought 16GB should be fine though (at least compiled in 64 bit).

Post Reply