Thrill  0.1
CatStream Class Referencefinal

Detailed Description

Ownership handle onto a CatStreamData.

Definition at line 155 of file cat_stream.hpp.

+ Inheritance diagram for CatStream:
+ Collaboration diagram for CatStream:

#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 ()
 
StreamDatadata () final
 Return stream data reference. More...
 
const StreamDatadata () 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< ReaderGetReaders ()
 
Writers GetWriters () final
 
const StreamIdid () 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...
 
ReferenceCounteroperator= (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_
 

Member Typedef Documentation

◆ CatReader

Definition at line 161 of file cat_stream.hpp.

◆ Reader

Definition at line 159 of file cat_stream.hpp.

◆ Writer

Definition at line 158 of file cat_stream.hpp.

Constructor & Destructor Documentation

◆ CatStream()

CatStream ( const CatStreamDataPtr ptr)
explicit

Definition at line 326 of file cat_stream.cpp.

◆ ~CatStream()

~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_.

Member Function Documentation

◆ data() [1/2]

StreamData & data ( )
finalvirtual

Return stream data reference.

Implements Stream.

Definition at line 337 of file cat_stream.cpp.

References CatStream::ptr_.

◆ data() [2/2]

const StreamData & data ( ) const
finalvirtual

Return stream data reference.

Implements Stream.

Definition at line 341 of file cat_stream.cpp.

References CatStream::ptr_.

◆ GetCatReader()

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_.

◆ GetReader()

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_.

◆ GetReaders()

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_.

◆ GetWriters()

CatStream::Writers GetWriters ( )
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_.

◆ id()

const StreamId & id ( ) const
finalvirtual

Return stream id.

Implements Stream.

Definition at line 333 of file cat_stream.cpp.

References CatStream::ptr_.

Member Data Documentation

◆ ptr_


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