Skip to content

Parallel programming homewrok @ Pollitecnico di Milano: develop a parallel version of grep using C++ and MPI

License

Notifications You must be signed in to change notification settings

paolobasso99/parallel_programming_homework

Repository files navigation

Parallel programming homewrok: parallel grep using MPI

This is my solution to an homework done at the PARALLEL PROGRAMMING course at Politecnico di Milano in 2022.

The prompt was to build a parallel version of the grep program using MPI. The homework prompt is aviable in Grep_Homework_Question notebook while my solution is in theGrep_Homework_Solution notebook.

You can open the solution directly on colab: Open In Colab

Setup

This homework is in C++ so you need a development envirorment that supports it, if you need help I found this good guide.

You also need to install MPI.

To run the notebooks you need to have Python installed.

Compile and run

To compile use:

mpicxx -fdiagnostics-color=always -g src/grep-main.cpp src/grep.cpp -o dest/grep-mpi.exe
mpicxx -fdiagnostics-color=always -g src/grep-sequential.cpp -o dest/grep-sequential.exe

And to run:

mpiexec -np 1 dest/grep-sequential matter input_file.txt
mpiexec -np 8 dest/grep-mpi matter input_file.txt

Project structure

The following files and folder are present:

About

Parallel programming homewrok @ Pollitecnico di Milano: develop a parallel version of grep using C++ and MPI

Topics

Resources

License

Stars

Watchers

Forks