How prukngan/convolution-2024-ssitw works
This project is a computational assignment focused on implementing a discrete 1D convolution in C, with both sequential and OpenMP-based parallel versions. The goal is to maintain the same convolution algorithm while adding parallelization only where necessary. The provided files hint at a very focused, algorithm-centric implementation supported by a simple GitHub Classroom autograding workflow.
Project Type and Purpose
• This is a single-program, C-based computational assignment aimed at demonstrating parallelization using OpenMP. It implements a discrete 1D convolution (akin to numpy.convolve(A, F, mode='valid')).
• The core aim is to compare sequential and parallel implementations, with a focus on performance gains under multithreading.
Main Components
• Input Processing: Illustrate the component that reads the input data. Inputs include an initial line specifying the dimensions (NA and NF), followed by the array elements for data (A) and filter (F). Note the variety of test input files provided (input_demo.txt, input_easy1.txt, etc.).
• Parallelization Module: Emphasize the modifications that enable parallel execution via OpenMP. Show how the same convolution algorithm is adapted – by inserting parallel for-loops, managing thread scheduling, and ensuring that the core algorithm remains intact.
• Output Generation: Show where and how the convolution result is output (as reflected by provided output files like output_demo.txt and output_easy1.txt).
• Testing/Validation: Display the role of the test case generator (via gen_case.py) and the various input/output file pairs that validate the correctness of both sequential and parallel versions.
• CI/Autograding Pipeline: Represent the GitHub workflows (.github/workflows/classroom.yml) that support continuous integration or autograding. This component automates the evaluation of the sequential version (with additional context provided via the README).
Relationships and Data Flow
• From Input Processing, branch into the Convolution Algorithm block which itself splits into two paths: one for running the sequential process and one for executing the OpenMP-parallel process.
• Both paths converge toward Output Generation where the computed convolution is written out.
Architectural Patterns and Key Technologies
• A “fork” of execution: the same underlying algorithm is executed in two versions. This reflects a key design principle where an algorithm’s core logic remains unchanged, only the execution context changes.
• Simple file-driven testing and validation mechanism as an aspect of continuous feedback used in classroom assignments.