Thrill  0.1
tlx::parallel_mergesort_detail Namespace Reference

Classes

struct  PMWMSPiece
 Subsequence description. More...
 
struct  PMWMSSortingData
 Data accessed by all threads. More...
 

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

Function Documentation

◆ determine_samples()

void tlx::parallel_mergesort_detail::determine_samples ( PMWMSSortingData< RandomAccessIterator > *  sd,
DiffType &  num_samples,
size_t  iam,
size_t  num_threads 
)

Select samples from a sequence.

Parameters
sdPointer to sorting data struct. Result will be placed in sd->samples.
num_samplesNumber of samples to select.
iammy thread number
num_threadsnumber of threads in group

Definition at line 93 of file parallel_mergesort.hpp.

References SimpleVector< ValueType, Mode >::begin(), tlx::multiway_merge_detail::equally_split(), tlx::parallel_multiway_merge_oversampling, PMWMSSortingData< RandomAccessIterator >::samples, PMWMSSortingData< RandomAccessIterator >::source, and PMWMSSortingData< RandomAccessIterator >::starts.

Referenced by parallel_sort_mwms_pu().

◆ parallel_sort_mwms_pu()

void tlx::parallel_mergesort_detail::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.

Parameters
sdPointer to sorting data struct.
iammy thread number
num_threadsnumber of threads in group
barrierthread barrier from main function
compComparator.
mwmsaMultiwayMergeSplittingAlgorithm to use.

Definition at line 120 of file parallel_mergesort.hpp.

References SimpleVector< ValueType, Mode >::begin(), determine_samples(), tlx::multisequence_partition(), tlx::multiway_merge_base(), tlx::MWMSA_EXACT, tlx::MWMSA_SAMPLING, PMWMSSortingData< RandomAccessIterator >::pieces, PMWMSSortingData< RandomAccessIterator >::samples, PMWMSSortingData< RandomAccessIterator >::source, PMWMSSortingData< RandomAccessIterator >::starts, PMWMSSortingData< RandomAccessIterator >::temporary, and ThreadBarrierMutex::wait().