Page 1 of 1

Using a multi-cpu likelihood function with CosmoMC

Posted: June 20 2009
by Mark Wilkinson
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.

Re: Using a multi-cpu likelihood function with CosmoMC

Posted: June 23 2009
by Antony Lewis
I guess you can compile CosmoMC for one processor (without -DMPI) , calling your likelihood which does use MPI, but I've not tried it.