2#ifndef MADNESS_WORLD_BINSORTER_H__INCLUDED
3#define MADNESS_WORLD_BINSORTER_H__INCLUDED
13 template <
typename T,
typename inserterT>
21 if (
bins[owner].size())
27 for(
typename std::vector<T>::const_iterator it =
v.begin(); it !=
v.end(); ++it) {
74 bins[
p].push_back(value);
This header should include pretty much everything needed for the parallel runtime.
A parallel bin sort across MPI processes.
Definition binsorter.h:14
virtual ~BinSorter()
Definition binsorter.h:57
void finish()
Invoke to complete the sort, flush all buffers, and ensure communication/processing is complete.
Definition binsorter.h:65
BinSorter(World &world, inserterT inserter, int bufsize=0)
Constructs the sorter object.
Definition binsorter.h:38
void insert(ProcessID p, const T &value)
Application calls this to add a value to the bin for process p.
Definition binsorter.h:73
void flush(int owner)
Definition binsorter.h:20
inserterT inserter
Definition binsorter.h:16
std::vector< T > * bins
Definition binsorter.h:18
std::size_t bufsize
Definition binsorter.h:17
World * pworld
Definition binsorter.h:15
void sorter(const std::vector< T > &v)
Definition binsorter.h:26
static std::size_t max_msg_len()
Returns the size of recv buffers, in bytes.
Definition worldrmi.h:327
void fence(bool debug=false)
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition worldgop.cc:161
Implements most parts of a globally addressable object (via unique ID).
Definition world_object.h:364
World & world
The World this object belongs to. (Think globally, act locally).
Definition world_object.h:381
void process_pending()
To be called from derived constructor to process pending messages.
Definition world_object.h:656
detail::task_result_type< memfnT >::futureT send(ProcessID dest, memfnT memfn) const
Definition world_object.h:731
A parallel world class.
Definition world.h:132
ProcessID size() const
Returns the number of processes in this World (same as MPI_Comm_size()).
Definition world.h:328
WorldGopInterface & gop
Global operations.
Definition world.h:205
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:34
static const double v
Definition hatom_sf_dirac.cc:20
Defines madness::MadnessException for exception handling.
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
Defines and implements WorldObject.
int ProcessID
Used to clearly identify process number/rank.
Definition worldtypes.h:43