Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 1.16 KB

File metadata and controls

17 lines (13 loc) · 1.16 KB

M11. No package should have hardwired print or I/O statements that cannot be turned off through a programmatic interface6; output should never be hard-wired to stdout or stderr. It is recommended that packages provide a way for users to turn on output and allow them to direct where it goes.7 Also, packages may print to stdout by default but only on one process (i.e., root rank “0”). But packages may also be completely silent by default (and require that users turn on outputting in the appropriate way).


6 Packages should not exclusively use environmental variables as a programmatic interface since other packages that may be controlling the simulation process cannot set such environmental variables. There must be an API that can be called from with the source code. It is fine to also support using environmental variables, but that cannot be the only way.

7 For example, allowing users to control output in a C++ package means that the package must accept an arbitrary std::ostream object and all output should go to that object. In C, the package should accept a FILE object to which it can direct its output.