Skip to content
This repository has been archived by the owner on Oct 20, 2018. It is now read-only.
/ conv-it Public archive

Iterative matrix convolution program written in C . Five versions: same purpose, different parallelism implementation (none, OpenMP, MPI, OpenMP MPI, CUDA).

License

Notifications You must be signed in to change notification settings

FPrimon/conv-it

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

conv-it

Introduction

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:

  1. conv_it_st: single-threaded program
  2. conv_it_omp: parallelism is achieved via OpenMP
  3. conv_it_mpi: MPI is used to distribute workload among processors
  4. conv_it_hybrid: enhanced by both OpenMP and MPI
  5. conv_it_cuda: runs on CUDA-capable GPUs

Instructions

Before compiling

Make sure you've installed g (supporting -std=c 11), make, OpenMP, MPI and CUDA (where available).

Compiling

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

Testing

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.

Passing arguments

In order to run properly, every conv_it executable needs the following arguments:

  1. no. of iterations
  2. no. of rows in the input matrix
  3. no. of columns in the input matrix
  4. no. of rows in the kernel
  5. no. of columns in the kernel
  6. name of the file containing the input matrix
  7. name of the file containing the kernel
  8. 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.

About

Iterative matrix convolution program written in C . Five versions: same purpose, different parallelism implementation (none, OpenMP, MPI, OpenMP MPI, CUDA).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published