CMSC 476: Trapezoid Rule Using MPI

Overview

Rewrite the trapezoid program from class.

Requirements

Incorporate the following features.

Input Specification

Input a, b, and n from the user on process 0.

Use PRECISELY the format below with the EXACT same SPACING and SPELLING.

a ==> 0.0
b ==> 1.0
n ==> 1000

Output Specification

Use PRECISELY the format shown below with the EXACT same spacing and spelling.

Sample Output

(no spaces before the following line)
a ==> 0.0
b ==> 1.0
n ==> 1000

With n = 1000 trapezoids, our estimate
  of the integral from 0.0 to 1.0 = xx.xxxxx.
(no spaces after the preceding line)

Required Types, Concepts, and Functions

template<...>
ReturnType
integrateTrap (...)

What to Submit

Submit your source file Trapezoid.cc. You must demo your solution for any credit, integrating at least TWO different functions with known results.


Gary M. Zoppetti, Ph.D.