[mpich2-dev] Failures on Solaris and standard debug macros
William Gropp
wgropp at illinois.edu
Wed Dec 10 08:28:07 CST 2008
This morning's failures to compile on Solaris are due to the use of a
varargs macro definition, which is not universally supported. This
was used for some debug printfs in the code, as a way to turn them on
and off easily. This approach, while quick, has several flaws:
1) Even in the debug/development version of the code, it requires
recompilation of the file
2) It violates the coding standard that restricts the use of printf
(this is done to ensure that error messages can be correctly
internationalized - raw printfs with error messages are incorrect in
any code that intends to support other languages)
There is a solution - there are debugging macros that allow the
informational statements to be turned on and off by class at run time,
and that can be eliminated entirely in production versions. These are
used throughout the MPICH2 code and are preferable to the use of raw
printfs. The are a bit longer, but through the use of editor macros
or simply saving the template in an editor register, are easy to
insert. See http://wiki.mcs.anl.gov/mpich2/index.php/Debug_Event_Logging
for instructions on using these macros.
William Gropp
Deputy Director for Research
Institute for Advanced Computing Applications and Technologies
Paul and Cynthia Saylor Professor of Computer Science
University of Illinois Urbana-Champaign
More information about the mpich2-dev
mailing list