Thrill
0.1
|
Ownership handle onto a CatStreamData.
Definition at line 155 of file cat_stream.hpp.
#include <cat_stream.hpp>
Public Types | |
using | CatReader = CatStreamData::CatReader |
using | Reader = CatStreamData::Reader |
using | Writer = CatStreamData::Writer |
Public Types inherited from Stream | |
using | Writer = StreamData::Writer |
using | Writers = StreamData::Writers |
Public Member Functions | |
CatStream (const CatStreamDataPtr &ptr) | |
~CatStream () | |
StreamData & | data () final |
Return stream data reference. More... | |
const StreamData & | data () const final |
Return stream data reference. More... | |
CatReader | GetCatReader (bool consume) |
CatReader | GetReader (bool consume) |
Open a CatReader (function name matches a method in File and MixStream). More... | |
std::vector< Reader > | GetReaders () |
Writers | GetWriters () final |
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 | |
CatStreamDataPtr | ptr_ |
using CatReader = CatStreamData::CatReader |
Definition at line 161 of file cat_stream.hpp.
using Reader = CatStreamData::Reader |
Definition at line 159 of file cat_stream.hpp.
using Writer = CatStreamData::Writer |
Definition at line 158 of file cat_stream.hpp.
|
explicit |
Definition at line 326 of file cat_stream.cpp.
~CatStream | ( | ) |
When the user handle is destroyed, close the stream (but maybe not destroy the data object)
Definition at line 329 of file cat_stream.cpp.
References CatStream::ptr_.
|
finalvirtual |
Return stream data reference.
Implements Stream.
Definition at line 337 of file cat_stream.cpp.
References CatStream::ptr_.
|
finalvirtual |
Return stream data reference.
Implements Stream.
Definition at line 341 of file cat_stream.cpp.
References CatStream::ptr_.
CatStream::CatReader GetCatReader | ( | bool | consume | ) |
Creates a BlockReader which concatenates items from all workers in worker rank order. The BlockReader is attached to one CatBlockSource which includes all incoming queues of this stream.
Definition at line 353 of file cat_stream.cpp.
References CatStream::ptr_.
CatStream::CatReader GetReader | ( | bool | consume | ) |
Open a CatReader (function name matches a method in File and MixStream).
Definition at line 357 of file cat_stream.cpp.
References CatStream::ptr_.
std::vector< CatStream::Reader > GetReaders | ( | ) |
Creates a BlockReader for each worker. The BlockReaders are attached to the BlockQueues in the Stream and wait for further Blocks to arrive or the Stream's remote close. These Readers always consume!
Definition at line 349 of file cat_stream.cpp.
References CatStream::ptr_.
|
finalvirtual |
Creates BlockWriters for each worker. BlockWriter can only be opened once, otherwise the block sequence is incorrectly interleaved!
Implements Stream.
Definition at line 345 of file cat_stream.cpp.
References CatStream::ptr_.
|
finalvirtual |
Return stream id.
Implements Stream.
Definition at line 333 of file cat_stream.cpp.
References CatStream::ptr_.
|
private |
Definition at line 195 of file cat_stream.hpp.
Referenced by CatStream::data(), CatStream::GetCatReader(), CatStream::GetReader(), CatStream::GetReaders(), CatStream::GetWriters(), CatStream::id(), and CatStream::~CatStream().