MADNESS 0.10.1
madness::BinSorter< T, inserterT > Class Template Reference

A parallel bin sort across MPI processes. More...

#include <binsorter.h>

Inheritance diagram for madness::BinSorter< T, inserterT >:
Collaboration diagram for madness::BinSorter< T, inserterT >:

Public Member Functions

 BinSorter (World &world, inserterT inserter, int bufsize=0)
 Constructs the sorter object.
virtual ~BinSorter ()
void finish ()
 Invoke to complete the sort, flush all buffers, and ensure communication/processing is complete.
void insert (ProcessID p, const T &value)
 Application calls this to add a value to the bin for process p.
Public Member Functions inherited from madness::WorldObject< BinSorter< T, inserterT > >
 WorldObject (const WorldObject &other)
virtual ~WorldObject ()
WorldObject & operator= (const WorldObject &)=delete
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn) const
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)().
Public Member Functions inherited from madness::WorldObjectBase
virtual ~WorldObjectBase ()
World & get_world () const
World & get_world_noexcept () const noexcept
 Get the world to which this object belongs, without risking a throw.
const uniqueidT & id () const
 Returns the globally unique object ID.
bool world_is_alive () const noexcept
 Reports whether the world to which this object belongs still exists.

Private Member Functions

void flush (int owner)
void sorter (const std::vector< T > &v)

Private Attributes

std::vector< T > * bins
std::size_t bufsize
inserterT inserter
World * pworld

Additional Inherited Members

Public Types inherited from madness::WorldObject< BinSorter< T, inserterT > >
typedef WorldObject< BinSorter< T, inserterT > > objT
Protected Member Functions inherited from madness::WorldObject< BinSorter< T, inserterT > >
void process_pending ()
 To be called from derived constructor to process pending messages.
Protected Member Functions inherited from madness::WorldObjectBase
 WorldObjectBase (const WorldObjectBase &other)
 Copy constructor; produces an unregistered object.
 WorldObjectBase (World &w)
 Construct a new WorldObjectBase.
World & get_world_unchecked () const noexcept
 Unchecked access to the memoized world reference.
template<typename DerivedT>
void register_self (DerivedT *this_ptr)
 Registers this object with its world, making it globally addressable.

Detailed Description

template<typename T, typename inserterT>
class madness::BinSorter< T, inserterT >

A parallel bin sort across MPI processes.

Constructor & Destructor Documentation

◆ BinSorter()

template<typename T, typename inserterT>
madness::BinSorter< T, inserterT >::BinSorter ( World & world,
inserterT inserter,
int bufsize = 0 )
inline

Constructs the sorter object.

Parameters
[in]worldThe world object that must persist during the existence of this object
[in]inserterUser provides this routine to process an item of data on remote end
[in]bufsizeSize of bin (in units of T) ... default value is as large as possible

References BinSorter(), madness::WorldObject< BinSorter< T, inserterT > >::WorldObject(), bins, bufsize, inserter, madness::RMI::max_msg_len(), madness::WorldObject< BinSorter< T, inserterT > >::process_pending(), pworld, and madness::WorldObjectBase::world.

Referenced by BinSorter().

◆ ~BinSorter()

template<typename T, typename inserterT>
virtual madness::BinSorter< T, inserterT >::~BinSorter ( )
inlinevirtual

References bins, MADNESS_ASSERT, and pworld.

Member Function Documentation

◆ finish()

template<typename T, typename inserterT>
void madness::BinSorter< T, inserterT >::finish ( )
inline

Invoke to complete the sort, flush all buffers, and ensure communication/processing is complete.

References flush(), and pworld.

◆ flush()

template<typename T, typename inserterT>
void madness::BinSorter< T, inserterT >::flush ( int owner)
inlineprivate

◆ insert()

template<typename T, typename inserterT>
void madness::BinSorter< T, inserterT >::insert ( ProcessID p,
const T & value )
inline

Application calls this to add a value to the bin for process p.

References bins, bufsize, flush(), madness::Future< void >::value, and p().

◆ sorter()

template<typename T, typename inserterT>
void madness::BinSorter< T, inserterT >::sorter ( const std::vector< T > & v)
inlineprivate

References inserter, and v.

Referenced by flush().

Member Data Documentation

◆ bins

template<typename T, typename inserterT>
std::vector<T>* madness::BinSorter< T, inserterT >::bins
private

Referenced by BinSorter(), ~BinSorter(), flush(), and insert().

◆ bufsize

template<typename T, typename inserterT>
std::size_t madness::BinSorter< T, inserterT >::bufsize
private

Referenced by BinSorter(), and insert().

◆ inserter

template<typename T, typename inserterT>
inserterT madness::BinSorter< T, inserterT >::inserter
private

Referenced by BinSorter(), and sorter().

◆ pworld

template<typename T, typename inserterT>
World* madness::BinSorter< T, inserterT >::pworld
private

Referenced by BinSorter(), ~BinSorter(), and finish().


The documentation for this class was generated from the following file: