GithubHelp home page GithubHelp logo

mpi_sorting's Introduction


Logo

Sorting with MPI

A fun twist on traditional sorting algorithms that utilizes parallel computing and MPI communication!

Table of Contents

About The Project

This project implements the traditional in-place Heapsort algorithm but uniquely apply it while using the power of MPI and parallel computing to distribute the work among multiple processors to make the sorting even more efficient.

How It Works

  1. The program starts with a random set of numbers in each processor.
  2. Next each process sorts the values stored in its machine.
  3. Once the set of numbers in each processor are sorted, each processor creates its "p-sample". Essentially each processor creates a list holding each n/p value (n = number of values, p = number of processors).
  4. Next, each processor sends its p-sample list to processor-0.
  5. Processor-0 then sorts all the p-sample values into one ordered list.
  6. Processor-0 then takes this sorted list and creates a global p-sample list and sends this global p-sample to all the processors.
  7. Within each processor distribute each processors values into "buckets" using the global p-sample list to set the number of buckets and what values will go into each bucket.
  8. Next, have each processor communicate its bucket size to all other processors
  9. Now send each processor buckets to all other processors
  10. Finally, send the sorted post bucket sizes to all and make the appropriate adjustments so each processor has equal (or as close to equal as possible) size of values
  11. Values are now sorted evenly within each processor

The main MPI call being used is is MP_Alltoall() as this limits the cost of communication and ensures the costly act of MPI communication between systems is done as efficiently as possible.

Getting Started

This project was developed with Java and a slew of other technologies. Please Follow the instructions bellow carefully to download and run the project. If you have any issues please feel free to email me at [email protected] . I would be happy to help or fix any issues you run into.

Prerequisites

Here the things you need to run the code:

  • C++
  • MPI
  • Openstack

Setup for Openstack

Ensure you have access to an Openstack program that gives access to utilizing a large array of machines. I was lucky enough to be able to use my universities Openstack system for this cool project. It is likely you probably don't have access to this and sadly it won't be obvious how to run my program in your position.

I will include my schools instructions of how to setup Openstack to work this program however. This general set of steps is what I used to make my project work. Openstack Instructions

Usage

To use the program is pretty simple to use once you have set-up everything with Openstack. I have provided input and (correct) output files that each processor should read in and the code includes a function to intelligently have each processor read in its file of values. From there, just run the code appropriately through Openstack and see how the results compare to the output files!

Contact

Luke Daschko - @lukeduker - [email protected]

Project Link:https://github.com/LukeVibes/MPI_Sorting

mpi_sorting's People

Contributors

lukevibes avatar

Watchers

James Cloos 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.