Skip to content

Monte Carlo Simulation

Tommy Gorham edited this page Apr 8, 2022 · 1 revision

The Monte Carlo Simulation is a mathematical technique which is used to estimate the possible outcomes of an uncertain event. For this example, we will use the Monte Carlo technique to compute pi

Innately, the Monte Carlo calculation is one that repeats the same step many times, hereby making it a good candidate for parallelization. Furthermore, its an excellent prospect for establishing a portable CPU/GPU solution, as factors like:

  • High memory requirements
  • Random memory access patterns
  • Divergent algorithms

create an interesting challenge when attempting to port to the GPU.

Setting up the program

Per the nature of the problem, we can make use of multiple processors by implementing a SIMD (Single Instruction, Multiple Data) solution such that we
run copies of the program on different processors, and then add up the results at the end.

Clone this wiki locally