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.
Using a multi-cpu likelihood function with CosmoMC
-
- Posts: 1
- Joined: June 20 2009
- Affiliation: University of Leicester
-
- Posts: 1945
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: Using a multi-cpu likelihood function with CosmoMC
I guess you can compile CosmoMC for one processor (without -DMPI) , calling your likelihood which does use MPI, but I've not tried it.