impy-project/chromo

Reduce default verbosity of Phojet and Dpmjet

HDembinski opened this issue · 3 comments

Our default debug level is zero. All models should produce a minimum of output at that debug level, ideally only a banner when they get started. Phojet and Dpmjet produce a lot of output regardless of the debug level, which makes finding your own debug messages between all the noise difficult, especially since Phojet and Dpmjet need to be restarted every time we generate events.

@afedynitch Can you reduce the debug output for Phojet and Dpmjet and/or make it respect the debug level?

This is a really tricky issue. While there is a way to silence the 19.x versions, I feel uneasy doing this by default or at least not on CI. This is because otherwise it becomes impossible to debug user issues. Imagine a user sees crashes after 1M events. How do you want to reproduce the crash if we don't have any logs from that event. Maybe it occurs on some sort of cluster or remote machine (or parts of the cluster) but not on the personal laptop, or only for a specific glibc version? This can happen because the generators seem to produce different output depending on the standard library or architecture.

There has to be a mechanism in place to capture the output of all of the models to a logfile in /tmp by default. If there is a timeout or crash, then the logfile is recovered and copied to the working directory. There should also be a regular RNGstate dump every 1000 events to the same /tmp (everwriting the previous).

Temporarily, one could set the lpri value found in both, PHOJET and DPMJET, to 0. Also the one provided to pho_init(-1,..., 50 ->0). But I wouldn't close this issue until there is some sort of log capturing in place, which was removed from the current version.

That's why we have the debug-level, right? If something happens and the user reports: "impy crashed! Help!" We tell them, please run it again with debug-level 10 and send us the output. It is not helpful to produce all that output all the time, only when it is needed.

Having no way to silence it is a big problem when I want to find my own debug messages between all the noise. It blows up the CI logs, too.

It would be good if lpri is set based on the debug_level of impy.

I removed the output-capturing, because it was a (brittle) workaround and it is currently in the way of refactorings. We may have to reintroduce it (perhaps in modified form). But foremost, we need the all models to respect the impy debug_level. That should largely remove the need for log-capturing. But even with output-capturing, it is good to be able to reduce the output in the log when you are not currently debugging.

Or take the same advice from some else: Logging practices I follow

Closed by #104