COMP528 Assignment 2 13 of total marks
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 YmXc. 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 compareexplain their relative performances.
Finding the Best Linear Fit
Based upon, for example,
https:www.mathsisfun.comdataleastsquaresregression.html
for input vectors X and Y comprising N elements, you determine m by
andcby
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 Xi set as i1003.01
for i0 to 49,999,999 and then set yx by calling a function that returns for any input, x the value of 1.0expx50000.1sinx501.1logxepscosx499.01x
where eps is set to 1.0E06
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 qopenmpstubs. 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 pagesup to 2 pages of appendix e.g. data that includes:
o Thecorrectbestlinearfitfortheinputdatadefinedabove
o Howyoudecidedtoimplementthedataparallelism,andwhy
o Howyoudecidedtoimplementthetaskparallelism,andwhy
o Thecommandsyouusedtocompileruneachcodegivingeachcommandanditsflags
if you used a batch scripts to do all compilations and runs you should also upload these to
SAM
o Discussionoftherelativeperformanceaccuracyoftheserial,dataparallelandtask
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 accuracytime performances, speedup 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 codesscripts to be uploaded to SAM submission system COMP5282: 2OpenMP
https:sam.csc.liv.ac.ukCOMPSubmissions.pl
Submissions will be submitted to automatic plagiarismcollusion detection systems, and those exceeding a threshold will be reported to the Academic Integrity Officer for investigation regarding adhesion to the universitys policy https:www.liverpool.ac.ukmedialivacuktqsdcodeofpracticeonassessmentappendixLcopassess.pdf
DEADLINESUBMISSION
The deadline is noon, Saturday 30 November 2019. Usual university rules, penalties and exceptions for latenesssicknessexceptional circumstances apply https:www.liverpool.ac.ukaqsdacademiccodesofpracticecodeofpracticeonassessment
ENDS
Reviews
There are no reviews yet.