Recall the method of timing OpenMP-based code described in OpenMP functions for timing code. We'll use this function again today.
In this lab we'll compare the use of
omp parallel with a
reduction clause to run the (local) Trap function in mulitple threads (as in omp_trap2b.c) with
the use of
omp parallel for with
reduction to parallelize only the for loop inside the Trap function (as in omp_trap3.c).
Grab these two programs from the OpenMP versions of the trapezoid rule set. If you haven't already, add timing code to each one in appropriate places. Run both programs on representative input and record the results in a table. As before, you need to record the average of at least 3 runs.