It is described in Chapter 5 of Fox et al. (1988), Solving Problems on Concurrent Processors, Vol 1. The implementation needs to calculate the amplitude of points along a vibrating string for a specified number of time intervals. The equation to solve is:
"i" indicates the point on the line. The values array holds the current amplitudes. Note that the new amplitude for the point will depend on the current values at neighboring points.
The decomposition can be viewed as:
begin program learn number of processes and rank identify left and right neighbors get program parameters initialize wave values create persistent communication update values deallocate persistent communication if master: collect results and print if worker/slave: send results to master end
begin program learn number of processes and rank if master: get program parameters and initial data broadcast program parameters distribute initial data update values collect results if master: store results end
1: .00 11:-.20 21:-.32 31:-.32 41:-.19 51: .01 61: .21 71: .32 81: .31 91: .18 100: .00