Chapter 3. A Tutorial Introduction

Table of Contents
3.1. Installing POOMA
3.2. Hand-Coded Implementation
3.3. Element-wise Array Implementation
3.4. Data-Parallel Array Implementation
3.5. Stencil Array Implementation
3.6. Distributed Array Implementation
3.7. Data-Parallel Field Implementation
3.8. Distributed Field Implementation

POOMA provides different containers and processor configurations and supports different implementation styles, as described in Section 1.1. In this chapter, we present several different implementations of the Doof2d two-dimensional diffusion simulation program:

These illustrate the Array, Field, Engine, layout, mesh, and Domain data types. They also illustrate various immediate computation styles (element-wise accesses, data-parallel expressions, and stencil computation) and various processor configurations (one processor and multiple processors).

The Doof2d diffusion program starts with a two-dimensional grid of values. To model an initial density, all grid values are zero except for one nonzero value in the center. Each averaging, each grid element, except the outermost ones, updates its value by averaging its value and its eight neighbors. To avoid overwriting grid values before all their uses occur, we use two arrays, reading the first and writing the second and then reversing their roles within each iteration.

We illustrate the averagings in Figure 3-1. Initially, only the center element has nonzero value. To form the first averaging, each element's new value equals the average of its and its neighbors' previous values. Thus, the initial nonzero value spreads to a three-by-three grid. The averaging continues, spreading to a five-by-five grid of nonzero values. Values in the outermost grid cells are always zero.

Figure 3-1. Doof2d Averagings

The Initial Doof2d Configuration

After the First Averaging

After the Second Averaging

Before presenting the various implementations of Doof2d, we explain how to install the POOMA Toolkit.