JeffersonLab / qphix

QCD for Intel Xeon Phi and Xeon processors
http://jeffersonlab.github.io/qphix/
Other
13 stars 11 forks source link

Expose all debugging flags via CMake #76

Open martin-ueding opened 7 years ago

martin-ueding commented 7 years ago

There are a couple of ad-hoc definitions for debugging, like these:

include/qphix/invbicgstab.h:#define QPHIX_VERBOSE_BICGSTAB
include/qphix/invbicgstab.h:#define QPHIX_TIMING_BICGSTAB
include/qphix/invcg.h:#define QPHIX_TIMING_CG
include/qphix/invcg.h:// #define CGDEBUG
include/qphix/qdp_packer_parscalar.h:#define MANUAL_COLLAPSE 1
include/qphix/minvcg.h:#undef DEBUG_MINVCG
include/qphix/qdp_packer_qdpjit.h:#undef DEBUG_PACKER
tests/invbicgstab_test.h:#undef DEBUG

Perhaps all those should be exposed via CMake options? It is not much work and perhaps better than having those scattered around in the code. Perhaps they should be unified into a few global debugging or timing options?

bjoo commented 7 years ago

Hi I guess these came about as I was testing/ timing various bits. I think rather than exposing them all, maybe systematizing them would be better, e.g.

Consolidate debug related defs to -DQPHIX_DEBUG Consolidate timind related defs to -DQPHIX_TIMINGS

Verbosity is slightly different. Wonder whether it should be runtime Vs compile time (e.g. pass some

enum VerbLevel = { INFO=0, DEBUG, ... };

N.B. one could compile up a masterPrintf like function that would look like:

// Use varargs or some such void masterPrint( VerbLevel verb, ... );

We could also define a verbosity level at compile time e.g. via CMake called e.g. QPHIX_LOG_LEVEL.

And then the body of the masterPrintf could be

void masterPrint( VerbLevel verb, ... ) { if ( verb <= QPHIX_LOG_LEVEL ) { // Print message from var args here

}

// Else do nothing }

Also, verbosity (e.g. to print convergence history) could be a param to solvers, rather than a #define

This seems to be a mpre standard approach than my earlier hacks, similar to runtime asserts, verbosity etc in other packages (e.g. QUDA?)/logging systems, but any good ideas or just comments on this would be welcome

Best, B

On June 26, 2017 6:36:58 PM GMT+02:00, Martin Ueding notifications@github.com wrote:

There are a couple of ad-hoc definitions for debugging, like these:

include/qphix/invbicgstab.h:#define QPHIX_VERBOSE_BICGSTAB
include/qphix/invbicgstab.h:#define QPHIX_TIMING_BICGSTAB
include/qphix/invcg.h:#define QPHIX_TIMING_CG
include/qphix/invcg.h:// #define CGDEBUG
include/qphix/qdp_packer_parscalar.h:#define MANUAL_COLLAPSE 1
include/qphix/minvcg.h:#undef DEBUG_MINVCG
include/qphix/qdp_packer_qdpjit.h:#undef DEBUG_PACKER
tests/invbicgstab_test.h:#undef DEBUG

Perhaps all those should be exposed via CMake options? It is not much work and perhaps better than having those scattered around in the code. Perhaps they should be unified into a few global debugging or timing options?

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_qphix_issues_76&d=DwICaQ&c=lz9TcOasaINaaC3U7FbMev2lsutwpI4--09aP8Lu18s&r=SC-qvz5njMoFH6cliT5XZQ&m=Ca9oibePB4oNunq0jCn8SucAQiTi2f_bxpA6F-sGq3U&s=HzTSMF9ZdFH99B5HmYwFqhTdewx1dkeHTVOMUDc2rqY&e=

-- Bálint Joó, Scientific Computing Group, Jefferson Lab Email: bjoo@jlab.org Tel: +1 757 269 5339 Sent from a mobile device