11#include <util/mpi/MpiSendRecv.h>
73 <<
"[ absent ]" << std::endl;
79 if (!hasIoCommunicator()) {
80 UTIL_THROW(
"Error: not isIoProcessor and not hasIoCommunicator");
83 UTIL_THROW(
"Error: not isIoProcessor and no MPI");
87 if (hasIoCommunicator()) {
92 bcast<bool>(ioCommunicator(),
isActive_, 0);
122 <<
"[ absent ]" << std::endl;
127 if (!hasIoCommunicator()) {
128 UTIL_THROW(
"Error: not isIoProcessor and !hasIoCommunicator");
131 UTIL_THROW(
"Error: not isIoProcessor and no MPI");
135 if (hasIoCommunicator()) {
139 bcast<bool>(ioCommunicator(),
isActive_, 0);
171 {
return label_.isRequired(); }
Label label_
Label object that contains parameter label string.
static bool isMatched()
Did the most recent attempt to match a Label succeed?
static std::ostream & file()
Get log ostream by reference.
bool isIoProcessor() const
Can this processor do file I/O ?
std::string indent() const
Return indent string for this object (string of spaces).
virtual void writeParam(std::ostream &out) const =0
Read parameter(s) to file.
static bool echo()
Get echo parameter.
virtual ~Parameter()
Destructor.
virtual void readLabel(std::istream &in)
Read and attempt to match label string.
std::string label() const
Return label string.
Parameter(const char *label, bool isRequired=true)
Constructor.
virtual void save(Serializable::OArchive &ar)
Save to an archive.
virtual void readValue(std::istream &in)
Read parameter value from an input stream.
virtual void saveValue(Serializable::OArchive &ar)
Save parameter value to an archive.
bool isActive_
Is this parameter active (always true if isRequired).
virtual void readParam(std::istream &in)
Read a label and (if the label matches) a parameter value.
virtual void loadValue(Serializable::IArchive &ar)
Load bare parameter value from an archive.
bool isRequired() const
Is this an optional parameter?
Label label_
Label object that contains parameter label string.
bool isActive() const
Is this parameter active?
static const int Width
Width of output field for a scalar variable.
virtual void load(Serializable::IArchive &ar)
Load from an archive.
BinaryFileIArchive IArchive
Type of input archive used by load method.
BinaryFileOArchive OArchive
Type of output archive used by save method.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Utility classes for scientific computation.