To achieve population sizes similar to those in the sequential SIMPDEL model, message passing is necessary in order to locate suitable mates in areas owned by other processors. In the sequential model, any male deer within mating distance of a receptive female that has not already mated within the year is a potential mate. To locate a mate, a search is performed on the entire deer array. In the parallel model however, the maximum radius of 20 500m grid cells (i.e., 10km) from the female often spans several processors. In order to reduce or eliminate message passing, a restriction could be imposed on male deer, allowing only those located on the same processor as the female, or only those deer located on the north or south processors, to be potential mates. However, any restriction drastically affects the deer population over time, in comparison to that of the sequential program, and would produce different results for different partition sizes. Thus, the entire mating distance is made available to each deer, regardless of the number of processors this distance spans.
During the initialization phase of the parallel simulation, an
array, mate_msg, is created on each
processor (see Figure 9) and is used to store
the set of processors within the maximum mating distance.
Processor PN
's set includes
all processors, except PN
, containing one or more map rows
which lie within the interval
[(map.firstrow-radius+1), (map.firstrow+map.rows+radius-2)].
The processor numbers within the set are stored beginning at index 3 in mate_msg. The value stored in mate_msg[2] is the total number of processors within the set, and mate_msg[0] and mate_msg[1] are reserved for storage of a female deer's row and column locations.
If no available male deer is located on PN
, the female's row and
column locations are loaded into mate_msg[0] and
mate_msg[1],
respectively, and a new processor, PN
, is selected at random from those
stored in the array. PN
then sends the entire array
to PN
and awaits a response.
The response message indicates whether or not an available male was located
and may be sent by any processor within the set.
Upon receipt of the message from PN
, PN
will search its deer
array for an available male deer within mating distance of the location
specified in the message buffer.
If a male is located, PN
will send a confirmation message to PN
.
Otherwise, PN
sets the message index
corresponding to its PN number to -1, and chooses a new processor, PN
,
at random from the remaining values in the message buffer.
PN
will then send the updated message buffer to
PN
, and so on until either an available male is
found, or messages have been sent to all processors in the message buffer.
A reply message indicating that no male was located will be sent to
PN
only if no male deer are available on any processor in the set,
and will only be sent by the last processor to receive the message
buffer. See [Abb95] for more details of the
parallel mating process.