# Is it possible to run a Metropolis Monte Carlo simulation in parallel?

Is it possible to run a Metropolis Monte Carlo simulation in parallel?

Suppose I perform a Metropolis Monte Carlo simulation using four threads.

Suppose, the programming source code divides a specified number of iterations among four threads to compute parts of the simulation concurrently. Each thread generates random samples, accumulates a partial result, and writes its output to a file, ensuring thread-safe operations with locks.

Will this Monte Carlo simulation behave in the same way as a single-threaded Monte Carlo simulation?

Will the sequential and parallel monte carlo give us the same outcome?

• You have to describe the problem you are applying Monte Carlo to, and the specific meyhod you use. For integration if your samples are independent are identically distributed you can run separate simulations, provided each gets a different random sequence (i.e. they need differemt seeds). Things are more tricky with quasi-Monte Carlo methods with low discrepancy sequences, where you have to potentially give different ranges of the sequence to the different threads, etc. But in general your question is very unspecific so it is hard to answer in a satisfactory manner. Apr 1 at 13:49
• @lightxbulb, I am doing protein modeling and simulation. Apr 1 at 13:58
• What I mean is that you need to describe mathematically what you are doing. Naive Monte Carlo (MC) integration, vs quasi-MC integration, vs Metropolis-Hastings MC integration, vs MC optimisation, etc. are all different methods. Often the point is that you have an unbiased estimator which allows you to average different samples in order to get a solution with a lower variance, but that is not always the case. Apr 1 at 14:34
• @lightxbulb, Metropolis-only, not Metropolis-Hastings. Apr 1 at 14:47
• Aymptotically, each thread is sampling from the same distribution, so you answer should be the same eventually. Apr 1 at 16:53