Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

DTS202TC Foundation of Parallel Computing

Individual Coursework 2

Due: Sunday Dec. 21st, 2025 @ 11:59pm

Weight: 70%

Maximum score: 100 points

Assessment Overview

The purpose of this assignment is to provide hands-on experience with parallel programming and performance analysis. Using two different parallel programming approaches: write two programs in C with MPI/Pthread/OpenMP and pass the CUDA online test from Nvidia. The goal is to understand the differences between the techniques in terms of implementation complexity, execution speed, and scalability. Through this exercise, you will develop skills in writing parallel code, optimizing algorithms for parallel execution, and analyzing the performance gains achieved by parallelizing computational tasks.

Note

• You should attend your lectures on time, as lecture attendance is required for the NVIDIA registration process. Do not attend different lectures.

• Once you attend the lecture, you will need to finish the registration by the end of the day.

• Only after registration will you be able to access the study materials and take the online test.

• To receive the certificate from NVIDIA, you need to pass the online test.

Learning Outcomes

• C. Design, implement, and optimize parallel algorithms using appropriate tools and techniques (e.g., Pthreads, OpenMP, MPI, CUDA)

• D. Analyze the performance and efficiency of parallel algorithms

Avoid Plagiarism

• Do not submit work from others.

• Do not share code or work to other students.

• Do not read code or work from others, discussions between teams should be limited to high level only.

• Do not use open-source code or AI.

Figure 1: Grayscaling example.

Tasks

Image gray-scaling is one of the most common image processing tasks. A simple way to gray-scale an image is to set each pixel to the mean of the RGB channels. Gray = (R + G + B) /3 PBM, PGM, and PPM files are all image file formats that hold data in regards to pixels of an image. Compared to formats like PNG, JPG, etc, these formats are very simplistic, offering no compression. These are simple formats that store the colours of pixels as bytes which can be read into your program. The below image.ppm is given as an example, more detail ppm specifications can be found at https://netpbm. sourceforge.net/doc/ppm.html

image.ppm

P3

3 2

255

255 0 0 0 255 0 0 0 255

255 255 0 255 255 255 0 0 0

P3 - Magic Number (Tells the program this is a PPM file)

3 - Width

2 - Height

255 - Colour Range (0 = Black, This Number = White)

1 Parallel implementations (20 points for each implementation)

Each student is required to implement two different parallel programs: one solution with MPI and a second one with an alternative parallel method, Pthreads or OpenMP. It is important to note that you only need to focus on optimizing the core algorithm for speedup.

2 Performance analysis (30 points)

Analyse the performances of two parallel implementations, including speedup and efficiencies (15 points).

You should provide line plots to represent the results, including serial runtime, runtime of different numbers of processes/threads, speedup and efficiencies. (5 points).

Compare and contrast the two implementations (Performance Metrics, Hardware limitation, Ease of Debugging and Testing, Communication and Synchronization, or any other aspects you can think of), choose your preferred parallel technique and justify your choice (10 points).

3 Reflection (10 points)

Did you face any challenges during the implementation? How did you solve them?

4 NVIDIA certificate (10 points)

Each student is required to pass the CUDA assignment from Nvidia. The certificate should be submitted with the report of the coursework.

5 Submission (10 points)

Please note that quality of report and correctness of the submission will also be marked (10 points, 5 points for the quality and length of report, 5 points for the correctness of the submission).

You should submit the following files in a zip:

• mpi/pthread/openmp.c Your parallel implementations.

• A Makefile that will compile your code, make sure the output executable names are correct.

• A Nvidia certificate that proves you passed the CUDA test.

• A pdf file contains all the source code and the report, you should put the Cover Page in the first page of the report.

• The report should be between 1500 and 3000 words in length.

Once you have all the files, please put them in a single directory (named A2) and compress them to a zip file. You must follow the following structure. MPI is mandatory; choose another method from OpenMP and Pthread:

|---report.pdf

|---cuda_certificate.pdf

|---code.zip

|---mpi

|---grayscale_mpi.c

|---Makefile

|---openmp

|---grayscale_openmp.c

|---Makefile

|---pthread

|---grayscale_pthread.c

|---Makefile

The assignment must be submitted via Learning Mall to the correct drop box. Only electronic submission is accepted and no hard copy submission. All students must download their file and check that it is viewable after submission. Documents may become corrupted during the uploading process (e.g. due to slow internet connections). However, students themselves are responsible for submitting a functional and correct file for assessments.