ARC

Monte Carlo Methods in Parallel Computing

Chuanyi Ding ding@arc.unm.edu
Eric Haskin haskin@unm.edu
Copyright by UNM/ARC
November 1995


Outline


What is Monte Carlo?


Different Monte Carlo Applications


	Radiation transport		  Operations research
	Nuclear criticality	  	  Design of nuclear reactors 
	Design of nuclear weapons	  Statistical physics
	Phase transitions 		  Wetting and growth of thin films
	Atomic wave functions and 	  Intranuclear cascade reactions 
	  eigenvalues			  Thermodynamic properties
	Long chain coiling polymers	  Reaction kinetics
	Partial differential equations 	  Large sets of linear equations
	Numerical integration 		  Uncertainty analysis
	Development of statistical tests  Cell population studies 
	Combinatorial problems		  Search and optimization
	Signal detection       		  WarGames


Probability Theory


Sampling a Cumulative Distribution Function


Fundamental Theorem


Statistical Error in MC Estimator


Example 1 - Monte Carlo Integration to Estimate Pi


Monte Carlo Estimate of Pi


When to Consider Monte Carlo Integration


Serial Monte Carlo Algoritm for Pi

            Read N
            Set SumG = 0.0
            Do While i < N
               Pick two random numbers xi and yi
               If (xi*xi + yi*yi £ 1) then
                  SumG = SumG + 1
               Endif
            Enddo
            Gbar = SumG / N
            SigGbar = Sqrt(Gbar - Gbar2)
            Print N, Gbar, SigGbar

Parallelization of Monte Carlo Integration


Monte Carlo Estimates of Pi



              Number of      Batch     CPU         Standard     True
              Processors     Size      Time(sec)   Deviation    Error
              --------------------------------------------------------
                   1        100,000    0.625       0.005        0.0018  
		   2         50,000    0.25        0.005        0.0037
		   4         25,000    0.81        0.005        0.0061
              --------------------------------------------------------




Variance Reduction by Use of Expectation Values


Variance Reduction by Important Sampling


A Product h(x)f(x) and a possible f~(x)


Using Qualitative Information


Omniscience Yields Zero Variance


Example 2 - Solving a Partial Differential Equation by Monte Carlo


Poisson's Equation As a Fixed Random Walk Model


Fixed Random Walk Solution Algorithm


Parallel Strategies for Fixed Random Walk


Results for Fixed Random Walk in Solid Slab



             Number of      Walks/    CPU               Standard
             Processors     Point     Time   u(20,20)   Deviation
             -----------------------------------------------------
                 1          1000      400    0.0483      0.00016
                 2a         1000      270    0.0480      0.00020
                 4a         1000      165    0.0485      0.00020
             =====================================================
                 2b         1000      313    0.0477      0.00020
                 4b         1000      234    0.0480      0.00029
             ----------------------------------------------------
	
	     a - Update all processors at same time
	     b - Only update whthin individual processor


Floating Random Walk Solution Algorithm (point.C)


Sample Results for Floating Random Walk in Solid Slab



             Number of      CPU  Time     CPU  Time 
             Processors     1000 Walks    100,000 walks
             ------------------------------------------
                 1          0.44          3.06
                 2          0.5           2.5
                 4          0.5           1.4
             ------------------------------------------



Example 3 - Monte Carlo Estimate of Thermodynamic Properties


Why not determine such expectation values exactly?

Number of Possible Configurations = 2**1000

Time Required for Exact Calculation = 10**288 years

Metropolis Algorithm


Example 3 - 2D Ising Model

spin = +1 (up),

spin = -1 (down)


2D Ising Metropolis Algorithm


2D Ising - Metropolis Algorithm (Cont.)


Example 3 - Monte Carlo Estimates of Thermodynamic Properties


Results for 2D Ising Problem


General Observations Regarding Paralle Monte Carlo