MAIA bb96820c
Multiphysics at AIA
|
Class to create an output stream that writes to cout or cerr but prepends each line with the MPI rank. More...
#include <infoout.h>
Public Member Functions | |
InfoOutStream () | |
Default construtor creates InfoOutStream that is not (yet) usable. More... | |
InfoOutStream (std::ostream *os, MPI_Comm mpiComm=MPI_COMM_WORLD, MBool printDomainId=true) | |
Constructor creates InfoOut_streamBuffer buffer and calls ostream constructor with reference to it. More... | |
~InfoOutStream () | |
Destructor deletes the internal buffer object. More... | |
void | initialize (std::ostream *os, MPI_Comm mpiComm=MPI_COMM_WORLD, MBool printDomainId=true) |
Passes the parameters to a call of InfoOut_streamBuffer::initialize(). More... | |
MBool | setRootOnly (MBool rootOnly=true) |
Sets interal state of whether only the root domain (rank 0) should write to file. Author Michael Schlottke. More... | |
Public Member Functions inherited from InfoOut | |
InfoOut () | |
virtual MBool | setRootOnly (MBool rootOnly=true)=0 |
MInt | addAttribute (std::pair< MString, MString >) |
Adds an attribute to the prefix of the XML string. More... | |
void | eraseAttribute (MInt) |
Erases an attribute from the prefix of the XML string. More... | |
void | modifyAttribute (MInt, std::pair< MString, MString >) |
Modifies an attribute of the prefix of the XML string. More... | |
Private Attributes | |
MBool | m_isInitialized |
Stores whether a stream was already opened or not. More... | |
Additional Inherited Members | |
Protected Attributes inherited from InfoOut | |
InfoOut_buffer * | m_buffer = nullptr |
This class can be used to write to an already existing output stream. The usage and behavior is just like with existing C++ output streams such as cout/cerr, except that it offers the possibility to prepend each line with information about the current MPI domain id. In future implementations it might be worth considering to add even more information to each message.
InfoOutStream::InfoOutStream | ( | ) |
When this constructor is used, initialize() needs to be called before the stream can be used.
Definition at line 1070 of file infoout.cpp.
InfoOutStream::InfoOutStream | ( | std::ostream * | os, |
MPI_Comm | mpiComm = MPI_COMM_WORLD , |
||
MBool | printDomainId = true |
||
) |
When this constructor is used, the stream is immediately ready to use. For information about the paramters, please have a look at InfoOut_streamBuffer::initialize.
[in] | os | Output stream that should be used for output. |
[in] | mpiComm | MPI communicator for which the domain information should be gathered. |
[in] | printDomainId | Determines whether the domain id should be prepended to each message. |
Definition at line 1085 of file infoout.cpp.
InfoOutStream::~InfoOutStream | ( | ) |
void InfoOutStream::initialize | ( | std::ostream * | os, |
MPI_Comm | mpiComm = MPI_COMM_WORLD , |
||
MBool | printDomainId = true |
||
) |
[in] | os | Output stream that should be used for output. |
[in] | mpiComm | MPI communicator for which the domain information should be gathered. |
[in] | printDomainId | Determines whether the domain id should be prepended to each message. |
Definition at line 1112 of file infoout.cpp.
\params[in] rootOnly If true, only rank 0 of the specified MPI communicator writes to file.
Implements InfoOut.
Definition at line 1132 of file infoout.cpp.