/travelling-salesman-problem

Comparison of parallelization APIs: MPI, std::thread, OpenMP, Pthreads. Tech: C, C++17, Py, CMake.

Primary LanguageC

Parallelization APIs. Travelling salesman problem.

Requirements

How to use

  1. Build project using makefiles created with help of CMake and source files so as to have the executables in folders cmake-build-debug and cmake-build-release You can simply do that e.g. using CLion or try it manually.
  2. Profile solver using profile.py.
  3. Generate CSV using report.py.

You can run scripts with argument -h to see help.

Note: profile.py and report.py are written to be run from the root project directory. You can change the project or target name in CMake or runner script, but then you need to accustom the flow at your own risk.

Manual compilation

$ mkdir cmake-build-debug; cd cmake-build-debug
$ cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" ..
$ cmake --build --target all -- -j 4; cd ..
$ mkdir cmake-build-release; cd cmake-build-release
$ cmake -DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - Unix Makefiles" ..
$ cmake --build --target all -- -j 4; cd ..

Profiler

Debug (verbose) OpenMP C++ solver 6 times using 2 threads to solve TSP for an automatically-generated graph of size 10, append a time which algorithm spend on calculation to tests/CPP_OpenMPSolver_size_10_slots_02.txt

$ python profile.py -m debug --lang cpp -i 10 --type omp --slots 2 --verbose

Generating CSV

Generate CSV from tests/ to summary.csv

$ python report.py --folder tests --output summary.csv

Enjoy your code-meal!

marcullo