1 Lecture 12 Monte Carlo methods in parallel computing Parallel Computing Fall 2008.

Slides:



Advertisements
Similar presentations
Uncertainty Quantification & the PSUADE Software
Advertisements

Monte Carlo Methods and Statistical Physics
Fundamentals of Data Analysis Lecture 12 Methods of parametric estimation.
Simple Linear Regression and Correlation
Graduate School of Information Sciences, Tohoku University
BAYESIAN INFERENCE Sampling techniques
Optimization methods Morten Nielsen Department of Systems biology, DTU.
Simulation Where real stuff starts. ToC 1.What, transience, stationarity 2.How, discrete event, recurrence 3.Accuracy of output 4.Monte Carlo 5.Random.
Statistics for Business and Economics
Machine Learning CUNY Graduate Center Lecture 7b: Sampling.
A general assistant tool for the checking results from Monte Carlo simulations Koi, Tatsumi SLAC/SCCS.
Chapter 14 Simulation. Monte Carlo Process Statistical Analysis of Simulation Results Verification of the Simulation Model Computer Simulation with Excel.
Monte Carlo Simulation Used when it is infeasible or impossible to compute an exact result with a deterministic algorithm Especially useful in –Studying.
G4ConvergenceTester and ExN03Con KOI, Tatsumi SLAC National Accelerator Laboratory 1Geant4 Collaboration Workshop
Simulation of Random Walk How do we investigate this numerically? Choose the step length to be a=1 Use a computer to generate random numbers r i uniformly.
Marko Tainio, marko.tainio[at]thl.fi Modeling and Monte Carlo simulation Marko Tainio Decision analysis and Risk Management course in Kuopio
Independent Study of Parallel Programming Languages An Independent Study By: Haris Ribic, Computer Science - Theoretical Independent Study Advisor: Professor.
01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.
Practical quantum Monte Carlo calculations: QWalk
Particle Transport Methods in Parallel Environments
Stochastic Algorithms Some of the fastest known algorithms for certain tasks rely on chance Stochastic/Randomized Algorithms Two common variations – Monte.
Part 5 Parameter Identification (Model Calibration/Updating)
Monte Carlo Simulation CWR 6536 Stochastic Subsurface Hydrology.
1 Theoretical Physics Experimental Physics Equipment, Observation Gambling: Cards, Dice Fast PCs Random- number generators Monte- Carlo methods Experimental.
CS 521 Computational Science 1 Random Numbers and Monte Carlo Methods Charles Erwin and Jay Hatcher.
Machine Learning Lecture 23: Statistical Estimation with Sampling Iain Murray’s MLSS lecture on videolectures.net:
Monte Carlo I Previous lecture Analytical illumination formula This lecture Numerical evaluation of illumination Review random variables and probability.
Kalman Filter (Thu) Joon Shik Kim Computational Models of Intelligence.
Stochastic Monte Carlo methods for non-linear statistical inverse problems Benjamin R. Herman Department of Electrical Engineering City College of New.
Random Numbers and Simulation  Generating truly random numbers is not possible Programs have been developed to generate pseudo-random numbers Programs.
1 SMU EMIS 7364 NTU TO-570-N Inferences About Process Quality Updated: 2/3/04 Statistical Quality Control Dr. Jerrell T. Stracener, SAE Fellow.
Monte Carlo Methods in Statistical Mechanics Aziz Abdellahi CEDER group Materials Basics Lecture : 08/18/
Monte Carlo Methods Versatile methods for analyzing the behavior of some activity, plan or process that involves uncertainty.
Hit-and-Miss (or Rejection) Monte Carlo Method:
Delivering Integrated, Sustainable, Water Resources Solutions Monte Carlo Simulation Robert C. Patev North Atlantic Division – Regional Technical Specialist.
Monte Carlo Methods So far we have discussed Monte Carlo methods based on a uniform distribution of random numbers on the interval [0,1] p(x) = 1 0  x.
Part III - Forecast Confidence Intervals Chapter 4 Statistics for Managers Using Microsoft Excel, 7e © 2014 Pearson Prentice-Hall, Inc. Philip A. Vaccaro,
Hit-and-Miss (or Rejection) Monte Carlo Method: a “brute-force” method based on completely random sampling Then, how do we throw the stones and count them.
1 Everyday Statistics in Monte Carlo Shielding Calculations  One Key Statistics: ERROR, and why it can’t tell the whole story  Biased Sampling vs. Random.
4. Numerical Integration. Standard Quadrature We can find numerical value of a definite integral by the definition: where points x i are uniformly spaced.
Monté Carlo Simulation  Understand the concept of Monté Carlo Simulation  Learn how to use Monté Carlo Simulation to make good decisions  Learn how.
Mathematical Modeling of Signal Transduction Pathways Biplab Bose IIT Guwahati.
Statistics Presentation Ch En 475 Unit Operations.
INFSO-RI Enabling Grids for E-sciencE SALUTE – Grid application for problems in quantum transport E. Atanassov, T. Gurov, A. Karaivanova,
 Monte Carlo method is very general.  use random numbers to approximate solutions to problems.  especially useful for simulating systems with many.
Monte Carlo Process Risk Analysis for Water Resources Planning and Management Institute for Water Resources 2008.
Lesson 4: Computer method overview
NCN nanoHUB.org Wagner The basics of quantum Monte Carlo Lucas K. Wagner Computational Nanosciences Group University of California, Berkeley In collaboration.
Lesson 6: Computer method overview  Neutron transport overviews  Comparison of deterministic vs. Monte Carlo  User-level knowledge of Monte Carlo 
Molecular Modelling - Lecture 2 Techniques for Conformational Sampling Uses CHARMM force field Written in C++
Statistics for Business and Economics 8 th Edition Chapter 7 Estimation: Single Population Copyright © 2013 Pearson Education, Inc. Publishing as Prentice.
1 Introduction to Statistics − Day 4 Glen Cowan Lecture 1 Probability Random variables, probability densities, etc. Lecture 2 Brief catalogue of probability.
MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations
Quasi Random Sequences Fields of use Author: Stefan Ilijevski.
COMP7330/7336 Advanced Parallel and Distributed Computing MPI Programming - Exercises Dr. Xiao Qin Auburn University
Lecture 13 Dustin Lueker. 2  Inferential statistical methods provide predictions about characteristics of a population, based on information in a sample.
Probabilistic Slope Stability Analysis with the
Unified Adaptivity Optimization of Clock and Logic Signals Shiyan Hu and Jiang Hu Dept of Electrical and Computer Engineering Texas A&M University.
The Monte Carlo Method/ Markov Chains/ Metropolitan Algorithm from sec in “Adaptive Cooperative Systems” -summarized by Jinsan Yang.
CHEM-E7130 Process Modeling Lecture 6
Monte Carlo Methods and Grid Computing
Random Numbers and Simulation
Monte Carlo Methods Some example applications in C++
Questions from lectures
VLSI Testing Lecture 6: Fault Simulation
VLSI Testing Lecture 6: Fault Simulation
Lecture 2 – Monte Carlo method in finance
Statistical Data Mining
STA 291 Spring 2008 Lecture 14 Dustin Lueker.
Presentation transcript:

1 Lecture 12 Monte Carlo methods in parallel computing Parallel Computing Fall 2008

2 What is Monte Carlo? Monte Carlo methods are a class of computational algorithms that rely on repeated random sampling to compute their results. Monte Carlo methods are often used in simulating physical and mathematical systems. studying systems with a large number of coupled degrees of freedom, such as fluids, disordered materials, strongly coupled solids, and cellular structures (see cellular Potts model). modeling phenomena with significant uncertainty in inputs, such as the calculation of risk in business. Mathematics: e.g. evaluation of definite integrals Monte Carlo methods tend to be used when it is infeasible or impossible to compute an exact result with a deterministic algorithm (that is, intractable problems ). Monte Carlo Algorithm is a randomized algorithm that may produce incorrect results, but with bounded error probability.

3 Applications of Monte Carlo 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 eigenvalues Intranuclear cascade reactions 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

4 Example 1 - Monte Carlo Integration to Estimate Pi A simple example to illustrate Monte Carlo principals Accelerate convergence using variance reduction techniques Use if expectation values Importance sampling Adapt to a parallel environment

5 Monte Carlo Estimate of Pi

6 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

7 Parallelization of Monte Carlo Integration If message passing time is negligible For same run time, error decreases by factor of Sqrt(p) For same accuracy, run time improves by a factor of p Should use same random number generator on each node (easy for homogeneous architecture)

8 Monte Carlo Estimates of Pi Number of Batch CPU Standard True Processors Size Time(sec) Deviation Error , , ,

9 Monte Carlo Estimates of Pi 1. Creating the random number generators for ( int i=0; i < num_dimension; i++) { // create r.n. generator // the seeds are different for the processors seed = (myRank + 1) * i * ; if ( seed == 0 ) rand[i] = new RandomStream(RANDOMIZE); else rand[i] = new RandomStream( seed ); }

10 Monte Carlo Estimates of Pi 2. Each processors will run num_random / numProcs random walks for ( i=myRank; i < num_random; i+=numProcs ) { // N random walks 2a. Generating random numbers for ( int i1=0; i1 < num_dimension; i1++) { ran[i1] = rand[i1]- > next(); } 2b. Calculating for integration if ( inBoundary( ran, num_dimension ) ) { myPi += f( ran, num_dimension ) * pdf( ran, num_dimension ); count++; }

11 Monte Carlo Estimates of Pi 3. Calculating Pi from each processor myPi = 4 * myPi / num_random; MPI_Reduce(&myPi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); 4. Output the results and standard deviation, sigma if (myRank == 0) { cout << "pi is = " << pi << " sigma = " << 4 * sqrt( (pi/4 - (pi/4)*(pi/4)) / num_random) << " Error = " << abs(pi - PI25DT) << endl; }

12 End Thank you!