Giter VIP home page Giter VIP logo

parallellization-with-openmp-framework's Introduction

Parallellization-with-OpenMP-Framework

This is a project I created for my Parallel Programming course. The project examines 4 schedules of parallelization and their speed perforfance for a non-distributed workload with the OpenMP Framework and C++ as the programming language. I executed it in Virtual Box (Ubuntu 18.04.02).

The 4 types of scheduling that are examined are: 1)Static Scheduling 2)Dynamic Scheduling 3)Task Scheduling with simple task creation 4)Task Scheduling with recursive task creation

The object is simple. You are given a serial code and you have to parallelize it with the help of OpenMP Framework. The program accepts an input of a very big polylines.txt file and simplifies it (with accuracy also as an input) with the help of Ramer-Douglas-Pecker Algorithm.

Also I went a step further and optimised a little my teacher's code. I did that by improving the function that simplifies the polylines (RamerDouglasPecker) that is called every time to simplify the polylines by replacing the functions with faster calculations and I removed some useless assignments making even the serial code faster.

For the curious the results of this project is that the static scheduling approach although very simple is extremely ineffective for non distributed loads and tasks with recursive calling and a threshold in calling to avoid overhead is the best approach (Way #4).

A simple polylines file to test the program lies here: https://drive.google.com/file/d/1Sc_mOqag7wjEiupZEJ30p6jW95Go_HlY/view?usp=sharing

To crete the executable use in a terminal: g++ [-00(min optimization) - -O3(max optimization)] -fopenmp -Wall -Wextra -o execFile code.cpp

To execute the files simply download the folder in a VM ubuntu environment and execute the executable like this: ./execFile polylinesInputFile.txt accuracyValue printInScreenChoice numberOfThreadsSelection

where accuracyValue= a number form values [0.1, 0.01, 0.001, 0.0001] printScreenChoice= 0 (do not print results) or 1 (print results)

numberOfThreadsSelection is a parameter I added because it automated the task of creating the number of threads I wanted. It can take as value (1,2 or 4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.