Presentation is loading. Please wait.

Presentation is loading. Please wait.

Monte Carlo Methods A so-called “embarrassingly parallel” computation as it decomposes into obviously independent tasks that can be done in parallel without.

Similar presentations


Presentation on theme: "Monte Carlo Methods A so-called “embarrassingly parallel” computation as it decomposes into obviously independent tasks that can be done in parallel without."— Presentation transcript:

1 Monte Carlo Methods A so-called “embarrassingly parallel” computation as it decomposes into obviously independent tasks that can be done in parallel without any task communications during the computation. Monte Carlo methods use random selections. For parallelizing Monte Carlo code, must address best way to generate random numbers in parallel.

2 Calculate p using the Monte Carlo method
Circle formed within a 2 x 2 square. Ratio of area of circle to square given by: Points within square chosen randomly. Score kept of how many points happen to lie within circle. Fraction of points within circle will be , given sufficient number of randomly selected samples.

3 Typically only one quadrant used.
One quadrant can be described by integral: Random pairs of numbers, (xr,yr) generated, each between 0 and 1. Counted as in circle if

4 Workpool implementation
Slaves Compute Return number of N random points inside arc of circle inside Starting seed for random sequence to each slave seed Aggregate answers DiffuseData GatherData Master Compute node Source/sink

5 Alternative (better) Monte Carlo Method
(Not used here) Generate random values of x to compute f(x) Sum values of f(x): where xr are randomly generated values of x between x1 and x2. Monte Carlo method very useful if the function cannot be integrated numerically (maybe having a large number of variables) 3.19


Download ppt "Monte Carlo Methods A so-called “embarrassingly parallel” computation as it decomposes into obviously independent tasks that can be done in parallel without."

Similar presentations


Ads by Google