|
#define | TRACE(stuff) std::cout << FormDebugHead() << stuff << std::endl << std::flush; |
|
#define | MARK std::cout << FormDebugHead() << __FILE__ << " at line " << __LINE__ << std::endl << std::flush; |
|
#define | MARK_ON_PROCESS(proc) if (PetscTools::GetMyRank()==proc) std::cout << FormDebugHead() << __FILE__ << " at line " << __LINE__ << std::endl << std::flush; |
|
#define | PRINT_VARIABLE(var) std::cout << FormDebugHead() << #var " = " << var << std::endl << std::flush; |
|
#define | PRINT_2_VARIABLES(var1, var2) |
|
#define | PRINT_3_VARIABLES(var1, var2, var3) |
|
#define | PRINT_4_VARIABLES(var1, var2, var3, var4) |
|
#define | PRINT_5_VARIABLES(var1, var2, var3, var4, var5) |
|
#define | QUIT_AFTER_N_VISITS(n) { static unsigned counter=0; if (++counter==(n)) {TRACE("User-forced quit."); assert(0);} } |
|
#define | HOW_MANY_TIMES_HERE(message) |
|
#define | TRACE_FROM_NTH_VISIT(stuff, n) |
|
#define | PRINT_VECTOR(v) |
|
#define | MARK_IN_ORDER PetscTools::BeginRoundRobin(); MARK; PetscTools::EndRoundRobin(); |
|
#define | STACK PrintTheStack(); |
|
#define | MARK_MEMORY MarkMemory(); |
|
#define | UNMARK_MEMORY UnmarkMemory(); |
|
#define | PRINT_MEMORY PrintMemory(); |
|
A bunch of useful macros for debugging. These all output information to stdout as lines starting "DEBUG: ". When running in parallel the process number is also displayed. Each line is flushed as soon as it is written.
- Note
- Use of these should be removed from source code when committing.
Definition in file Debug.hpp.
(For debugging on a seriously large number of processes) Show the mark that we have reached this line of code, but do it in process order, which is important if we suspect that one or more processes are missing.
This will also isolate all the MARKs which appear for a particular line of code, since all process have to synchronise at the beginning of the round-robin.
Note that this will change the parallel behaviour of the code – if one process really is missing then the first barrier inside the round-robin will cause deadlock.
Definition at line 177 of file Debug.hpp.
Allows use of PRINT_MEMORY to give results relative to the footprint at this call.
Set sMemoryAtMarker to the current approximate memory footprint. This value is subtracted from the memory footprint if the macro PRINT_MEMORY is called.
This is used with the macro MARK_MEMORY
Definition at line 83 of file Debug.cpp.
References TRACE.