• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/core/debug.h

00001 // Copyright 2009-2010 Sandia Corporation. Under the terms
00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00003 // Government retains certain rights in this software.
00004 // 
00005 // Copyright (c) 2009-2010, Sandia Corporation
00006 // All rights reserved.
00007 // 
00008 // This file is part of the SST software package. For license
00009 // information, see the LICENSE file in the top level directory of the
00010 // distribution.
00011 
00012 
00013 #ifndef _SST_DEBUG_H
00014 #define _SST_DEBUG_H
00015 
00016 #include <stdio.h>
00017 #include <boost/serialization/string.hpp>
00018 #include <boost/serialization/vector.hpp>
00019 
00020 namespace SST {
00021 
00022 extern unsigned long _debug_flags;
00023 extern int _debug_rank;
00024 extern int _debug_nnodes;
00025 
00026 extern void DebugInit( int rank, int nnodes );
00027 extern int DebugSetFlag( std::vector<std::string> strFlags );
00028 
00029 } // namespace SST
00030 
00031 #define DBG_UNKNOWN    (-1)
00032 #define DBG_ANY        (1<<0)
00033 #define DBG_CACHE      (1<<1)
00034 #define DBG_QUEUE      (1<<2)
00035 #define DBG_ARCHIVE    (1<<3)
00036 #define DBG_CLOCK      (1<<4)
00037 #define DBG_SYNC       (1<<5)
00038 #define DBG_LINK       (1<<6)
00039 #define DBG_LINKMAP    (1<<7)
00040 #define DBG_LINKC2M    (1<<8)
00041 #define DBG_LINKC2C    (1<<9)
00042 #define DBG_LINKC2S    (1<<10)
00043 #define DBG_COMP       (1<<11)
00044 #define DBG_FACTORY    (1<<12)
00045 #define DBG_STOP       (1<<13)
00046 #define DBG_COMPEVENT  (1<<14)
00047 #define DBG_SIM        (1<<15)
00048 #define DBG_CLOCKEVENT (1<<16)
00049 #define DBG_SDL        (1<<17)
00050 #define DBG_GRAPH      (1<<18)
00051 #define DBG_ZOLT       (1<<19)
00052 #define DBG_EXIT       (1<<20)
00053 #define DBG_ALL        (DBG_ANY | \
00054                         DBG_CACHE| \
00055                         DBG_QUEUE| \
00056                         DBG_ARCHIVE| \
00057                         DBG_CLOCK| \
00058                         DBG_SYNC| \
00059                         DBG_LINK| \
00060                         DBG_LINKMAP| \
00061                         DBG_LINKC2M| \
00062                         DBG_LINKC2C| \
00063                         DBG_LINKC2S| \
00064                         DBG_COMP| \
00065                         DBG_FACTORY| \
00066                         DBG_STOP| \
00067                         DBG_COMPEVENT| \
00068                         DBG_SIM| \
00069                         DBG_CLOCKEVENT| \
00070                         DBG_SDL| \
00071                         DBG_GRAPH| \
00072                         DBG_ZOLT| \
00073                         DBG_EXIT| \
00074                         0)
00075 
00076 #define __DBG( flag, name, fmt, args...) if (flag & SST::_debug_flags)\
00077          printf( "%d:%s::%s():%d: "fmt, SST::_debug_rank, #name, __FUNCTION__,__LINE__, ## args ) 
00078 
00079 #define _DBG( name, fmt, args...) \
00080          printf( "%d:%s::%s():%d: "fmt, SST::_debug_rank, #name, __FUNCTION__,__LINE__, ## args ) 
00081 
00082 #define _AR_DBG( name, fmt, args...) __DBG( DBG_ARCHIVE, name, fmt, ## args )
00083 
00084 #define _abort( name, fmt, args...)\
00085 {\
00086     printf( "%d:%s::%s():%d:ABORT: "fmt, SST::_debug_rank, #name, __FUNCTION__,__LINE__, ## args ); \
00087     exit(-1); \
00088 }\
00089 /**/
00090 
00091 #define _ABORT _abort
00092 
00093 #endif

Generated on Fri Oct 22 2010 11:02:13 for SST by  doxygen 1.7.1