monte carlo method is very general. use random numbers to approximate solutions to problems. ...

16
Parallel Monte Carlo Method

Upload: david-williamson

Post on 05-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Parallel Monte Carlo Method

Page 2: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Introduction

Monte Carlo method is very general. use random numbers to approximate solutions to

problems. especially useful for simulating systems with

many coupled degrees of freedom simulate procedures with a large number of

inputs. We can apply the method in everything from

economics to nuclear physics to regulating the flow of traffic.

Page 3: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Common uses

Traffic flow

Financial analysis

Computer Graphics

Nuclear reactor design

Molecular dynamics

Radiation cancer therapy

Page 4: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

General Guidelines

Define a domain of possible inputs.

Generate inputs randomly from a probability

distribution over the domain.

Perform a deterministic computation on the

inputs.

Aggregate the results.

Page 5: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Example

Lets approximate

Given that function and 1x1 square have a ratio of

areas that is 1/2

Page 6: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Example 1/4for i=1:N; x=rand; y=rand; F(i,1)=x; F(i,2)=y; if(x<=y) count=count+1; endendsol = count/N;

Page 7: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Example 2/4

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Number of samples is:100 The Solution is:0.520000

x

y

Page 8: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Example 3/4

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Number of samples is:1000 The Solution is:0.486000

x

y

Page 9: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Example 4/4

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Number of samples is:10000 The Solution is:0.497900

x

y

Page 10: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Method summary

So Generally, the more iterations of the Monte Carlo

simulation, the better the approximation will be.

The problem: It requires an intensive computing

Page 11: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Can we parallelize ?

Page 12: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Method flow chart - serial

Page 13: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Method flow chart - parallel

Page 14: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

SpeedUp

Page 15: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Conclusions

Monte Carlo Algorithms are very easy to convert to parallel algorithms.

When scaling to larger numbers of parallel CPU’s we see a smooth decrease in the time spent per timestep for a given simulation.

Page 16: Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many

Questions?