Vectorizing Code with OpenMP

This exercise demonstrates an example of making code modifications that enable the utilization of vector instructions effectively.

This directory contains an OpenMP version of the Chebyshev program used in Exercise 2. As in the previous exercise: make a new directory as a clean copy of the original before making changes so that you have a good point of comparison.

Part 1: Bilding with Different Options

The Makefile is set up to compile an executable at –O3. Verify that when compiled at –O2 the program is slower. Use a problem size of 500000 (i.e. 10x that used in Practical 2). Inspect the compiler output when using the –qopt-report=5 -qopt-report-phase=vec flags.

Part 2: Enabling vectorization

enable vectorisation inside evaluate_Tpoly and find_Tcoeffs using OpenMP simd directives discussed.

Experiment with different OpenMP parallel schedules to see how they interact with vectorization.