tlx
parallel_mergesort.hpp File Reference
#include <algorithm>
#include <functional>
#include <thread>
#include <utility>
#include <omp.h>
#include <tlx/algorithm/multisequence_selection.hpp>
#include <tlx/algorithm/parallel_multiway_merge.hpp>
#include <tlx/simple_vector.hpp>
#include <tlx/thread_barrier_mutex.hpp>

Go to the source code of this file.

Classes

struct  PMWMSPiece< DiffType >
 Subsequence description. More...
 
struct  PMWMSSortingData< RandomAccessIterator >
 Data accessed by all threads. More...
 

Namespaces

 tlx
 
 tlx::parallel_mergesort_detail
 

Functions

template<typename RandomAccessIterator , typename DiffType >
void determine_samples (PMWMSSortingData< RandomAccessIterator > *sd, DiffType &num_samples, size_t iam, size_t num_threads)
 Select samples from a sequence. More...
 
template<bool Stable, typename RandomAccessIterator , typename Comparator >
void parallel_sort_mwms_pu (PMWMSSortingData< RandomAccessIterator > *sd, size_t iam, size_t num_threads, ThreadBarrierMutex &barrier, Comparator &comp, MultiwayMergeSplittingAlgorithm mwmsa)
 PMWMS code executed by each thread. More...
 
Parallel Sorting Algorithms
template<bool Stable, typename RandomAccessIterator , typename Comparator >
void parallel_mergesort_base (RandomAccessIterator begin, RandomAccessIterator end, Comparator comp, size_t num_threads=std::thread::hardware_concurrency(), MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT)
 Parallel multiway mergesort main call. More...
 
template<typename RandomAccessIterator , typename Comparator = std::less< typename std::iterator_traits<RandomAccessIterator>::value_type>>
void parallel_mergesort (RandomAccessIterator begin, RandomAccessIterator end, Comparator comp=Comparator(), size_t num_threads=std::thread::hardware_concurrency(), MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT)
 Parallel multiway mergesort. More...
 
template<typename RandomAccessIterator , typename Comparator = std::less< typename std::iterator_traits<RandomAccessIterator>::value_type>>
void stable_parallel_mergesort (RandomAccessIterator begin, RandomAccessIterator end, Comparator comp=Comparator(), size_t num_threads=std::thread::hardware_concurrency(), MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT)
 Stable parallel multiway mergesort. More...