Rosetta  2020.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT > Class Template Reference

A stream decorator that takes raw input and zips it to a ostream. More...

#include <mpistream.hh>

Inheritance diagram for utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >:
Inheritance graph
[legend]

Public Types

typedef std::basic_streambuf
< Elem, Tr > 
basic_streambuf_type
 
typedef std::basic_ostream
< Elem, Tr > & 
ostream_reference
 
typedef Elem char_type
 
typedef ElemA char_allocator_type
 
typedef ByteT byte_type
 
typedef ByteAT byte_allocator_type
 
typedef byte_typebyte_buffer_type
 
typedef std::vector< byte_type,
byte_allocator_type
byte_vector_type
 
typedef std::vector< char_type,
char_allocator_type
char_vector_type
 
typedef Tr traits_type
 
typedef Tr::int_type int_type
 

Public Member Functions

 basic_mpi_streambuf (std::string filename, std::size_t buffer_size_, int master_rank_, bool append)
 Construct a mpi stream. More...
 
 ~basic_mpi_streambuf () override
 
int sync () override
 
int_type overflow (int_type c) override
 OVERFLOW. More...
 
virtual std::streamsize flush ()
 flushes the mpi buffer and output buffer More...
 
std::streamsize flush_final ()
 
void reset_state ()
 resets the mpi stream and zeros the crc More...
 
int file_status () const
 
void print_header (std::string const &)
 

Private Member Functions

std::streamsize flush (bool final)
 
bool send_to_master (char_type *, std::streamsize)
 +++ SEND_TO_MASTER ++++ More...
 
std::size_t fill_input_buffer ()
 

Private Attributes

char_vector_type m_buffer
 
int channel_id_
 
int my_rank_
 
int master_rank_
 
int file_status_
 

Detailed Description

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
class utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >

A stream decorator that takes raw input and zips it to a ostream.

Note
The class wraps up the inflate method of the zlib library 1.1.4 http://www.gzip.org/zlib/

Member Typedef Documentation

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef std::basic_streambuf< Elem, Tr > utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::basic_streambuf_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef ByteAT utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::byte_allocator_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef byte_type* utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::byte_buffer_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef ByteT utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::byte_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef std::vector< byte_type, byte_allocator_type > utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::byte_vector_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef ElemA utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::char_allocator_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef Elem utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::char_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef std::vector< char_type, char_allocator_type > utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::char_vector_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef Tr::int_type utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::int_type
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef std::basic_ostream< Elem, Tr >& utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::ostream_reference
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
typedef Tr utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::traits_type

Constructor & Destructor Documentation

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::basic_mpi_streambuf ( std::string  filename,
std::size_t  buffer_size_,
int  master_rank_,
bool  append 
)
template<typename Elem , typename Tr , typename ElemA , typename ByteT , typename ByteAT >
utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::~basic_mpi_streambuf ( )
override

Member Function Documentation

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
int utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::file_status ( ) const
inline
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
std::size_t utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::fill_input_buffer ( )
private
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
virtual std::streamsize utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::flush ( )
inlinevirtual
template<typename Elem , typename Tr , typename ElemA , typename ByteT , typename ByteAT >
std::streamsize utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::flush ( bool  final)
private
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
std::streamsize utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::flush_final ( )
inline
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::int_type utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::overflow ( int_type  c)
override

OVERFLOW.

References numeric::statistics::w().

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
void utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::print_header ( std::string const &  )
template<typename Elem , typename Tr , typename ElemA , typename ByteT , typename ByteAT >
void utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::reset_state ( )

resets the mpi stream and zeros the crc

This method should be called after flush_finalize() to allow future writes

References utility::io::oc::cout.

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
bool utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::send_to_master ( char_type ,
std::streamsize   
)
private
template<typename Elem , typename Tr , typename ElemA , typename ByteT , typename ByteAT >
int utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::sync ( )
override

Member Data Documentation

template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
int utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::channel_id_
private
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
int utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::file_status_
private
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
char_vector_type utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::m_buffer
private
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
int utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::master_rank_
private
template<typename Elem, typename Tr = std::char_traits< Elem >, typename ElemA = std::allocator< Elem >, typename ByteT = unsigned char, typename ByteAT = std::allocator< ByteT >>
int utility::io::mpi_stream::basic_mpi_streambuf< Elem, Tr, ElemA, ByteT, ByteAT >::my_rank_
private

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