Thrill
0.1
|
Ownership handle onto a MixStream.
Definition at line 126 of file mix_stream.hpp.
#include <mix_stream.hpp>
Public Types | |
using | MixReader = MixStreamData::MixReader |
using | Writer = MixStreamData::Writer |
Public Types inherited from Stream | |
using | Writer = StreamData::Writer |
using | Writers = StreamData::Writers |
Public Member Functions | |
MixStream (const MixStreamDataPtr &ptr) | |
~MixStream () | |
StreamData & | data () final |
Return stream data reference. More... | |
const StreamData & | data () const final |
Return stream data reference. More... | |
MixReader | GetMixReader (bool consume) |
MixReader | GetReader (bool consume) |
Open a MixReader (function name matches a method in File and CatStream). More... | |
Writers | GetWriters () |
const StreamId & | id () const final |
Return stream id. More... | |
Public Member Functions inherited from Stream | |
virtual | ~Stream () |
void | Close () |
shuts down the stream, waits for all closing blocks More... | |
template<typename ItemType > | |
void | Scatter (File &source, const std::vector< size_t > &offsets, bool consume=false) |
Scatters a File to many worker: elements from [offset[0],offset[1]) are sent to the first worker, elements from [offset[1], offset[2]) are sent to the second worker, ..., elements from [offset[my_rank - 1],offset[my_rank]) are copied locally, ..., elements from [offset[num_workers - 1], offset[num_workers]) are sent to the last worker. More... | |
template<typename ItemType > | |
void | ScatterConsume (File &source, const std::vector< size_t > &offsets) |
Consuming Version of Scatter() see documentation there. More... | |
template<typename ItemType > | |
void | ScatterKeep (File &source, const std::vector< size_t > &offsets) |
Keep Version of Scatter() see documentation there. More... | |
size_t | tx_items () const |
return number of items transmitted More... | |
size_t | tx_bytes () const |
return number of bytes transmitted More... | |
size_t | tx_blocks () const |
return number of blocks transmitted More... | |
size_t | rx_items () const |
return number of items received More... | |
size_t | rx_bytes () const |
return number of bytes received More... | |
size_t | rx_blocks () const |
return number of blocks received More... | |
size_t | tx_net_items () const |
return number of items transmitted via network excluding internal tx More... | |
size_t | tx_net_bytes () const |
return number of bytes transmitted via network excluding internal tx More... | |
size_t | tx_net_blocks () const |
return number of blocks transmitted via network excluding internal tx More... | |
size_t | rx_net_items () const |
return number of items received via network excluding internal tx More... | |
size_t | rx_net_bytes () const |
return number of bytes received via network excluding internal tx More... | |
size_t | rx_net_blocks () const |
return number of blocks received via network excluding internal tx More... | |
size_t | tx_int_items () const |
return number of items transmitted via internal loopback queues More... | |
size_t | tx_int_bytes () const |
return number of bytes transmitted via internal loopback queues More... | |
size_t | tx_int_blocks () const |
return number of blocks transmitted via internal loopback queues More... | |
size_t | rx_int_items () const |
return number of items received via network internal loopback queues More... | |
size_t | rx_int_bytes () const |
return number of bytes received via network internal loopback queues More... | |
size_t | rx_int_blocks () const |
return number of blocks received via network internal loopback queues More... | |
Public Member Functions inherited from ReferenceCounter | |
ReferenceCounter () noexcept | |
new objects have zero reference count More... | |
ReferenceCounter (const ReferenceCounter &) noexcept | |
coping still creates a new object with zero reference count More... | |
~ReferenceCounter () | |
bool | dec_reference () const noexcept |
Call whenever resetting (i.e. More... | |
void | inc_reference () const noexcept |
Call whenever setting a pointer to the object. More... | |
ReferenceCounter & | operator= (const ReferenceCounter &) noexcept |
assignment operator, leaves pointers unchanged More... | |
size_t | reference_count () const noexcept |
Return the number of references to this object (for debugging) More... | |
bool | unique () const noexcept |
Test if the ReferenceCounter is referenced by only one CountingPtr. More... | |
Private Attributes | |
MixStreamDataPtr | ptr_ |
using MixReader = MixStreamData::MixReader |
Definition at line 131 of file mix_stream.hpp.
using Writer = MixStreamData::Writer |
Definition at line 129 of file mix_stream.hpp.
|
explicit |
Definition at line 239 of file mix_stream.cpp.
~MixStream | ( | ) |
When the user handle is destroyed, close the stream (but maybe not destroy the data object)
Definition at line 242 of file mix_stream.cpp.
References MixStream::ptr_.
|
finalvirtual |
Return stream data reference.
Implements Stream.
Definition at line 250 of file mix_stream.cpp.
References MixStream::ptr_.
|
finalvirtual |
Return stream data reference.
Implements Stream.
Definition at line 254 of file mix_stream.cpp.
References MixStream::ptr_.
MixStream::MixReader GetMixReader | ( | bool | consume | ) |
Creates a BlockReader which concatenates items from all workers in an arbitrary order.
Definition at line 262 of file mix_stream.cpp.
References MixStream::ptr_.
MixStream::MixReader GetReader | ( | bool | consume | ) |
Open a MixReader (function name matches a method in File and CatStream).
Definition at line 266 of file mix_stream.cpp.
References MixStream::ptr_.
|
virtual |
Creates BlockWriters for each worker. BlockWriter can only be opened once, otherwise the block sequence is incorrectly interleaved!
Implements Stream.
Definition at line 258 of file mix_stream.cpp.
References MixStream::ptr_.
|
finalvirtual |
Return stream id.
Implements Stream.
Definition at line 246 of file mix_stream.cpp.
References MixStream::ptr_.
|
private |
Definition at line 160 of file mix_stream.hpp.
Referenced by MixStream::data(), MixStream::GetMixReader(), MixStream::GetReader(), MixStream::GetWriters(), MixStream::id(), and MixStream::~MixStream().