Public Member Functions | |
| ParallelSorter (T *vals, int sz) | |
Protected Member Functions | |
| od_int64 | nrIterations () const |
| int | minThreadSize () const |
| bool | doPrepare (int) |
| bool | doFinish (bool) |
| bool | doWork (od_int64, od_int64, int) |
| od_int64 | nrDone () const |
Static Protected Member Functions | |
| static bool | mergeLists (const T *vals, T *res, int start0, int start1, int start2, int stop, int &totalsz) |
Protected Attributes | |
| T * | vals_ |
| ArrPtrMan< T > | tmpbuffer_ |
| T * | curvals_ |
| T * | buf_ |
| const int | nrvals_ |
| const int | totalnr_ |
| Threads::ConditionVar | condvar_ |
| TypeSet< int > | starts_ |
| TypeSet< int > | newstarts_ |
| Threads::Barrier | barrier_ |
Sorting in parallel. Code is still experimental. The basic principle is: 1. Divide samples into subsets. 2. Sort subsets in parallel 3. Merge pairs of subsets iteratively until there are only one subset left.
| ParallelSorter< T >::ParallelSorter | ( | T * | vals, | |
| int | sz | |||
| ) | [inline] |
| bool ParallelSorter< T >::doFinish | ( | bool | success | ) | [inline, protected, virtual] |
Reimplemented from ParallelTask.
| bool ParallelSorter< T >::doPrepare | ( | int | nrthreads | ) | [inline, protected, virtual] |
Reimplemented from ParallelTask.
| bool ParallelSorter< T >::doWork | ( | od_int64 | start, | |
| od_int64 | stop, | |||
| int | thread | |||
| ) | [inline, protected] |
| bool ParallelSorter< T >::mergeLists | ( | const T * | vals, | |
| T * | res, | |||
| int | start0, | |||
| int | start1, | |||
| int | start2, | |||
| int | stop, | |||
| int & | totalsz | |||
| ) | [inline, static, protected] |
| int ParallelSorter< T >::minThreadSize | ( | ) | const [inline, protected, virtual] |
Reimplemented from ParallelTask.
| od_int64 ParallelSorter< T >::nrDone | ( | ) | const [inline, protected, virtual] |
Reimplemented from ParallelTask.
| od_int64 ParallelSorter< T >::nrIterations | ( | ) | const [inline, protected, virtual] |
Implements ParallelTask.
Threads::Barrier ParallelSorter< T >::barrier_ [protected] |
T* ParallelSorter< T >::buf_ [protected] |
Threads::ConditionVar ParallelSorter< T >::condvar_ [protected] |
T* ParallelSorter< T >::curvals_ [protected] |
TypeSet<int> ParallelSorter< T >::newstarts_ [protected] |
const int ParallelSorter< T >::nrvals_ [protected] |
TypeSet<int> ParallelSorter< T >::starts_ [protected] |
ArrPtrMan<T> ParallelSorter< T >::tmpbuffer_ [protected] |
const int ParallelSorter< T >::totalnr_ [protected] |
T* ParallelSorter< T >::vals_ [protected] |
1.7.1