22 class STDVectorStackOverSmartPointers;
231 const int remainingElements = parentStack->
size() - numberOfElements;
235 std::make_move_iterator(parentStack->
_data.begin() + remainingElements),
236 std::make_move_iterator(parentStack->
_data.end())
238 parentStack->
_data.erase(parentStack->
_data.begin() + remainingElements, parentStack->
_data.end());
244 const T&
get(
int index)
const {
257 std::ostringstream msg;
258 msg <<
"(size=" <<
size() <<
")";
279 _size(numberOfElements),
295 T*
set(
int index,
const T& value) {
302 const T&
get(
int index)
const {
315 std::ostringstream msg;
342 const T&
top(
int shift = 0)
const;
463#include "STDVectorStackOverSmartPointers.cpph"
#define assertion2(expr, param0, param1)
SendReceiveContext
There are three different scenarios when we merge data:
This class represents a whole block of the tree.
PopBlockStackView(int numberOfElements, peano4::stacks::STDVectorStackOverSmartPointers< T > *parentStack)
Constructor.
const T & get(int index) const
std::string toString() const
peano4::stacks::STDVectorStackOverSmartPointers< T > * _parentStack
T * set(int index, const T &value)
Set an entry.
const T & get(int index) const
std::string toString() const
PushBlockStackView(int numberOfElements, peano4::stacks::STDVectorStackOverSmartPointers< T > *parentStack)
Constructor.
This stack hosts data of constant size which are stored on the heap and subject to smart pointers.
void startReceive(peano4::grid::TraversalObserver::SendReceiveContext context, int rank, int tag, MPI_Comm comm, int numberOfElements)
Counterpart of startSend()
void push(const T &element)
Pushes element to a stack.
static tarch::logging::Log _log
Logging device.
MPI_Request * _ioMetaDataMPIRequest
void scatterDebugMetaData()
bool tryToFinishSendOrReceive()
Semantics are alost an exact 1:1 copy of the superclass implementation.
PushBlockStackView pushBlock(int numberOfElements)
Push a block on the output stack.
MPI_Request * _ioMPIRequest
void prepareMetaDataBuffers()
Mere alloc.
STDVectorStackOverSmartPointers(const STDVectorStackOverSmartPointers< T > &)
T pop()
Pops element from a stack.
const T & top(int shift=0) const
Get top element or shiftth top element.
void prepareGatheredDataBuffer()
Mere alloc.
void clone(const STDVectorStackOverSmartPointers< T > &data)
Clone data into the current object on which clone() is called.
void startSend(peano4::grid::TraversalObserver::SendReceiveContext context, int rank, int tag, MPI_Comm comm)
Start the actual send process.
void scatter()
Scatter received gathered data.
MPI_Request * _ioDebugMetaDataMPIRequest
void gatherMetaData()
Allocate buffer and gather.
STDVectorStackOverSmartPointers()
void gather()
Allocate buffer and gather.
PopBlockStackView popBlock(int numberOfElements)
This operation grabs numberOfElements from the input stack en block and returns a view to it.
int sendingOrReceiving() const
I need this one to find out whether I'm waiting for data.
T & top(int shift=0)
Get top element or shiftth top element.
int * _gatheredMetaData
Meta data with size of memory chunks.
double * _gatheredDebugMetaData
Debug data.
void reverse()
Reversing a stream is something I need extremely rarely.
T::DoFType * _gatheredData
See MPI routines below.
STDVectorStackOverSmartPointers< T > & operator=(const STDVectorStackOverSmartPointers< T > &stack)
One is allowed to copy a stack but it has to be empty.
std::vector< T > _data
This is the attribute holding all the temporary stacks.
std::string toString() const