00001
00002
00003
00004
00005
00006
00007
00008
00009
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
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