SST::Output Class Reference

Output object provides consistant method for outputing data to stdout, stderr and/or sst debug file. More...

#include <output.h>

Public Types

enum  output_location_t { NONE, STDOUT, STDERR, FILE }
 

Choice of output location.

More...

Public Member Functions

 Output (const std::string &prefix, uint32_t verbose_level, uint32_t verbose_mask, output_location_t location, std::string localoutputfilename="")
 Constructor.
 Output ()
 Default Constructor.
void init (const std::string &prefix, uint32_t verbose_level, uint32_t verbose_mask, output_location_t location, std::string localoutputfilename="")
 Initialize the object after construction.
void output (uint32_t line, const char *file, const char *func, const char *format,...) const
 Output the message with formatting as specified by the format parameter.
void output (const char *format,...) const
 Output the message with formatting as specified by the format parameter.
void verbose (uint32_t line, const char *file, const char *func, uint32_t output_level, uint32_t output_bits, const char *format,...) const
 Output the verbose message with formatting as specified by the format parameter.
void verbosePrefix (const char *tempPrefix, uint32_t line, const char *file, const char *func, uint32_t output_level, uint32_t output_bits, const char *format,...)
 Output the verbose message with formatting as specified by the format parameter.
void debug (uint32_t line, const char *file, const char *func, uint32_t output_level, uint32_t output_bits, const char *format,...) const
 Output the debug message with formatting as specified by the format parameter.
void fatal (uint32_t line, const char *file, const char *func, uint32_t exit_code, const char *format,...) const
 Output the fatal message with formatting as specified by the format parameter.
void setPrefix (const std::string &prefix)
 Sets object prefix.
std::string getPrefix () const
 Returns object prefix.
void setVerboseMask (uint32_t verbose_mask)
 Sets object verbose mask.
uint32_t getVerboseMask () const
 Returns object verbose mask.
void setVerboseLevel (uint32_t verbose_level)
 Sets object verbose level.
uint32_t getVerboseLevel () const
 Returns object verbose level.
void setOutputLocation (output_location_t location)
 Sets object output location.
output_location_t getOutputLocation () const
 Returns object output location.
void flush () const
 This method allows for the manual flushing of the output.

Static Public Member Functions

static void setFileName (const std::string &filename)
 This method sets the static filename used by SST.

Friends

class boost::serialization::access

Detailed Description

Output object provides consistant method for outputing data to stdout, stderr and/or sst debug file.

All components should use this class to log any information.


Member Enumeration Documentation

Choice of output location.

Enumerator:
NONE 

No output

STDOUT 

Print to stdout

STDERR 

Print to stderr

FILE 

Print to a file


Constructor & Destructor Documentation

SST::Output::Output ( const std::string &  prefix,
uint32_t  verbose_level,
uint32_t  verbose_mask,
output_location_t  location,
std::string  localoutputfilename = "" 
)

Constructor.

Set up output configuration.

Parameters:
prefix Prefix to be prepended to all strings emitted by calls to debug(), verbose(), fatal() and possibly output(). NOTE: No space will be inserted between the prepended prefix string and the normal output string. Prefix can contain the following escape codes:

  • @f Name of the file in which output call was made.
  • @l Line number in the file in which output call was made.
  • @p Name of the function from which output call was made.
  • @r MPI rank of the calling process. Will be empty if MPI_COMM_WORLD size is 1.
  • @R MPI rank of the calling process. Will be 0 if MPI_COMM_WORLD size is 1.
  • @t Simulation time. Will be the raw simulaton cycle time retrieved from the SST Core.
verbose_level Debugging output level. Calls to debug(), verbose() and fatal() are only output if their output_level parameter is less than or equal to the verbose_level currently set for the object
verbose_mask Bitmask of allowed message types for debug(), verbose() and fatal(). The Output object will only output the message if the set bits of the output_bits parameter are set in the verbose_mask of the object. It uses this logic: if (~verbose_mask & output_bits == 0) then output is enabled.
location Output location. Ouput will be directed to STDOUT, STDERR, FILE, or NONE. If FILE output is selected, the output will be directed to the file defined by the --debug runtime parameter, or to the file 'sst_output' if the --debug parameter is not defined. If the size of MPI_COMM_WORLD is > 1, then the rank process will be appended to the file name.
localoutputfilename. Send the output of this class to the file identified in localoutputfilename instead of the of the normal output file set by the run time parameter --debug-file. location parameter must be set to FILE. This parameter is intended for special case debug purposes only.

References init().

SST::Output::Output (  ) 

Default Constructor.

User must call init() to properly initialize obj. Until init() is called, no output will occur.

References NONE.


Member Function Documentation

void SST::Output::debug ( uint32_t  line,
const char *  file,
const char *  func,
uint32_t  output_level,
uint32_t  output_bits,
const char *  format,
  ... 
) const [inline]

Output the debug message with formatting as specified by the format parameter.

Output will only occur if specified output_level and output_bits meet criteria defined by object. The output will be prepended with the expanded prefix set in the object. NOTE: Debug ouputs will only occur if the __SST_DEBUG_OUTPUT__ is defined. this define can be set in source code or by setting the --enable-debug option during SST configuration.

Parameters:
line Line number of calling function (use CALL_INFO macro)
file File name calling function (use CALL_INFO macro)
func Function name calling function (use CALL_INFO macro)
output_level For output to occur, output_level must be less than or equal to verbose_level set in object
output_bits The Output object will only output the message if the set bits of the output_bits parameter are set in the verbose_mask of the object. It uses this logic: if (~verbose_mask & output_bits == 0) then output is enabled.
format Format string. All valid formats for printf are available.
... Arguments for format.

References NONE.

void SST::Output::fatal ( uint32_t  line,
const char *  file,
const char *  func,
uint32_t  exit_code,
const char *  format,
  ... 
) const

Output the fatal message with formatting as specified by the format parameter.

Message will be sent to the output location and to stderr. The output will be prepended with the expanded prefix set in the object. NOTE: fatal() will call MPI_Abort(exit_code) to terminate simulation.

Parameters:
line Line number of calling function (use CALL_INFO macro)
file File name calling function (use CALL_INFO macro)
func Function name calling function (use CALL_INFO macro)
exit_code The exit code used for termination of simuation. will be passed to MPI_Abort()
format Format string. All valid formats for printf are available.
... Arguments for format.

References flush(), SST::Simulation::getSimulation(), NONE, and STDERR.

Referenced by SST::Factory::CreateComponent(), SST::Factory::CreateCoreModule(), SST::Factory::CreateCoreModuleWithComponent(), SST::Factory::CreateIntrospector(), SST::Factory::CreateModule(), SST::Factory::CreateModuleWithComponent(), SST::Factory::CreateSubComponent(), SST::Factory::DoesComponentInfoStatisticNameExist(), SST::Factory::DoesSubComponentInfoStatisticNameExist(), SST::Factory::GetComponentAllowedPorts(), SST::Factory::GetComponentInfoStatisticEnableLevel(), SST::Factory::GetComponentInfoStatisticUnits(), SST::Factory::GetGenerator(), SST::Simulation::getNextClockCycle(), SST::Factory::GetPartitioner(), SST::TimeLord::getTimeConverter(), SST::UnitAlgebra::operator<(), SST::UnitAlgebra::operator<=(), SST::UnitAlgebra::operator>(), SST::UnitAlgebra::operator>=(), SST::Simulation::performWireUp(), SST::Exit::refDec(), SST::Factory::RequireEvent(), SST::Simulation::reregisterClock(), SST::Link::send(), SST::Statistics::StatisticOutputTxt::startOfSimulation(), and SST::Statistics::StatisticOutputCSV::startOfSimulation().

void SST::Output::flush (  )  const [inline]

This method allows for the manual flushing of the output.

Referenced by fatal().

void SST::Output::init ( const std::string &  prefix,
uint32_t  verbose_level,
uint32_t  verbose_mask,
output_location_t  location,
std::string  localoutputfilename = "" 
)

Initialize the object after construction.

Parameters:
prefix Prefix to be prepended to all strings emitted by calls to debug(), verbose(), fatal() and possibly output(). NOTE: No space will be inserted between the prepended prefix string and the normal output string. Prefix can contain the following escape codes:

  • @f Name of the file in which output call was made.
  • @l Line number in the file in which output call was made.
  • @p Name of the function from which output call was made.
  • @r MPI rank of the calling process. Will be empty if MPI_COMM_WORLD size is 1.
  • @R MPI rank of the calling process. Will be 0 if MPI_COMM_WORLD size is 1.
  • @t Simulation time. Will be the raw simulaton cycle time retrieved from the SST Core.
verbose_level Debugging output level. Calls to debug(), verbose() and fatal() are only output if their output_level parameter is less than or equal to the verbose_level currently set for the object
verbose_mask Bitmask of allowed message types for debug(), verbose() and fatal(). The Output object will only output the message if the set bits of the output_bits parameter are set in the verbose_mask of the object. It uses this logic: if (~verbose_mask & output_bits == 0) then output is enabled.
location Output location. Ouput will be directed to STDOUT, STDERR, FILE, or NONE. If FILE output is selected, the output will be directed to the file defined by the --debug runtime parameter, or to the file 'sst_output' if the --debug parameter is not defined. If the size of MPI_COMM_WORLD is > 1, then the rank process will be appended to the file name.
localoutputfilename. Send the output of this class to the file identified in localoutputfilename instead of the of the normal output file set by the run time parameter --debug-file. location parameter must be set to FILE. This parameter is intended for special case debug purposes only.

Referenced by Output().

void SST::Output::output ( const char *  format,
  ... 
) const [inline]

Output the message with formatting as specified by the format parameter.

Parameters:
format Format string. All valid formats for printf are available.
... Arguments for format.

References NONE.

void SST::Output::output ( uint32_t  line,
const char *  file,
const char *  func,
const char *  format,
  ... 
) const [inline]

Output the message with formatting as specified by the format parameter.

The output will be prepended with the expanded prefix set in the object.

Parameters:
line Line number of calling function (use CALL_INFO macro)
file File name calling function (use CALL_INFO macro)
func Function name calling function (use CALL_INFO macro)
format Format string. All valid formats for printf are available.
... Argument strings for format.

References NONE.

Referenced by SST::ConfigGraph::checkForStructuralErrors(), SST::Simulation::performWireUp(), SST::TimeVortex::print(), SST::SyncBase::print(), SST::StopAction::print(), SST::OneShot::print(), SST::Exit::print(), SST::NullEvent::print(), SST::Event::print(), SST::Clock::print(), SST::Activity::print(), SST::Action::print(), SST::Simulation::printStatus(), SST::Statistics::StatisticOutputTxt::printUsage(), SST::Statistics::StatisticOutputCSV::printUsage(), SST::Statistics::StatisticOutputConsole::printUsage(), and SST::Params::verifyParam().

void SST::Output::setFileName ( const std::string &  filename  )  [static]

This method sets the static filename used by SST.

It can only be called once, and is automatically called by the SST Core. No components should call this method.

Referenced by SST::Config::parseCmdLine().

void SST::Output::setOutputLocation ( output_location_t  location  ) 

Sets object output location.

Parameters:
location Output location. Ouput will be directed to STDOUT, STDERR, FILE, or NONE. If FILE output is selected, the output will be directed to the file defined by the --debug runtime parameter, or to the file 'sst_output' if the --debug parameter is not defined. If the size of MPI_COMM_WORLD is > 1, then the rank process will be appended to the file name.
void SST::Output::setPrefix ( const std::string &  prefix  ) 

Sets object prefix.

Parameters:
prefix Prefix to be prepended to all strings emitted by calls to debug(), verbose(), fatal() and possibly output(). NOTE: No space will be inserted between the prepended prefix string and the normal output string. Prefix can contain the following escape codes:

  • @f Name of the file in which output call was made.
  • @l Line number in the file in which output call was made.
  • @p Name of the function from which output call was made.
  • @r MPI rank of the calling process. Will be empty if MPI_COMM_WORLD size is 1.
  • @R MPI rank of the calling process. Will be 0 if MPI_COMM_WORLD size is 1.
  • @t Simulation time. Will be the raw simulaton cycle time retrieved from the SST Core.
void SST::Output::setVerboseLevel ( uint32_t  verbose_level  ) 

Sets object verbose level.

Parameters:
verbose_level Debugging output level. Calls to debug(), verbose() and fatal() are only output if their output_level parameter is less than or equal to the verbose_level currently set for the object
void SST::Output::setVerboseMask ( uint32_t  verbose_mask  ) 

Sets object verbose mask.

Parameters:
verbose_mask Bitmask of allowed message types for debug(), verbose() and fatal(). The Output object will only output the message if the set bits of the output_bits parameter are set in the verbose_mask of the object. It uses this logic: if (~verbose_mask & output_bits == 0) then output is enabled.
void SST::Output::verbose ( uint32_t  line,
const char *  file,
const char *  func,
uint32_t  output_level,
uint32_t  output_bits,
const char *  format,
  ... 
) const [inline]

Output the verbose message with formatting as specified by the format parameter.

Output will only occur if specified output_level and output_bits meet criteria defined by object. The output will be prepended with the expanded prefix set in the object.

Parameters:
line Line number of calling function (use CALL_INFO macro)
file File name calling function (use CALL_INFO macro)
func Function name calling function (use CALL_INFO macro)
output_level For output to occur, output_level must be less than or equal to verbose_level set in object
output_bits The Output object will only output the message if the set bits of the output_bits parameter are set in the verbose_mask of the object. It uses this logic: if (~verbose_mask & output_bits == 0) then output is enabled.
format Format string. All valid formats for printf are available.
... Arguments for format.

References NONE.

Referenced by SST::Partition::SSTLinearPartition::performPartition(), SST::Exit::refDec(), SST::Statistics::StatisticOutputConsole::StatisticOutputConsole(), SST::Statistics::StatisticOutputCSV::StatisticOutputCSV(), and SST::Statistics::StatisticOutputTxt::StatisticOutputTxt().

void SST::Output::verbosePrefix ( const char *  tempPrefix,
uint32_t  line,
const char *  file,
const char *  func,
uint32_t  output_level,
uint32_t  output_bits,
const char *  format,
  ... 
) [inline]

Output the verbose message with formatting as specified by the format parameter.

Output will only occur if specified output_level and output_bits meet criteria defined by object. The output will be prepended with the expanded prefix set in the object.

Parameters:
tempPrefix For just this call use this prefix
line Line number of calling function (use CALL_INFO macro)
file File name calling function (use CALL_INFO macro)
func Function name calling function (use CALL_INFO macro)
output_level For output to occur, output_level must be less than or equal to verbose_level set in object
output_bits The Output object will only output the message if the set bits of the output_bits parameter are set in the verbose_mask of the object. It uses this logic: if (~verbose_mask & output_bits == 0) then output is enabled.
format Format string. All valid formats for printf are available.
... Arguments for format.

References NONE.


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

Generated on 14 Sep 2015 for SST by  doxygen 1.6.1