Thrill  0.1
MixStream Class Referencefinal

Detailed Description

Ownership handle onto a MixStream.

Definition at line 126 of file mix_stream.hpp.

+ Inheritance diagram for MixStream:
+ Collaboration diagram for MixStream:

#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 ()
 
StreamDatadata () final
 Return stream data reference. More...
 
const StreamDatadata () 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 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

MixStreamDataPtr ptr_
 

Member Typedef Documentation

◆ MixReader

Definition at line 131 of file mix_stream.hpp.

◆ Writer

Definition at line 129 of file mix_stream.hpp.

Constructor & Destructor Documentation

◆ MixStream()

MixStream ( const MixStreamDataPtr ptr)
explicit

Definition at line 239 of file mix_stream.cpp.

◆ ~MixStream()

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

Member Function Documentation

◆ data() [1/2]

StreamData & data ( )
finalvirtual

Return stream data reference.

Implements Stream.

Definition at line 250 of file mix_stream.cpp.

References MixStream::ptr_.

◆ data() [2/2]

const StreamData & data ( ) const
finalvirtual

Return stream data reference.

Implements Stream.

Definition at line 254 of file mix_stream.cpp.

References MixStream::ptr_.

◆ GetMixReader()

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

◆ GetReader()

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

◆ GetWriters()

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

◆ id()

const StreamId & id ( ) const
finalvirtual

Return stream id.

Implements Stream.

Definition at line 246 of file mix_stream.cpp.

References MixStream::ptr_.

Member Data Documentation

◆ ptr_


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