SST  11.1.0
StructuralSimulationToolkit
output.h
1 // Copyright 2009-2021 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2021, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SST_CORE_OUTPUT_H
13 #define SST_CORE_OUTPUT_H
14 
15 #include <string.h>
16 
17 // UNCOMMENT OUT THIS LINE TO ENABLE THE DEBUG METHOD -OR_
18 // CHOOSE THE --enable-debug OPTION DURING SST CONFIGURATION
19 //#define __SST_DEBUG_OUTPUT__
20 
21 // This must be defined before inclusion of intttypes.h
22 #ifndef __STDC_FORMAT_MACROS
23 #define __STDC_FORMAT_MACROS
24 #endif
25 #include "sst/core/rankInfo.h"
26 
27 #include <cinttypes>
28 #include <cstdio>
29 #include <stdarg.h>
30 #include <thread>
31 #include <unordered_map>
32 
33 extern int main(int argc, char** argv);
34 
35 namespace SST {
36 
37 // MACROS TO HELP BUILD THE CALLING FUNCTIONS INFORMATION
38 #define CALL_INFO __LINE__, __FILE__, __FUNCTION__
39 
40 #if defined(__GNUC__) || defined(__clang__)
41 #define CALL_INFO_LONG __LINE__, __FILE__, __PRETTY_FUNCTION__
42 #else
43 #define CALL_INFO_LONG __LINE__, __FILE__, __FUNCTION__
44 #endif
45 
46 /**
47  * Output object provides consistent method for outputting data to
48  * stdout, stderr and/or sst debug file. All components should
49  * use this class to log any information.
50  */
51 class Output
52 {
53 public:
54  /** Choice of output location
55  */
57  NONE, /*!< No output */
58  STDOUT, /*!< Print to stdout */
59  STDERR, /*!< Print to stderr */
60  FILE /*!< Print to a file */
61  };
62 
63  static constexpr uint32_t PrintAll = std::numeric_limits<uint32_t>::max();
64 
65  /** Constructor. Set up output configuration.
66  @param prefix Prefix to be prepended to all strings emitted by calls to
67  debug(), verbose(), fatal() and possibly output().
68  NOTE: No space will be inserted between the prepended prefix
69  string and the normal output string.
70  Prefix can contain the following escape codes:
71  - \@f Name of the file in which output call was made.
72  - \@l Line number in the file in which output call was made.
73  - \@p Name of the function from which output call was made.
74  - \@r MPI rank of the calling process. Will be empty if
75  MPI_COMM_WORLD size is 1.
76  - \@R MPI rank of the calling process. Will be 0 if
77  MPI_COMM_WORLD size is 1.
78  - \@i Thread Id of the calling process. Will be empty if
79  number of threads is 1.
80  - \@I Thread Id of the calling process. Will be 0 if
81  number of threads is 1.
82  - \@x Rank information of the calling process. Will be empty if
83  number of MPI ranks and number of threads are both 1
84  Same as [\@r:\@i]
85  - \@X Rank information of the calling process. Will be [0.0] if
86  number of MPI ranks and number of threads are both 1
87  Same as [\@R:\@I]
88  - \@t Simulation time. Will be the raw simulation cycle time
89  retrieved from the SST Core.
90  @param verbose_level Debugging output level. Calls to debug(),
91  verbose() and fatal() are only output if their output_level
92  parameter is less than or equal to the verbose_level currently
93  set for the object
94  @param verbose_mask Bitmask of allowed message types for debug(),
95  verbose() and fatal(). The Output object will only output the
96  message if the set bits of the output_bits parameter
97  are set in the verbose_mask of the object. It uses this logic:
98  if (~verbose_mask & output_bits == 0) then output is enabled.
99  @param location Output location. Output will be directed to STDOUT,
100  STDERR, FILE, or NONE. If FILE output is selected, the
101  output will be directed to the file defined by the
102  --debug runtime parameter, or to the file 'sst_output' if the
103  --debug parameter is not defined. If the size of MPI_COMM_WORLD
104  is > 1, then the rank process will be appended to the file name.
105  @param localoutputfilename. Send the output of this class to the
106  file identified in localoutputfilename instead of the of the
107  normal output file set by the run time parameter --debug-file.
108  location parameter must be set to FILE. This parameter is
109  intended for special case debug purposes only.
110  */
111  // CONSTRUCTION / DESTRUCTION
112  Output(
113  const std::string& prefix, uint32_t verbose_level, uint32_t verbose_mask, output_location_t location,
114  const std::string& localoutputfilename = "");
115 
116  /** Default Constructor. User must call init() to properly initialize obj.
117  Until init() is called, no output will occur.
118  */
119  Output(); // Default constructor
120 
121  virtual ~Output();
122 
123  /** Initialize the object after construction
124  @param prefix Prefix to be prepended to all strings emitted by calls to
125  debug(), verbose(), fatal() and possibly output().
126  NOTE: No space will be inserted between the prepended prefix
127  string and the normal output string.
128  Prefix can contain the following escape codes:
129  - \@f Name of the file in which output call was made.
130  - \@l Line number in the file in which output call was made.
131  - \@p Name of the function from which output call was made.
132  - \@r MPI rank of the calling process. Will be empty if
133  MPI_COMM_WORLD size is 1.
134  - \@R MPI rank of the calling process. Will be 0 if
135  MPI_COMM_WORLD size is 1.
136  - \@i Thread Id of the calling process. Will be empty if
137  number of threads is 1.
138  - \@I Thread Id of the calling process. Will be 0 if
139  number of threads is 1.
140  - \@x Rank information of the calling process. Will be empty if
141  number of MPI ranks and number of threads are both 1
142  Same as [\@r:\@i]
143  - \@X Rank information of the calling process. Will be [0.0] if
144  number of MPI ranks and number of threads are both 1
145  Same as [\@R:\@I]
146  - \@t Simulation time. Will be the raw simulation cycle time
147  retrieved from the SST Core.
148  @param verbose_level Debugging output level. Calls to debug(),
149  verbose() and fatal() are only output if their output_level
150  parameter is less than or equal to the verbose_level currently
151  set for the object
152  @param verbose_mask Bitmask of allowed message types for debug(),
153  verbose() and fatal(). The Output object will only output the
154  message if the set bits of the output_bits parameter
155  are set in the verbose_mask of the object. It uses this logic:
156  if (~verbose_mask & output_bits == 0) then output is enabled.
157  @param location Output location. Output will be directed to STDOUT,
158  STDERR, FILE, or NONE. If FILE output is selected, the
159  output will be directed to the file defined by the
160  --debug runtime parameter, or to the file 'sst_output' if the
161  --debug parameter is not defined. If the size of MPI_COMM_WORLD
162  is > 1, then the rank process will be appended to the file name.
163  @param localoutputfilename. Send the output of this class to the
164  file identified in localoutputfilename instead of the of the
165  normal output file set by the run time parameter --debug-file.
166  location parameter must be set to FILE. This parameter is
167  intended for special case debug purposes only.
168  */
169  // INITIALIZATION
170  void init(
171  const std::string& prefix, uint32_t verbose_level, uint32_t verbose_mask, output_location_t location,
172  const std::string& localoutputfilename = "");
173 
174  /** Output the message with formatting as specified by the format parameter.
175  The output will be prepended with the expanded prefix set in the object.
176  @param line Line number of calling function (use CALL_INFO macro)
177  @param file File name calling function (use CALL_INFO macro)
178  @param func Function name calling function (use CALL_INFO macro)
179  @param format Format string. All valid formats for printf are available.
180  @param ... Argument strings for format.
181  */
182  void output(uint32_t line, const char* file, const char* func, const char* format, ...) const
183  __attribute__((format(printf, 5, 6)))
184  {
185  va_list arg;
186  if ( true == m_objInitialized && NONE != m_targetLoc ) {
187  // Get the argument list and then print it out
188  va_start(arg, format);
189  outputprintf(line, file, func, format, arg);
190  va_end(arg);
191  }
192  }
193 
194  /** Output the message with formatting as specified by the format parameter.
195  @param format Format string. All valid formats for printf are available.
196  @param ... Arguments for format.
197  */
198  void output(const char* format, ...) const __attribute__((format(printf, 2, 3)))
199  {
200  va_list arg;
201  if ( true == m_objInitialized && NONE != m_targetLoc ) {
202  // Get the argument list and then print it out
203  va_start(arg, format);
204  outputprintf(format, arg);
205  va_end(arg);
206  }
207  }
208 
209  /** Output the verbose message with formatting as specified by the format
210  parameter. Output will only occur if specified output_level and
211  output_bits meet criteria defined by object. The output will be
212  prepended with the expanded prefix set in the object.
213  @param line Line number of calling function (use CALL_INFO macro)
214  @param file File name calling function (use CALL_INFO macro)
215  @param func Function name calling function (use CALL_INFO macro)
216  @param output_level For output to occur, output_level must be less than
217  or equal to verbose_level set in object
218  @param output_bits The Output object will only output the
219  message if the set bits of the output_bits parameter are set in
220  the verbose_mask of the object. It uses this logic:
221  if (~verbose_mask & output_bits == 0) then output is enabled.
222  @param format Format string. All valid formats for printf are available.
223  @param ... Arguments for format.
224  */
225  void verbose(
226  uint32_t line, const char* file, const char* func, uint32_t output_level, uint32_t output_bits,
227  const char* format, ...) const __attribute__((format(printf, 7, 8)))
228  {
229  va_list arg;
230 
231  if ( true == m_objInitialized && NONE != m_targetLoc ) {
232  // First check to see if we are allowed to send output based upon the
233  // verbose_mask and verbose_level checks
234  if ( ((output_bits & ~m_verboseMask) == 0) && (output_level <= m_verboseLevel) ) {
235  // Get the argument list and then print it out
236  va_start(arg, format);
237  outputprintf(line, file, func, format, arg);
238  va_end(arg);
239  }
240  }
241  }
242 
243  /** Output the verbose message with formatting as specified by the format
244  parameter. Output will only occur if specified output_level and
245  output_bits meet criteria defined by object. The output will be
246  prepended with the expanded prefix set in the object.
247  @param tempPrefix For just this call use this prefix
248  @param line Line number of calling function (use CALL_INFO macro)
249  @param file File name calling function (use CALL_INFO macro)
250  @param func Function name calling function (use CALL_INFO macro)
251  @param output_level For output to occur, output_level must be less than
252  or equal to verbose_level set in object
253  @param output_bits The Output object will only output the
254  message if the set bits of the output_bits parameter are set in
255  the verbose_mask of the object. It uses this logic:
256  if (~verbose_mask & output_bits == 0) then output is enabled.
257  @param format Format string. All valid formats for printf are available.
258  @param ... Arguments for format.
259  */
261  const char* tempPrefix, uint32_t line, const char* file, const char* func, uint32_t output_level,
262  uint32_t output_bits, const char* format, ...) __attribute__((format(printf, 8, 9)))
263  {
264 
265  va_list arg;
266 
267  if ( true == m_objInitialized && NONE != m_targetLoc ) {
268  const std::string normalPrefix = m_outputPrefix;
269  m_outputPrefix = tempPrefix;
270 
271  // First check to see if we are allowed to send output based upon the
272  // verbose_mask and verbose_level checks
273  if ( ((output_bits & ~m_verboseMask) == 0) && (output_level <= m_verboseLevel) ) {
274  // Get the argument list and then print it out
275  va_start(arg, format);
276  outputprintf(line, file, func, format, arg);
277  va_end(arg);
278  }
279 
280  m_outputPrefix = normalPrefix;
281  }
282  }
283 
284  /** Output the debug message with formatting as specified by the format
285  parameter. Output will only occur if specified output_level and
286  output_bits meet criteria defined by object. The output will be
287  prepended with the expanded prefix set in the object.
288  @param tempPrefix For just this call use this prefix
289  @param line Line number of calling function (use CALL_INFO macro)
290  @param file File name calling function (use CALL_INFO macro)
291  @param func Function name calling function (use CALL_INFO macro)
292  @param output_level For output to occur, output_level must be less than
293  or equal to verbose_level set in object
294  @param output_bits The Output object will only output the
295  message if the set bits of the output_bits parameter are set in
296  the verbose_mask of the object. It uses this logic:
297  if (~verbose_mask & output_bits == 0) then output is enabled.
298  @param format Format string. All valid formats for printf are available.
299  @param ... Arguments for format.
300  */
302  const char* tempPrefix, uint32_t line, const char* file, const char* func, uint32_t output_level,
303  uint32_t output_bits, const char* format, ...) __attribute__((format(printf, 8, 9)))
304  {
305 
306 #ifdef __SST_DEBUG_OUTPUT__
307  va_list arg;
308 
309  if ( true == m_objInitialized && NONE != m_targetLoc ) {
310  const std::string normalPrefix = m_outputPrefix;
311  m_outputPrefix = tempPrefix;
312 
313  // First check to see if we are allowed to send output based upon the
314  // verbose_mask and verbose_level checks
315  if ( ((output_bits & ~m_verboseMask) == 0) && (output_level <= m_verboseLevel) ) {
316  // Get the argument list and then print it out
317  va_start(arg, format);
318  outputprintf(line, file, func, format, arg);
319  va_end(arg);
320  }
321 
322  m_outputPrefix = normalPrefix;
323  }
324 #else
325  /* When debug is disabled, silence warnings of unused parameters */
326  (void)tempPrefix;
327  (void)line;
328  (void)file;
329  (void)func;
330  (void)output_level;
331  (void)output_bits;
332  (void)format;
333 #endif
334  }
335 
336  /** Output the debug message with formatting as specified by the format
337  parameter. Output will only occur if specified output_level and
338  output_bits meet criteria defined by object. The output will be
339  prepended with the expanded prefix set in the object.
340  NOTE: Debug outputs will only occur if the __SST_DEBUG_OUTPUT__ is defined.
341  this define can be set in source code or by setting the
342  --enable-debug option during SST configuration.
343  @param line Line number of calling function (use CALL_INFO macro)
344  @param file File name calling function (use CALL_INFO macro)
345  @param func Function name calling function (use CALL_INFO macro)
346  @param output_level For output to occur, output_level must be less than
347  or equal to verbose_level set in object
348  @param output_bits The Output object will only output the
349  message if the set bits of the output_bits parameter are set in
350  the verbose_mask of the object. It uses this logic:
351  if (~verbose_mask & output_bits == 0) then output is enabled.
352  @param format Format string. All valid formats for printf are available.
353  @param ... Arguments for format.
354  */
355  void debug(
356  uint32_t line, const char* file, const char* func, uint32_t output_level, uint32_t output_bits,
357  const char* format, ...) const __attribute__((format(printf, 7, 8)))
358  {
359 #ifdef __SST_DEBUG_OUTPUT__
360  va_list arg;
361  if ( true == m_objInitialized && NONE != m_targetLoc ) {
362  // First check to see if we are allowed to send output based upon the
363  // verbose_mask and verbose_level checks
364  if ( ((output_bits & ~m_verboseMask) == 0) && (output_level <= m_verboseLevel) ) {
365  // Get the argument list and then print it out
366  va_start(arg, format);
367  outputprintf(line, file, func, format, arg);
368  va_end(arg);
369  }
370  }
371 #else
372  /* When debug is disabled, silence warnings of unused parameters */
373  (void)line;
374  (void)file;
375  (void)func;
376  (void)output_level;
377  (void)output_bits;
378  (void)format;
379 #endif
380  }
381 
382  /** Output the fatal message with formatting as specified by the format
383  parameter. Message will be sent to the output location and to stderr.
384  The output will be prepended with the expanded prefix set
385  in the object.
386  NOTE: fatal() will call MPI_Abort(exit_code) to terminate simulation.
387  @param line Line number of calling function (use CALL_INFO macro)
388  @param file File name calling function (use CALL_INFO macro)
389  @param func Function name calling function (use CALL_INFO macro)
390  @param exit_code The exit code used for termination of simulation.
391  will be passed to MPI_Abort()
392  @param format Format string. All valid formats for printf are available.
393  @param ... Arguments for format.
394  */
395  void fatal(uint32_t line, const char* file, const char* func, int exit_code, const char* format, ...) const
396  __attribute__((format(printf, 6, 7)));
397 
398  // GET / SET METHODS
399 
400  /** Sets object prefix
401  @param prefix Prefix to be prepended to all strings emitted by calls to
402  debug(), verbose(), fatal() and possibly output().
403  NOTE: No space will be inserted between the prepended prefix
404  string and the normal output string.
405  Prefix can contain the following escape codes:
406  - \@f Name of the file in which output call was made.
407  - \@l Line number in the file in which output call was made.
408  - \@p Name of the function from which output call was made.
409  - \@r MPI rank of the calling process. Will be empty if
410  MPI_COMM_WORLD size is 1.
411  - \@R MPI rank of the calling process. Will be 0 if
412  MPI_COMM_WORLD size is 1.
413  - \@i Thread Id of the calling process. Will be empty if
414  number of threads is 1.
415  - \@I Thread Id of the calling process. Will be 0 if
416  number of threads is 1.
417  - \@x Rank information of the calling process. Will be empty if
418  number of MPI ranks and number of threads are both 1
419  Same as [\@r:\@i]
420  - \@X Rank information of the calling process. Will be [0.0] if
421  number of MPI ranks and number of threads are both 1
422  Same as [\@R:\@I]
423  - \@t Simulation time. Will be the raw simulation cycle time
424  retrieved from the SST Core.
425  */
426  void setPrefix(const std::string& prefix);
427 
428  /** Returns object prefix */
429  std::string getPrefix() const;
430 
431  /** Sets object verbose mask
432  @param verbose_mask Bitmask of allowed message types for debug(),
433  verbose() and fatal(). The Output object will only output the
434  message if the set bits of the output_bits parameter
435  are set in the verbose_mask of the object. It uses this logic:
436  if (~verbose_mask & output_bits == 0) then output is enabled.
437  */
438  void setVerboseMask(uint32_t verbose_mask);
439 
440  /** Returns object verbose mask */
441  uint32_t getVerboseMask() const;
442 
443  /** Sets object verbose level
444  @param verbose_level Debugging output level. Calls to debug(),
445  verbose() and fatal() are only output if their output_level
446  parameter is less than or equal to the verbose_level currently
447  set for the object
448  */
449  void setVerboseLevel(uint32_t verbose_level);
450 
451  /** Returns object verbose level */
452  uint32_t getVerboseLevel() const;
453 
454  /** Sets object output location
455  @param location Output location. Output will be directed to STDOUT,
456  STDERR, FILE, or NONE. If FILE output is selected, the
457  output will be directed to the file defined by the
458  --debug runtime parameter, or to the file 'sst_output' if the
459  --debug parameter is not defined. If the size of MPI_COMM_WORLD
460  is > 1, then the rank process will be appended to the file name.
461  */
462  void setOutputLocation(output_location_t location);
463 
464  /** Returns object output location */
466 
467  /** This method allows for the manual flushing of the output. */
468  inline void flush() const { std::fflush(*m_targetOutputRef); }
469 
470  /** This method sets the static filename used by SST. It can only be called
471  once, and is automatically called by the SST Core. No components should
472  call this method.
473  */
474  static void setFileName(const std::string& filename);
475 
476  static Output& getDefaultObject() { return m_defaultObject; }
477 
478 private:
479  friend class TraceFunction;
480  // Support Methods
481  void setTargetOutput(output_location_t location);
482  void openSSTTargetFile() const;
483  void closeSSTTargetFile();
484  // std::string getMPIProcName() const;
485  int getMPIWorldRank() const;
486  int getMPIWorldSize() const;
487  uint32_t getNumThreads() const;
488  uint32_t getThreadRank() const;
489  std::string buildPrefixString(uint32_t line, const std::string& file, const std::string& func) const;
490  void outputprintf(
491  uint32_t line, const std::string& file, const std::string& func, const char* format, va_list arg) const;
492  void outputprintf(const char* format, va_list arg) const;
493 
494  friend int ::main(int argc, char** argv);
495  static Output& setDefaultObject(
496  const std::string& prefix, uint32_t verbose_level, uint32_t verbose_mask, output_location_t location,
497  const std::string& localoutputfilename = "")
498  {
499  m_defaultObject.init(prefix, verbose_level, verbose_mask, location, localoutputfilename);
500  return getDefaultObject();
501  }
502 
503  static void setWorldSize(const RankInfo& ri, int mpiRank)
504  {
505  m_worldSize = ri;
506  m_mpiRank = mpiRank;
507  }
508 
509  static void setThreadID(std::thread::id mach, uint32_t user) { m_threadMap.insert(std::make_pair(mach, user)); }
510 
511  // Internal Member Variables
512  bool m_objInitialized;
513  std::string m_outputPrefix;
514  uint32_t m_verboseLevel;
515  uint32_t m_verboseMask;
516  output_location_t m_targetLoc;
517 
518  static Output m_defaultObject;
519 
520  // m_targetOutputRef is a pointer to a FILE* object. This is because
521  // the actual FILE* object (m_sstFileHandle) is not created on construction,
522  // but during the first call any of output(), verbose() or debug() methods.
523  // m_targetOutputRef points to either &m_sstFileHandle, &stdout, or &stderr
524  // depending upon constructor for the object. However m_sstFileHandle is a
525  // static variable that is set by the startup of SST, and the location
526  // cannot be changed in the constructor or a call to setFileName().
527  std::FILE** m_targetOutputRef;
528 
529  // m_targetFileHandleRef, m_targetFileNameRef, and m_targetFileAccessCount
530  // are pointers to their associated types. These point to either the local
531  // output file information or to the global simulation output file information.
532  std::FILE** m_targetFileHandleRef;
533  std::string* m_targetFileNameRef;
534  uint32_t* m_targetFileAccessCountRef;
535 
536  // Static Member Variables regarding the Global simulation file info
537  static std::string m_sstGlobalSimFileName;
538  static std::FILE* m_sstGlobalSimFileHandle;
539  static uint32_t m_sstGlobalSimFileAccessCount;
540 
541  // File Member Variables regarding the local simulation file info
542  std::string m_sstLocalFileName;
543  std::FILE* m_sstLocalFileHandle;
544  uint32_t m_sstLocalFileAccessCount;
545 
546  static std::unordered_map<std::thread::id, uint32_t> m_threadMap;
547  static RankInfo m_worldSize;
548  static int m_mpiRank;
549 };
550 
551 // Class to easily trace function enter and exit
553 {
554 
555  thread_local static int trace_level;
556  thread_local static std::vector<char> indent_array;
557 
558 public:
559  TraceFunction(uint32_t line, const char* file, const char* func, bool print_sim_info = true, bool activate = true);
560  ~TraceFunction();
561 
562  Output& getOutput() { return output_obj; }
563 
564  /** Output the message with formatting as specified by the format parameter.
565  @param format Format string. All valid formats for printf are available.
566  @param ... Arguments for format.
567  */
568  void output(const char* format, ...) const __attribute__((format(printf, 2, 3)));
569 
570 private:
571  Output output_obj;
572  uint32_t line;
573  std::string file;
574  std::string function;
575  // uint32_t rank;
576  // uint32_t thread;
577  int indent_length;
578  bool active;
579 };
580 
581 } // namespace SST
582 
583 #endif // SST_CORE_OUTPUT_H
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:51
void setVerboseLevel(uint32_t verbose_level)
Sets object verbose level.
Definition: output.cc:103
void setOutputLocation(output_location_t location)
Sets object output location.
Definition: output.cc:139
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.
Definition: output.h:355
output_location_t
Choice of output location.
Definition: output.h:56
uint32_t getVerboseLevel() const
Returns object verbose level.
Definition: output.cc:109
void setVerboseMask(uint32_t verbose_mask)
Sets object verbose mask.
Definition: output.cc:115
void output(const char *format,...) const
Output the message with formatting as specified by the format parameter.
Definition: output.h:198
Output()
Default Constructor.
Definition: output.cc:59
std::string getPrefix() const
Returns object prefix.
Definition: output.cc:133
Definition: output.h:57
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.
Definition: output.h:225
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.
Definition: output.h:260
Definition: output.h:60
Definition: output.h:552
void debugPrefix(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 debug message with formatting as specified by the format parameter.
Definition: output.h:301
static void setFileName(const std::string &filename)
This method sets the static filename used by SST.
Definition: output.cc:221
void fatal(uint32_t line, const char *file, const char *func, int exit_code, const char *format,...) const
Output the fatal message with formatting as specified by the format parameter.
Definition: output.cc:155
Definition: output.h:58
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.
Definition: output.h:182
Definition: output.h:59
uint32_t getVerboseMask() const
Returns object verbose mask.
Definition: output.cc:121
void flush() const
This method allows for the manual flushing of the output.
Definition: output.h:468
output_location_t getOutputLocation() const
Returns object output location.
Definition: output.cc:149
void init(const std::string &prefix, uint32_t verbose_level, uint32_t verbose_mask, output_location_t location, const std::string &localoutputfilename="")
Initialize the object after construction.
Definition: output.cc:72
void output(const char *format,...) const
Output the message with formatting as specified by the format parameter.
Definition: output.cc:531
void setPrefix(const std::string &prefix)
Sets object prefix.
Definition: output.cc:127