Giter Club home page Giter Club logo

parralelized_quicksort_bellmanford's Introduction

Parallelized Version of Quicksort and Bellman Ford

Parallelized version of quicksort.

Implemented parallelized quicksort using Openmpi library.

  • Split the main vector into a number of smaller parts using mpi_scatter function of mpi.
  • If length of vector is |n|, then if n%numprocs == 0 --> we give m = n/numprocs to each process else we zero-pad the array and give m = n/numprocs+1 to each process.
  • We then sort each individual subpart/subvectors parrallely in each process.
  • We now have m sorted vectors.We need to merge them.
  • We can merge by using same in O(m) time and in log(p) steps.
  • In the merge step, I have used MPI_Send and MPI_Recv to exchange vectors between processes.
  • Testing:
      1. sequential-0.50517 parallel-0.243557
      1. sequential-0.5076 parallel-0.272
      1. sequential-0.482768 parallel-0.2523
      1. sequential-0.499613 parallel-0.25343
      1. sequential-0.343654 parallel-0.23374
      1. sequential-0.365511 parallel-0.185698
      1. sequential-0.414262 parallel-0.217249
      1. sequential-0.452915 parallel-0.23488
      1. sequential-0.4259 parallel-0.2376
      1. sequential-0.504616 parallel-0.243047
      1. sequential-0.50169 parallel-0.281339
      1. sequential-0.50517 parallel-0.243557
      1. sequential-0.50924 parallel-0.247054
      1. sequential-0.4852 parallel-0.2435
      1. sequential-0.513111 parallel-0.24779

Parallelized version of bellman_ford.

  • Split the edge_u,edge_v,weight vectors into smaller chunks and distributed among p process.
  • Zero-padded the vectors and used the same above mentioned strategy for partitioning.
  • Relaxed the edges (n-1) times (Assumption: No negative cycle is present).
  • Have used MPI_AllReduce function to sync all the distances vector and the changed variable.
  • Testing:
      1. sequential-0.000317 parallel-0.000396
      1. sequential-0.018164 parallel-0.009953
      1. sequential-0.369531 parallel-0.156303
      1. sequential-0.369531 parallel-0.156303
      1. sequential-0.473369 parallel-0.188599
      1. sequential-0.447071 parallel-0.257097

parralelized_quicksort_bellmanford's People

Contributors

aayush0823 avatar batra98 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.