Overview

This assignment requires knowledge of shared memory parallel programming to parallelise a given serial code, and to run the parallel code on the University HPC facility, Chadwick. Marks are split between the coding and the report.

You are provided with a set of equations to determine the best linear fit Y=mX+c. That is, for given input vectors, X and Y, you apply these equations to find m and c. Having written and tested a serial code you are required to write two parallel codes, one using task parallelism and the other using data parallelism, and to compare & explain their relative performances.

Finding the Best Linear Fit

Based upon, for example,
https://www.mathsisfun.com/data/least-squares-regression.html
for input vectors X and Y comprising N elements, you determine m by
and c by
If you do not understand these terms you should enquire via the Discussion Board associated with the COMP538 course module on VITAL.

Specific Example for this Assignment

You should set N as 50,000,000 (fifty million), with X[i] set as
i / 1003.01
for i=0 to 49,999,999 and then set y[x] by calling a function that returns (for any input, x) the value of
1.0/exp(x/50000.1) + sin(x/501.1) / (log(x+eps)+cos(x/499.01+x))
where eps is set to 1.0E-06

Requirements of Assignment

Coding

You are required to write clear, concise and correct codes in “C” that will each give the correct results using the Intel compiler for each of -qopenmp or -qopenmp-stubs. One code should implement task
parallelism and the other data parallelism.

There are various options available on how to implement your codes. You should take reasonable care to implement good OpenMP programming practises.

You should use OpenMP wallclock timers to determine the total run time of the code. Additionally, you should add timers around any specific regions of interest that you wish to discuss in your report. All timings should use good practise as discussed in lectures and labs. 

Your report should discuss the performances of your implementations, explaining why you think they are good or poor, and explaining any lack of ideal scaling or other poor performance.

All compilations should be done using the Intel compiler and with the -O0 optimisation flag. The assignment is to explore and discuss parallelism, so we do not want optimisation and therefore turn off compiler optimisations via the -O0 flag.

Report

You should submit a report of up to 5 pages (+ up to 2 pages of appendix (e.g. data)) that includes:

  • The correct best linear fit for the input data defined above
  • How you decided to implement the data parallelism, and why
  • How you decided to implement the task parallelism , and why
  • The commands you used to compile & run each code (giving each command and its flags) –
  • if you used a (batch) script/s to do all compilations and runs you should also upload these to SAM
  • Discussion of the relative performance & accuracy of the serial, data parallel and task parallel implementations, as a function of number of threads 

Marking Scheme

Correct OpenMP codes: 35%
(correct parallelism, good coding practices; marked by examination of codes)

Discussion of parallelism implementations: 25%
(good explanations of
why you decided to write the code as you did; marks via report)
Performance: timing processes and discussion of relative performances: 40%
(good timing practises; informed discussion of accuracy & time performances,
speed-up factors etc; marks via report)

Submission

Your submission must include:
A report to be submitted to the COMP528 course module hosted on VITAL
Zipfile of C codes (& scripts) to be uploaded to SAM submission system (COMP528-2: 2 – OpenMP)
https://sam.csc.liv.ac.uk/COMP/Submissions.pl
Submissions will be submitted to automatic plagiarism/collusion detection systems, and those exceeding a
threshold will be reported to the Academic Integrity Officer for investigation regarding adhesion to the
university’s policy
https://www.liverpool.ac.uk/media/livacuk/tqsd/code-of-practice-on-assessment/appendix_L_cop_assess.pdf

DEADLINE & SUBMISSION

The deadline is noon, Saturday 30 November 2019. Usual university rules, penalties and exceptions for
lateness/sickness & exceptional circumstances apply
https://www.liverpool.ac.uk/aqsd/academic-codes-of-practice/code-of-practice-on-assessment/
[ENDS]