The goal of this assignment is learn basic message programming and
to develop a program using simple partitioning.
For this assignment you are to write two programs in either C or C++ using
the MPI message passing library. Your programs must compile without warnings
and execute correctly on for full credit. Also, for full credit use good programming
style, including the use of an appropriate amount of comments. In
addition to the source code, your submission must also include the answers,
in a plain text file, to the questions found at the end of the page.
Do not - I repeat DO NOT - submit binaries!!
trapezoid < left > < right >
The parallel version should execute under MPI with the command line interface:
mpirun -np <number of processors> trapezoid < left > < right >
You may assume that in the serial version that you start with 2 trapezoids and double it each time until the result is "close enough", for example until the change is less than .0001. For the parallel version, you may assume that each process starts with 2 trapezoids and iterates independently until its portion is "close enough". In order for the total error to be the same as that of the sequential case, note that you must adapt the stopping criteria appropriately. You may hardcode the function.
For now, you may use the function
y=x^3 - 9x^2 + 26x - 24
Also, for convenience, you may use the following sample command line tests. You may also want to develop some test calls of your own in order to thouroughly test the program :
For both programs answer the following summary questions in a plain text file: