Image Rotation

This example is written in C using MPI. An image is read from disk and repeatedly rotated by one degree increments. After each image rotation the screen is updated.

A single processor reads the input image from disk and broadcasts to all the other processors in the system. Each processor allocates space for a contiguous swath of rows in the output image. Processors then calculate the coordinates of the source input image pixel for each pixel in this output image swath. Individual swaths of the output image are then collected at the destination processor. The destination processor then displays the image on the local X server.

Note: When running this program make sure that your DISPLAY environment variable is set and that the MP_PROCS environment variable is set to 4.


Sample image