Code Monkey home page Code Monkey logo

vector-multiplication-openmp's Introduction

Comparing performance of sequential vs OpenMP-based element-by-element vector multiplication.

In each of the experiments given below, we multiply two floating-point vectors x and y, with number of elements from 10^6 to 10^9 using OpenMP. Each element count is attempted with various approaches, running each approach 5 times to get a good time measure. Multiplication here represents any memory-aligned independent operation, or a map() operation.


Adjusting OpenMP schedule

In this experiment (adjust-schedule), we multiply two floating-point vectors x and y using OpenMP. Each element count is attempted with various OpenMP schedule configs. Results indicate a schedule-kind of auto to be suitable.


Comparision with Sequential implementation

In this experiment (compare-sequential, main), we compare the performance between finding x*y using a single thread (sequential), and using OpenMP. Here x, y are both floating-point vectors, and the comparison in performed on a number of vector sizes. Note that neither approach makes use of SIMD instructions which are available on all modern hardware. While it might seem that OpenMP method would be a clear winner, the results indicate it is not the case. This is possibly because of high communication costs, and not enough computational workload as indicated by this answer. However, from 10⁸ elements, OpenMP approach performs better than sequential. All outputs are saved in gist. Some charts are also included below, generated from sheets.



References



vector-multiplication-openmp's People

Contributors

wolfram77 avatar

Watchers

 avatar  avatar

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.