Description:
In this assignment I explore the heat distribution problem given in
the book
Parallel
Programming Techniques and Applications
Using Networked Workstations and Parallel Computers by Wilkinson
& Allen, Chapter 6, problem 6.15, Page 195. The main idea is to
model the heat distribution grid in a room based on a simple set of
conditions:-
At each time step, the temperature of a particle is
equal to the mean of the temperatures of its surrounding particles. If
z(t,i,j) is the temperature of a particle (i,j) at time t, then its
temperature at t+1 will be:-
z(t+1,i,j) = ( z(t,i+1,j) + z(t,i-1,j) + z(t,i,j+1) +
z(t,i,j-1) ) / 4
In the solution of the problem, 10m X 10m wall has been scaled to a 500 X 500 matrix grid, each representing 1 pixel on screen. This grid is split into stripes of minimum w pixels wide where w=500/p where p is the number of worker processors. There is a master processor that distributes the work to the slaves & the slaves perform computation in parallel. The slaves interact with each other by sending messages so that the values of the boundary pixels are exchanged and saved in an array of ghost points as is described in the book so that computation can be done. The number of time steps is taken to be 500, which can be altered by changing a constant. At each iteration, the workers exchange the value of the boundary points with the neighboring processors, does the computation & repeats the sequence till the maximum number of iterations is reached.
Apart from the book, I took the help from this website: http://www.cas.usf.edu/~cconnor/parallel/2dheat/2dheat.html which has a complete and more accurate implementation of the problem using MPE. I have also visualized the grid in Matlab (along with MPE) because Matlab has many interesting capabilities for visualizing such grids using contours.
Main areas explored in this assignment:
The main areas we explore & learn are:-
Assignment Resources:
Makefile
Note: If you want to compile my programs using the above Makefile in
UBC CS Deptt machines, replace this block in my Makefile
##### User configurable options #####
bla bla bla ...
### End User configurable options ###
with this block (simply copy &
paste it over my original makefile, erasing the previous block).
Text Output
from program
Description: Each process prints the region within the grid
which it is going to process & the number of rows as well as its
neighbor numbers. Typically these messages can be replaced by MPE log
state creation calls.
Graphical Outputs
a. Using 10 colors, 500 iterations, MPE
Visualization
Description: This is the MPE equivalent of the Matlab
figure in c. I have tried to use the same color scheme.
b. Using 32 colors, repeat, 500
iterations, contours, MPE Visualization
Description: Here colors are only used as an indicative of
gradation of temperature, some colors are repeated. These colors do not
signify any special temperature values, like heat or cold.
c. Matlab Visualization of
grid values shown in 4. Colder regions are in blue & hotter regions
are in red. A colormap shows the color gradation against temperature.
The corresponding matlab script to generate the
output is given here. Use it with "final.dat" given above in 4.
A clearer visualization without colormap & contour values is here.
Yet another figure in matlab showing
clearly the temperature gradation between different portions of the
room. Portions near the fireplace has high temperature, near the
borders have a constant 20 deg cel, and in the interior of the room,
its roughly 10 deg cel.
d. MPE Log visualization
Description: A magnified log visualization showing dense
exchange of messages between the processes (9 worker processes). This
program works on heavy interaction between adjacent processes as is
clear from the snapshot. The manager waits till the workers get their
job done by calling MPE_Barrier. When every worker process finish their
job & call the barrier function, the manager draws the top &
bottom rows of the matrix as the workers are not supposed to touch them
(they are held at a constant temperature). The workers meanwhile draw
their portions of the region on the display.
First Posted: Feb 21 2006. Last Updated: Feb 26 2006 Credits: 10