COMP528 Assignment 3 This assignment requires knowledge of shared memory programming to parallelise and extend a given serial code, and to run the parallel code on the University HPC facility, Barkla. Marks are split between the coding and the report. You will recognise the basis of this assignment as being similar to that for assignment 2 but note there are some changes to initialisation and constants used in the simulation. The code as provided via ~mkbane/COMP528/assignments/assignment-3/pollen-v2.c This code is a naïve model of pollen blowing in the wind and slowly falling to the ground. We initialise NUMPOLLEN pollen particles to a set of (x,y,z) and for each of MAXTIME (=3000) timesteps we mimic a wind function to give velocity in each axis which is used to update the (x,y,z) components of position. Finally, in that timestep we count the number of total pollen particles on the ground timestep. Updates on the amount of pollen on the ground is output every 50 timesteps. You are required to find the “best linear fit” of number of pollen on the ground by including code that implements the below formulae to find the values of “m” and “c” where “y(x)” is the number of pollen particles on the ground at the end of time, “x”. You should only find the best linear fit for the last 1000 timesteps (t=2000 to t=2999 inclusive) and include your equation for the best fit for these points in your report. = {∑ − ∑ ∑} {∑ଶ − (∑)ଶ}൘ = ∑ − ∑ Your main aim of the coding side of this assignment, is to implement an efficient OpenMP code that models the falling pollen and performs the relevant best linear fit. There are several options open regarding specific implementation details, and your report must describe and justify your choices. Useful Steps to Complete the Assignment 1. (see hints from 2nd assignment) Requirements of Assignment Coding You are required to implement your result on Barkla, to write a clear, concise and correct OpenMP code in “C” and, using the Intel compiler, run it in batch on Barkla with varying number of OpenMP threads and environment variables to find the quickest time-to-solution (whilst maintaining accuracy of the solution). All compilations should be done explicitly with the “-O0” optimisation flag. (The assignment is to explore and discuss parallelism, so we do not want optimisation and you must therefore turn off compiler optimisations via the -O0 flag.) You should use the OpenMP wallclock omp_get_wtime() function, 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. You are required to submit (via zipfile to SAM) the code and the batch script that are used to run your code, and all batch output files whose data is used with the report. Report You should submit a report of up to 4 pages (+ up to 2 pages of appendix (e.g. data)). The report is an important element of the assignment where you can show your understanding of parallel programming using OpenMP. Your report should discuss the performances of your implementation, explaining why you think they are good or poor, and explaining any lack of ideal scaling or other poor performance. Specifically, you should include: o Your approach to parallelising the code: what have you done and why? o How you have compiled and run the code, and what numbers of OpenMP threads you have used, and why. o Your equation of the best linear fit for the last 1000 data points o You should have a section that discusses the performance & accuracy of your implementation. o Your fastest time to obtain the full solution (i.e do the modelling and do the best linear fit of required data points) o A ½ page comparison of your experiences using MPI and OpenMP, highlighting which you found easiest (and why) to write and/or get the best performance from, and which you would choose to use for future parallel programming (and why). Marking Scheme & Submission Correct results (specifically, number of pollen particles falling to the ground and best linear fit equation) Report 10% Correct & efficient OpenMP code Code 20% Speed of solution Code 20% Discussion of your parallelism implementation; (good explanations of why you decided to write the code as you did) Report 15% Performance: timing processes and discussion of relative performances & accuracy; (good timing practises; informed discussion of accuracy & time performances, speed-up factors etc) Code &Report 15% Your personal comparison of OpenMP and MPI programming Report 20% Your submission must include: Report to be submitted to the COMP528 course module hosted on CANVAS (see “COMP528 CA#3”) Zipfile of C code, your SLURM batch scripts and the SLURM output file/s which you discuss in your report to be uploaded to SAM submission system (see “COMP528-3: 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 The deadline is 17:00 GMT, THURSday 17 December 2020. 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]
欢迎咨询51作业君