Using a multi-cpu likelihood function with CosmoMC

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Mark Wilkinson
Posts: 1
Joined: June 20 2009
Affiliation: University of Leicester

Using a multi-cpu likelihood function with CosmoMC

Post by Mark Wilkinson » June 20 2009

I have a likelihood function which requires multiple cpus to achieve sufficient speed. It's trivially parallel, in the sense that the calculation is split into pieces which do not need to talk to each other. Currently I do an MCMC search using a script which uses mpirun to produce multiple copies of my code running on separate cpus and combines the results once they're finished.

I have been looking into using CosmoMC for controlling the MCMC part of my problem, but do not have experience of plugging functions into parallel codes. My (perhaps incorrect) understanding is that CosmoMC uses different MPI child processes for different chains, whereas I would like to run a single chain but with multiple child processes each of which would run an indepedent copy of my function.

Has anyone else done something similar to this? Any advice or examples would be much appreciated.

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

Re: Using a multi-cpu likelihood function with CosmoMC

Post by Antony Lewis » June 23 2009

I guess you can compile CosmoMC for one processor (without -DMPI) , calling your likelihood which does use MPI, but I've not tried it.

Post Reply