In the sequential SIMPDEL model, map data are stored as a series of grids, represented as two or three-dimensional arrays, depending on the grid cell resolution, as explained in Section 2.2. To facilitate dynamic grid repartitioning, to be explained in Section 3.1.2, a more efficient data structure is required. The map data structure used in the parallel model is shown in Figure 6.
Figure 6: Parallel Map Data Structure
Each processor has its own map data structure, map, containing an array of rows, row[RPIXEL], which corresponds to the total number of rows at the 500m scale. Each element of this array is itself a data structure containing the fields: pixels, cpu, firstcol, and columns.
The pixels array is of length columns containing map data at the 500m resolution, such as habitat type, water level, forage quantity, and a 5 by 5 array of 100m cells, each containing vegetation type, water level and forage quantity at the finer scale, as well as water distribution data required for hydrology updates. Each processor contains a pixels array for every row it owns, while all others are set to NULL. In order to decrease memory requirements for map data storage, only grid cells within the study area boundaries are stored, as opposed to the sequential model which stores every grid cell, regardless of location. The data structure field firstcol is used to map column indexes of the pixels array onto their actual positions in the study area. For example, if map.row[ i].firstcol is 5 then map.row[i].pixels contains the data corresponding to the 5th column of row i (where columns begin at 0), and if map.row[i].columns is 50 then map.row[i].pixels contains data corresponding to the 54th column of row i.
Although each processor stores only a portion of the map, and each portion is mutually exclusive, all processors contain identical data in the fields: cpu, firstcol, and columns, for each of the 420 (RPIXEL) rows. The value stored in map.row[i].cpu is the processor identification number on which row i is located so that the processor location of any grid cell can easily be determined, given the row position. The values stored in map.row[ i].firstcol and map.row[ i].columns are used to determine whether a grid location owned by another processor is within the study area boundaries.