next up previous contents
Next: Details on some Up: MPE Graphics Previous: MPE Graphics

Overview

In addition to the MPI functions, there is also a set of graphics routines located in a library called MPE. These routines are useful for MPI parallel programs that involve displaying graphical images. This library includes a simple interface to X. Of course, any program that uses MPE will have to include mpe.h by the line

#include "mpe.h"

You will also have to compile any program that uses MPE by including the -lmpe as part of the compilation line, like this:

mpicc lab.c -o lab -lmpe -lX11 -lm

Unfortunately, MPE does not supply the proper functions to create even a semi-reasonable interface. Thus, MPE_Get_mouse_status and MPE_Drag_square are provided for your use. These functions are in the file ~pollock/public/mouse_status.c on porsche, with prototypes in the file
~pollock/public/mouse_status.h on porsche. You should copy these files into your own directory.

There is a very terse summary of the MPE routines in Appendix C of the book Using MPI included in the reference list of this document. For a small example using the MPE graphics routines, see section 3.8 of Using MPI. Below is a list of the most frequently used MPE routines; the list does not contain all of the MPE graphics routines. For more, look at the file: /usr/local/mpi/mpe/mpe_graphics.h.

MPE_Open_graphics  - create a graphics window
MPE_Close_graphics  - destroy a graphics window
MPE_Draw_point  - draw a point in a window
MPE_Draw_points - draw a series of points in a window.
   (moderately faster than a series of MPI_Draw_point calls)
MPE_Draw_line  - draw a line in a window
MPE_Fill_rectangle  - draw a rectangle in a window
MPE_Update  - flush the buffer for a window
MPE_Get_mouse_press - wait until the user presses a mouse button
   and return the press point.
MPE_Get_mouse_status (in mouse_status.c) - get information about the mouse state
MPE_Drag_square (in mouse_status.c)  - let the user select a square on the screen
MPE_Make_color_array - create a nice spectrum of colors



Lori Pollock
Wed Feb 4 14:18:58 EST 1998