HPC MPI Exercise 3: Hands-On Lab -- Fire!!


A burning forest

All models are wrong, but some are useful. -George Box

Introduction

In this week's exercise, we will explore computational modeling -- the modeling of real-world processes or phenomena in software.

Computational modeling is useful in situations where experimenting with a real-world physical process is impractical, costly, or dangerous. A computer model of the physical phenomenon lets us experiment with the phenomenon, and perhaps come to understand how the process works, without the limitations, cost, or danger found in the real world.

The phenomenon we'll be modeling is a forest fire. The model we'll use is simplified so that we can understand it easily, which reduces its representational accuracy. This simplicity-vs-accuracy tradeoff is common in modeling: models are (by definition) imperfect representations of the phenomena they represent, and the more simplified the model, the less accurately it represents the complexities of the real world.

Despite being imperfect, such models can be useful. For example, the model we will be examining might be used by a local weather service to determine the threat-level of wildfires, or by park rangers to determine when it is safe (or unsafe) for campers to have campfires.

Getting Started

Begin by experimenting with this fire applet from the Shodor Foundation's Interactivate Project.

This model lets you start a forest fire by clicking on a tree, which lights it on fire. The fire then spreads probabilistically to neighboring trees, based on the burn-probability, which models the likelihood of a fire spreading from a tree to its neighbors. The drier a forest is, the more likely fire is to spread between trees, so the burn-probability represents how dry a forest is.

When the fire burns out, the model displays the percentage of the forest that burned, and how long (number of iterations) the fire burned. Once your forest fire has burned itself out, you can "regrow" the forest by clicking the Regrow Forest button. Take a few minutes to experiment with the model, to get a sense of how it works.

Exercise

We want to use this model to explore these questions:

Click the Highlight Center Tree button to make it clear which tree is the center tree. Then for each of the burn probabilities 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, and 0.9:
  1. Start a forest fire at the center tree. In a spreadsheet, record the probability, the percentage of the forest that burns, and the time (iterations) the forest burns.
  2. Regrow the forest.
When you have finished, use the spreadsheet to create two quick charts:
  1. one with the percentage-burned on the Y-axis
  2. one with the time (iterations) on the Y-axis
and the burn-probability on the X-axis. Don't bother adding titles, legends or axis labels to these charts; they are just to take a quick look at our data.

Consult with your neighbors: Compare your charts to those of two of your classmates. How do they compare--are they similar or different?

Computational Modeling

A computational model is a computer program that seeks to model some physical phenomenon. A statistical computational model models the phenomenon using statistical probabilities and pseudo-random numbers. The Shodor Foundation's Fire!! app provides a nice user-interface to a statistical computational model of a forest fire.

But because it uses probabilities and pseudo-random numbers, the model is non-deterministic: if you rerun the model several times and give it the exact same inputs (burn-probability, center tree), it will almost certainly produce different outputs (percentage-burned, time). The model's use of random numbers and probabilities causes its outputs to be variant, or non-deterministic.

The Monte Carlo Pattern

A Monte Carlo simulation is a special kind of statistical computational model conceived in 1946 by the mathematician Stanislaw Ulam and first implemented by John Von Neuman and his wife Klara in 1948. (The problem they were solving was to find the optimal amount of nuclear fuel to use in a hydrogen bomb; ran their simuations on the ENIAC computer!)

When a model has variant outputs, the Monte Carlo technique compensates for that variance by running the model many times and averaging the results. Each execution of the model is called a trial; by averaging the results of many trials, the simulation can compute the most probable (i.e., most likely) behavior of the phenomenon being modeled for a given set of inputs.

For each of our nine burn probabilities, start a forest fire the same way two more times, and add the resulting percent-burned and time results to your spreadsheet so that you have six measurements (three percent-burned and three time) for each burn-probability. We now have the results of three trials of the simulation.

For each of the nine burn-probabilities in your spreadsheet, use your spreadsheet's built-in functions to calculate the averages of the three percent-burned and time trials. Then create two new quick charts that plot these averages (Y-axis) against the nine burn-probabilities (X-axis). As before, do not bother to beautify these charts with titles, labels, etc.

  1. Consult with your neighbors: How do your new charts compare to your first ones? Are they similar or markedly different?
  2. Consult with your neighbors: How do your new charts compare to your classmates' new charts? Are they similar or markedly different?

Congratulations--you have just manually performed a 3-trial Monte Carlo simulation for 9 of the 101 burn-probabilities!

This week's project is to perform a 10,000-trial Monte Carlo simulation over all 101 burn-probabilities. Needless to say, it would be extremely tedious to perform such a simulation manually. We will provide you with a sequential Monte Carlo simulation; this week's project is to speed it up using what you have learned about parallelism. The Monte Carlo technique is broadly useful and relatively easy to parallelize, so your task this week is to apply this high-level parallel design pattern.

Feel free to continue to experiment with the forest fire applet using different burn-probabilities; when you feel you you have an intuitive understanding of how this model is working, proceed to this week's project.


CS > 374 > Exercise > 03 > Hands-On Lab


This page maintained by Joel Adams.