Giter VIP home page Giter VIP logo

parallel-sort's Introduction

C++ Parallel Sort

An efficient C++ multi-threaded sorting function based on C++11 threads

How to use

To use this function, simply include the the file parasort.h in your program and call the template function parasort(sz, list, np, sf) with proper argument values. Here is the list of arguments:

  • Function prototype: parasort (size_t sz, T* list, unsigned np = 2; unsigned sf = 100);
  • sz: Length of array of type size_t;
  • list: Array of arbitrary type T. This array is used as both input and output since the sorted output is written to it. If T is not a built-in type, overload the operator <.
  • np: Number of concurrent threads. By default, np=2, so it is optional.
  • sf: Sampling factor. By default sf=100, so it is optional.

How to compile

This function uses only the standard C++ constructs, so you can compile it like any other C++ program. Just make sure you are using these flags in gcc:

  • For C++ 11 features: -std=c++11
  • For standard threads: -pthread

parallel-sort's People

Contributors

baserinia avatar

Watchers

 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.