conv-it is a C /C 11 program for computing iterative convolution of integer matrices.
I wrote it from scratch as an assignment for the Algorithms and Parallel Computing course I attended at Politecnico di Milano. Its purpose was to apply different parallelization methods to the same program. That's why there are five different versions and their respective executable files:
- conv_it_st: single-threaded program
- conv_it_omp: parallelism is achieved via OpenMP
- conv_it_mpi: MPI is used to distribute workload among processors
- conv_it_hybrid: enhanced by both OpenMP and MPI
- conv_it_cuda: runs on CUDA-capable GPUs
Make sure you've installed g (supporting -std=c 11), make, OpenMP, MPI and CUDA (where available).
Once you have downloaded a copy of the repository run
make compile
This will create all five executables mentioned above. If you're interested in only one of them, select the appropriate target e.g.
make conv_it_cuda
To launch an automated test, type
make test
You can change the settings of the test (such as version, number of threads/processes) by modifying directly the file runAll.sh.
In order to run properly, every conv_it executable needs the following arguments:
- no. of iterations
- no. of rows in the input matrix
- no. of columns in the input matrix
- no. of rows in the kernel
- no. of columns in the kernel
- name of the file containing the input matrix
- name of the file containing the kernel
- name of the output file
All files must contain space-separated integer values representing the entries of the matrix.
OpenMP needs you to set the OMP_NUM_THREADS variable.
MPI is enabled by launching the executable with
mpirun -np P executable argument1 argument2 ...
where P is the number of processes.
Tested on Ubuntu 16.04 LTS with gcc 5.4.0, GNU Make 4.1, OpenMPI 1.10.2, CUDA 9.2
Copyright © 2018 Francesco Primon.