Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
COMP3036J - Parallel and Cluster Computing
Assignment 2
Assignment Details:
• Assignment Type: Code and report
• Release Date: 22-April-2025
• Lecturer: Helard Becerra
• Weighting: 15%
• Due Date: 17-May-2025 (4 Weeks)
• Method of Submission: Moodle (.pdf and .c file) and beckett4 (.c file)
Task:
Implement an MPI-based parallel program in C that calculates basic statistical measures: mean, minimum, and maximum from a distributed dataset. To implement your program, you MUST use MPI collective communication functions such as MPI_Scatter, MPI_Reduce, and MPI_Bcast.
Dataset Details and Loading
A dataset is provided as a CSV file named data.csv. The file is available at the server beckett4.ucd.ie.. You need to copy this file from this location /home/csstudent/assignment2/data.csv to your own folder (e.g., /home/cs20123456/). This file contains a single row of integer values separated by commas, e.g.:
23,45,12,67,89,10,34,56,78,90,21,43
Data Handling Strategy:
• Only process 0 will read the file using standard C file I/O.
• It will convert the CSV string into an integer array.
• This array will then be scattered using MPI_Scatter to the remaining processes.
• Ensure that the total number of integers is evenly divisible by the number of processes.
If it’s not, you should pad the array with dummy values (e.g., -1) and ignore those in the final calculations.
Expected Output
The root process (rank 0) will print something like:
Dataset Statistics:
-------------------
Mean: 45.42
Minimum: 10
Maximum: 90
Intermediate processes may print their local stats for debugging (optional).
Deliverables:
You are required to submit:
1. A C program named stats_calculator.c that:
• Reads the dataset.• Distributes data using MPI.• Computes global statistics using collective communication.
2. A technical report (500–700 words) describing:
• The problem and solution approach.• Key MPI functions used and brief logic reasoning• A sample output and explanation.
Grading
• Code
– Correct use of MPI (Scatter, Reduce, Bcast) 20%– Functional logic & correctness 20%– Code organization and readability 20%
• Report
– Explanation of code logic 20%– Justification of MPI function use 20%