src/myrlog.h

Go to the documentation of this file.
00001 //
00002 // C++ Interface: myrlog
00003 //
00004 // Description: 
00005 //
00006 //
00007 // Author: Roman Geus <geus@maxwell>, (C) 2004
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 
00013 #ifndef MYRLOG_H
00014 #define MYRLOG_H
00015 
00016 #include "rlog/rlog.h"
00017 #include "rlog/StdioNode.h"
00018 
00022 #define rExit(...) \
00023     do { \
00024         rError( __VA_ARGS__ ); \
00025         exit(1); \
00026     } while(0);
00027 
00028 /*
00029  * Macros for logging to .../all channels.
00030  */
00031 #define rDebugAll(...) \
00032     rLog(RLOG_CHANNEL("debug/all"), __VA_ARGS__ )
00033 #define rInfoAll(...) \
00034     rLog(RLOG_CHANNEL("info/all"), __VA_ARGS__ )
00035 #define rWarningAll(...) \
00036     rLog(RLOG_CHANNEL("warning/all"), __VA_ARGS__ )
00037 #define rErrorAll(...) \
00038     rLog(RLOG_CHANNEL("error/all"), __VA_ARGS__ )
00039 
00040 class Epetra_Comm;
00041 class Epetra_CrsMatrix;
00042 
00043 namespace rlog {
00047     class RLOG_DECL MyStdioNode : public StdioNode
00048     {
00049     public:
00054         MyStdioNode(std::string prefix = "", int fdOut = 2);
00055         virtual ~MyStdioNode();
00056 
00057     protected:
00063         virtual void publish(const RLogData &data);
00064     private:
00068         std::string prefix_;
00069     };
00070 
00072     std::string bytes2str(unsigned long long size);
00073 }
00074 
00076 std::string get_log_file_name(std::string prefix);
00077 
00079 size_t get_mem_footprint();
00080 
00083 void log_mem_footprint(const Epetra_Comm& comm, std::string msg="");
00084 
00086 void log_command_line_args(int argc, char* argv[], rlog::RLogChannel* channel=0);
00087 
00089 size_t get_matrix_mem_footprint(const Epetra_CrsMatrix&);
00090 
00092 void log_matrix_stats(std::string matrix_name, const Epetra_CrsMatrix* A);
00093 
00094 #endif

Generated on Fri Oct 26 13:35:12 2007 for FEMAXX (Finite Element Maxwell Eigensolver) by  doxygen 1.4.7