Exercise E7:
- Implement the parallel program bw using MPI_Scatterv and MPI_Gatherv. As starting point you can use the serial version. It has to be compiled
together with pic.c, for example by typing
> gcc sbw.c pic.c -o sbw
The required definitions are contained in pic.h which has to be copied to the
same place as pic.c and sbw.c.
You can run the serial program sbw with
> sbw figurein.pnm figureout.pnm
where figurein.pnm is a pnm color file and figureout.pnm is
the name of the black and white picture which is calculated in sbw.
- Detailed instructions on how to use the picture i/o routines are given
in the file pic.h.
- Test your parallel program with different pictures, for example
You can convert the format from jpg to pnm for example with
the program gimp, or xv, or simply with
> jpegtopnm porsche.jpg > porsche.pnm
- Determine the speedup of your code compared to the serial version.
Back