User Tools

Site Tools


cs415pdc:lab7

Lab 7

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.

  1. Run each program using 2, 4, 8, and 16 threads and label each result with the process count.
  2. Graph the runtime (not speedup) versus number of processors for each the two programs.
  3. Describe which version of the trap rule program performs best, and under what conditions. Remember you can create a text-only cell in Jupyter.
  4. Post the writeup in HTML format on your webpage.
cs415pdc/lab7.txt · Last modified: 2017/11/14 12:31 by scarl