![]() |
Rosetta
2021.16
|
#include <mpistream.hh>

Public Types | |
| typedef basic_mpi_ostreambase < Elem, Tr, ElemA, ByteT, ByteAT > | mpi_ostreambase_type |
| typedef std::basic_ostream < Elem, Tr > | ostream_type |
| typedef std::basic_ostream < Elem, Tr > & | ostream_reference |
| typedef Elem | char_type |
Public Types inherited from utility::io::mpi_stream::basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT > | |
| typedef std::basic_ostream < Elem, Tr > & | ostream_reference |
| typedef basic_mpi_streambuf < Elem, Tr, ElemA, ByteT, ByteAT > | mpi_streambuf_type |
Public Member Functions | |
| basic_mpi_ostream (std::string filename, int master_rank, std::stringstream &header, bool append=false, std::size_t buffer_size_=default_buffer_size) | |
| Constructs a mpiper ostream decorator. More... | |
| void | close () |
| ~basic_mpi_ostream () override | |
| template<typename T > | |
| basic_mpi_ostream & | operator<< (T const &t) |
| stream output More... | |
| basic_mpi_ostream & | put (char const c) |
| write char More... | |
| basic_mpi_ostream & | write (char const *str, std::streamsize const count) |
| write a string More... | |
| basic_mpi_ostream & | flush () |
Public Member Functions inherited from utility::io::mpi_stream::basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT > | |
| basic_mpi_ostreambase (std::string filename, size_t buffer_size_, int master_rank, bool append) | |
| Construct a mpi stream. More... | |
| mpi_streambuf_type * | rdbuf () |
| returns the underlying mpi ostream object More... | |
| int | file_status () const |
| void | release_file () |
| void | print_header (std::string const &header) |
Static Private Member Functions | |
| static void | put_long_as_uint32 (ostream_reference out_, unsigned long x_) |
Private Attributes | |
| bool | m_mpi_stream_finalized |
| tracks to see if mpi stream was finalized More... | |
A mpiper ostream.
This class is a ostream decorator that behaves 'almost' like any other ostream.
At construction, it takes any ostream that shall be used to output of the compressed data.
When finished, you need to call the special method zflush or call the destructor to flush all the intermidiate streams.
Example:
| typedef Elem utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::char_type |
| typedef basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT > utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::mpi_ostreambase_type |
| typedef std::basic_ostream< Elem, Tr >& utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::ostream_reference |
| typedef std::basic_ostream< Elem, Tr > utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::ostream_type |
|
inline |
Constructs a mpiper ostream decorator.
| ostream_ | ostream where the compressed output is written |
| is_gmpi_ | true if gmpi header and footer have to be added |
| level_ | level of compression 0, bad and fast, 9, good and slower, |
| strategy_ | compression strategy |
| window_size_ | see zlib doc |
| memory_level_ | see zlib doc |
| buffer_size_ | the buffer size used to mpi data |
References utility::io::mpi_stream::basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT >::file_status(), utility::io::mpi_stream::MPI_FAIL, utility::io::mpi_stream::MPI_SUCCESS_NEW, and utility::io::mpi_stream::basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT >::print_header().
|
inlineoverride |
|
inline |
|
inline |
|
inline |
stream output
if mpi stream has been finalized, will reset
the stream and add header if necessary
References basic::options::OptionKeys::in::file::t.
|
inline |
write char
if mpi stream has been finalized, will reset
the stream and add header if necessary
References utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::put().
Referenced by utility::io::ozstream::put(), and utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::put().
|
staticprivate |
|
inline |
write a string
if mpi stream has been finalized, will reset
the stream and add header if necessary
References utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::write().
Referenced by utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::put_long_as_uint32(), utility::io::ozstream::write(), and utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::write().
|
private |
tracks to see if mpi stream was finalized
set to true during zflush_finalize()
set to false during reset_state()
1.8.7