etmc / tmLQCD

tmLQCD is a freely available software suite providing a set of tools to be used in lattice QCD simulations. This is mainly a HMC implementation (including PHMC and RHMC) for Wilson, Wilson Clover and Wilson twisted mass fermions and inverter for different versions of the Dirac operator. The code is fully parallelised and ships with optimisations for various modern architectures, such as commodity PC clusters and the Blue Gene family.
http://www.itkp.uni-bonn.de/~urbach/software.html
GNU General Public License v3.0
32 stars 47 forks source link

define debug levels #55

Open urbach opened 12 years ago

urbach commented 12 years ago

currently we do have the DebugLevel option, what it was never written down which type of message we want to have at which deubg level. Siebren, you thought about it already, didn't you? So maybe we can have sort of a list defining this, but right now I don't have a very good idea, how...!

kostrzewa commented 12 years ago

I've started cataloguing the different outputs by debug level here. The list is not complete but I add a few items now and then. Last file processed was start.c

I would begin by defining

0 debug level which allows output only once (reading configuration file for instance)

1 to 9 debug levels which allow output with increasing frequency based on loop depth perhaps (such as >3 currently means heatbath, acceptance function calls) where > 9 must mean ALL possible text output is also printed

This can be made more granular by defining topical ranges within the interval. (although I don"t know which topics this would be at this point)

Further, I would introduce a second debug variable "g_debug_topic" for the following purpose: Rather than debugging levels, we have an enum of topic specific debug conditions which must be documented separately. With an adjustment in the if conditions, for instance in the smearing routines, we could then have:

if( g_debug_level > 3 || g_debug_topic == DEBUG_SMEARING ) { [...] }

to output only information related to smearing by setting debug_level to 0 or 1. The usefulness of this can of course be debated because as long as the debug output is weil designed, grep will make the above possible without extra logic and without an extra global variable. Also, having the context can come in useful sometimes.

kostrzewa commented 12 years ago

As part of these definitions it might make sense to also remove the "verbose" variable which is set in invert and hmc_tm because having it in place just adds more complexity.