CSCI 476: Trapezoid Rule Using OpenMP

Overview

Rewrite your MPI trapezoid program to use OpenMP instead of MPI. You may use BOTH API-s if you’d like.

Requirements

Incorporate the following features.

Input

Input a, b, n, and p from the user.

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

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

Sample Output

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
p ==> 4

With n = 1000 trapezoids, our estimate
  of the integral from x.x to x.x = xxxx.xxxx.
(no spaces after the preceding line)

What to Submit

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


Gary M. Zoppetti, Ph.D.