fast(er) execution of CAMB

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Dragan Huterer
Posts: 27
Joined: July 18 2005
Affiliation: University of Michigan
Contact:

fast(er) execution of CAMB

Post by Dragan Huterer » November 01 2013

Is there a simple way - presumably with some options in params.ini - to get CAMB to execute faster than usual? As in, much faster than 1 second per model.

I am interested in a bare-bones case where I just need P(k, z), including the halofit nonlinear prescription. In particular, no CMB angular power spectrum. The current runtime of about 1 second per model is slow for our application - we are running CAMB in our own MCMC code (that is not COSMOMC etc). I tried some tweaks to the params file, but didn't get a significant speed-up.

Some key lines from our current params.ini are below. Thanks!

Code: Select all

get_scalar_cls = F
get_vector_cls = F
get_tensor_cls = F
want_CMB = F
get_transfer = T
do_lensing = F
do_nonlinear = 1
l_max_scalar = 2000
k_eta_max_scalar = 4000
l_max_tensor = 1500
k_eta_max_tensor = 3000
massive_neutrinos = 0
reionization = T
re_use_optical_depth = F
transfer_high_precision = F
transfer_kmax           = 100.0
transfer_k_per_logint   = 5
transfer_num_redshifts  = 2
recombination = 1
number_of_threads = 0
accuracy_boost = 1
l_accuracy_boost = 1
l_sample_boost = 1

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

Re: fast(er) execution of CAMB

Post by Antony Lewis » November 01 2013

You can try

Code: Select all

transfer_k_per_logint   =0
(auto-spacing), or decreasing the value, but going to very high k will always be a bit slow. 1s per model is usually fine for MCMC with moderate numbers of slow parameters.

Dragan Huterer
Posts: 27
Joined: July 18 2005
Affiliation: University of Michigan
Contact:

fast(er) execution of CAMB

Post by Dragan Huterer » November 01 2013

Thanks. Setting transfer_k_per_logint to zero didn't speed things up - actually it slowed down the code. But instead I figured that I can use kmax=20 (that is, transfer_kmax = 20.0), and then linearly extrapolate (with constant slope in logP/logk) out to higher k which appears reasonably accurate. That led to a modest speedup of 30%, so to about 0.7 sec/model.

Post Reply