| 1 |
Example MPI programs |
| 2 |
|
| 3 |
This directory contains some example MPI programs. They are described below. |
| 4 |
Examples of MPI programs in Fortran 77, Fortran 90, and C++ are found in the |
| 5 |
directories f77, f90, and cxx respectively. |
| 6 |
|
| 7 |
cpi - A simple program to compute pi |
| 8 |
|
| 9 |
Optional programs |
| 10 |
These programs are not built by default, but may be built and run |
| 11 |
|
| 12 |
hellow - A simple "hello world" program |
| 13 |
icpi - An interactive version of cpi |
| 14 |
|
| 15 |
parent and child - A simple example of using MPI_Comm_spawn |
| 16 |
|
| 17 |
pmandel* - Programs to solve the Mandelbrot set |
| 18 |
|
| 19 |
Running the pmandel* programs |
| 20 |
----------------------------- |
| 21 |
The programs pmandel* solve the Mandelbrot set. The input to the program |
| 22 |
are the coordinates, scale etc for plotting the output of the program and the |
| 23 |
number of iterations to solve the set. The output is an image file (default is |
| 24 |
pmandel.ppm) of the Portable Pixel Map format. Help on using the program can |
| 25 |
be obtained by running the executable with "-help" parameter. |
| 26 |
|
| 27 |
To run the pmandel* tests you can either run it in the interactive mode (-i option) |
| 28 |
or run it in a non-interactive mode. In the interactive mode the output of the |
| 29 |
program is saved as an image file (you can specify the name of the file using -out |
| 30 |
option of the program). In the non-interactive mode you need a visualizer for the |
| 31 |
output (A Visualizer is available in Windows. Compile the project pman_vis for the |
| 32 |
visualizer.). |
| 33 |
Non-interactive execution eg -- |
| 34 |
mpiexec -n 2 pmandel -i |
| 35 |
(The program prompts for entering the coordinates, scales and no of iterations |
| 36 |
and output is saved in pmandel.ppm file) |
| 37 |
|
| 38 |
Interactive execution eg -- |
| 39 |
mpiexec -n 2 pmandel |
| 40 |
|
| 41 |
(Now open the visualizer program, pman_vis.exe, created by compiling pmandel_vis |
| 42 |
project in windows. Click on File -> Connect and select "TCP Socket Connect". |
| 43 |
Leave the default settings and click connect. The visualizer program connects to |
| 44 |
pmandel program and displays the output) |
| 45 |
|
| 46 |
pmandel* programs differ in the MPI functionalities used. For example, |
| 47 |
pmandel_service.c uses MPI_Open_Port() to connect to the visualizer while pmandel.c |
| 48 |
uses the sockets directly for the connection. |
| 49 |
|
| 50 |
|
| 51 |
Others will be documented later. |