Next: Interacting Particles
Up: Diffusion
Previous: The Discussion
- 1
- The program discussed in section 5.2.5
initializes all entries in the
matrices managed by
the worker processes to the rank number of the processes.
But it is only the
interior of these matrices
that is really managed by the processes, whereas the boundary
rows and columns are filled by obtaining data from the
neighbouring processes. Rewrite the initialization procedure
to initialize only the
interior to the process
rank number and the remainder of each matrix should be
initialized to minus the rank number.
- Hint
- You will have to revise the function that displays the
matrices, because you will need more space for the minus sign.
- 2
- The program transfers whole
rows or
columns between processes. But it is only the
or
interior of the columns and rows
that contains the valid data. Rewrite the program to transfer
only what is really needed between the neighbouring processes.
- 3
- Revise the program to allow for an arbitrary number of start-up
processes. Fix the bug that does not account for the fact
that some processes may not make it into the newly formed
Cartesian communicator and that the master process may be
amongst them.
Next: Interacting Particles
Up: Diffusion
Previous: The Discussion
Zdzislaw Meglicki
2004-04-29