Implementation of PSRS parallel sorting routine. More...
Data Structures | |
class | taggedValue |
Private class for sorting. Sorts on value_. More... | |
Public Member Functions | |
ParSortableList (const UList< Type > &) | |
Construct from List, sorting the elements. More... | |
ParSortableList (const label size) | |
Construct given size. Sort later on. More... | |
void | sort () |
(stable) sort the list (if changed after construction time) More... | |
const labelList & | indices () const |
Return the list of sorted point indices. More... | |
const labelList & | procs () const |
Return the list of processor number. More... | |
![]() | |
label | size () const |
Return the number of elements in the UList. More... | |
List () | |
Null constructor. More... | |
List (const label) | |
Construct with given size. More... | |
List (const label, const T &) | |
Construct with given size and value for all elements. More... | |
List (const List< T > &) | |
Copy constructor. More... | |
List (const Xfer< List< T > > &) | |
Construct by transferring the parameter contents. More... | |
List (List< T > &, bool reUse) | |
Construct as copy or re-use as specified. More... | |
List (const UList< T > &, const labelUList &mapAddressing) | |
Construct as subset. More... | |
List (InputIterator first, InputIterator last) | |
Construct given start and end iterators. More... | |
List (const FixedList< T, Size > &) | |
Construct as copy of FixedList<T, Size> More... | |
List (const PtrList< T > &) | |
Construct as copy of PtrList<T> More... | |
List (const SLList< T > &) | |
Construct as copy of SLList<T> More... | |
List (const UIndirectList< T > &) | |
Construct as copy of UIndirectList<T> More... | |
List (const BiIndirectList< T > &) | |
Construct as copy of BiIndirectList<T> More... | |
List (Istream &) | |
Construct from Istream. More... | |
List (const label s) | |
List (const label s, const T &a) | |
List (const List< T > &a) | |
List (const Xfer< List< T > > &lst) | |
List (List< T > &a, bool reUse) | |
List (const UList< T > &a, const labelUList &map) | |
List (const PtrList< T > &lst) | |
List (const SLList< T > &lst) | |
List (const UIndirectList< T > &lst) | |
List (const BiIndirectList< T > &lst) | |
List () | |
List (Istream &is) | |
autoPtr< List< T > > | clone () const |
Clone. More... | |
~List () | |
Destructor. More... | |
void | resize (const label) |
Alias for setSize(const label) More... | |
void | resize (const label, const T &) |
Alias for setSize(const label, const T&) More... | |
void | setSize (const label) |
Reset size of List. More... | |
void | setSize (const label, const T &) |
Reset size of List and value for new elements. More... | |
void | clear () |
Clear the list, i.e. set size to zero. More... | |
void | append (const T &) |
Append an element at the end of the list. More... | |
void | append (const UList< T > &) |
Append a List at the end of this list. More... | |
void | append (const UIndirectList< T > &) |
Append a UIndirectList at the end of this list. More... | |
void | transfer (List< T > &) |
Transfer the contents of the argument List into this list. More... | |
void | transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &) |
Transfer the contents of the argument List into this list. More... | |
void | transfer (SortableList< T > &) |
Transfer the contents of the argument List into this list. More... | |
void | transfer (List< T > &a) |
void | transfer (SortableList< T > &a) |
Xfer< List< T > > | xfer () |
Transfer contents to the Xfer container. More... | |
T & | newElmt (const label) |
Return subscript-checked element of UList. More... | |
void | operator= (const UList< T > &) |
Assignment from UList operator. Takes linear time. More... | |
void | operator= (const List< T > &) |
Assignment operator. Takes linear time. More... | |
void | operator= (const SLList< T > &) |
Assignment from SLList operator. Takes linear time. More... | |
void | operator= (const UIndirectList< T > &) |
Assignment from UIndirectList operator. Takes linear time. More... | |
void | operator= (const BiIndirectList< T > &) |
Assignment from BiIndirectList operator. Takes linear time. More... | |
void | operator= (const T &) |
Assignment of all entries to the given value. More... | |
Private Member Functions | |
void | write (const List< Type > &elems, Ostream &os) const |
Write for debugging. More... | |
void | copyInto (const List< Type > &values, const labelList &indices, const label fromProcNo, label &destI, List< taggedValue > &dest) const |
Copy into dest, setting indices and processor no. More... | |
void | getPivots (const List< Type > &elems, List< Type > &pivots) const |
Calculate pivots. More... | |
void | checkAndSend (List< Type > &values, labelList &indices, const label bufSize, const label destProcI) const |
If destProc != myProcNo send & clear values and indices. More... | |
Private Attributes | |
labelList | indices_ |
Original indices. More... | |
labelList | procs_ |
Processor numbers. More... | |
Additional Inherited Members | |
![]() | |
typedef SubList< T > | subList |
Declare type of subList. More... | |
![]() | |
static const List< T > & | null () |
Return a null List. More... | |
![]() | |
void | size (const label) |
Override size to be inconsistent with allocated storage. More... | |
Implementation of PSRS parallel sorting routine.
From "On the Versatility of Parallel Sorting by Regular Sampling" Xiaobo Li et. all.
Construct from list of things to sort (uses SortableList, 'thing' should implement >, ==).
Will contain sorted data and in
Can also be constructed from size, filled at ease and then sort()'ed.
Definition at line 69 of file ParSortableList.H.
ParSortableList | ( | const UList< Type > & | values | ) |
Construct from List, sorting the elements.
Definition at line 127 of file ParSortableList.C.
References ParSortableList< Type >::sort().
ParSortableList | ( | const label | size | ) |
Construct given size. Sort later on.
Definition at line 139 of file ParSortableList.C.
|
private |
Copy into dest, setting indices and processor no.
Definition at line 54 of file ParSortableList.C.
References forAll, ParSortableList< Type >::taggedValue::index(), ParSortableList< Type >::taggedValue::procID(), and ParSortableList< Type >::taggedValue::value().
Calculate pivots.
Definition at line 77 of file ParSortableList.C.
References forAll, List::setSize(), and List::size().
|
private |
If destProc != myProcNo send & clear values and indices.
Definition at line 97 of file ParSortableList.C.
References Foam::endl(), Foam::Pout, and List::setSize().
void sort |
(stable) sort the list (if changed after construction time)
Definition at line 151 of file ParSortableList.C.
References UPstream::blocking, Foam::endl(), forAll, Pstream::gatherList(), SortableList::indices(), UPstream::master(), UPstream::myProcNo(), n, UPstream::nProcs(), Foam::Pout, Foam::reduce(), Pstream::scatter(), List::setSize(), setSize(), Foam::sort(), and write().
Referenced by ParSortableList< Type >::ParSortableList().
|
inline |
Return the list of sorted point indices.
Definition at line 186 of file ParSortableList.H.
References ParSortableList< Type >::indices_.
|
inline |
Return the list of processor number.
Definition at line 192 of file ParSortableList.H.
References ParSortableList< Type >::procs_.
|
private |
Original indices.
Definition at line 77 of file ParSortableList.H.
Referenced by ParSortableList< Type >::indices().
|
private |
Processor numbers.
Definition at line 80 of file ParSortableList.H.
Referenced by ParSortableList< Type >::procs().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.