Code and parallelize (using OpenMP) the standard vector triad benchmark from the lecture. To do this, compile and link with the -qopenmp switch and use the "fused" parallel for/do directives in the following way:

 Fortran C do r=1,NITER!$OMP PARALLEL DOXXdo i=1,NXXXXa(i) = b(i) + c(i) * d(i)XXenddo!$OMP END PARALLEL DOenddo for(r=0; r

1. Perform benchmark runs with the sequential triad code on one Emmy core. Make sure that the actual benchmark loop is repeated often enough (i.e., set NITER appropriately) to get proper measurements (you may consult the skeleton code in the SCAN/ folder). Draw a performance graph (or make a table)  for N = 101...10(use log scaling on the x axis) and make sure the result is similar to what you expect.

2. Now fix the clock speed to 2.2 GHz. Can you interpret the observable changes to the data?

3. Repeat the experiment for 1...20 threads. Use likwid-pin to control the placement of threads. Example:

$module load likwid$ env OMP_NUM_THREADS=2
likwid-pin -c N:0-19 ./a.out

This runs the benchmark with 2 threads on one socket. Comment on the scalability of the benchmark for diﬀerent sizes (L1 cache, L2 cache, memory) and compare with the purely serial code.

4. What happens if you open the parallel region outside the repeat loop?