Matrix Vector Multiplication openMP Optimization

Job ID: 35131101

Budget: $10 – $30 USD

Homework 2
In this homework, you will practice optimization of code using OpenMP.

Description
Based on an existing unoptimized solution to calculate matrix-vector product. Apply the optimization and check the result.

The calculation of a matrix-vector multiplication follows this formula ci = ∑nk = 1Aikbk where A is a matrix, b and c being two vectors.

In the sample code, the value is initialized as follows: Aij = 1.0 ⁄ (i + j), bj = 1.0 ⁄ (i + 1).

optimized versions: opt1.c, etc.
Make an optimized version in this file. Such optimization should be based on OpenMP this time. You may include any compiler and compiler optimization flags that you wish to. Your code should take the same command line argument as the sample unoptimized code unoptimized.c and produce output in the same format too, with no additional information. Name your finished code as opt1.c. Add opt2.c, etc. if you want to provide more than one solutions for comparison.

Hint: Do not forget to try gcc optimization flags like -O2 or -O3.

hw2.pdf
Present performance result comparison of the unoptimized code and your optimized code. You should also list all the optimizations that you tried. Discuss which ones were effective, which ones were not, and how much of an improvement the effective ones yielded. This document will typically be one or two pages long.