Umpire icon indicating copy to clipboard operation
Umpire copied to clipboard

ability shut down umpire's I/O cleanly

Open evaleev opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.

umpire::initialize_io grabs std::cerr's rdbuf and flushes it when at the end of lifetime of the corresponding static object (s_error_buffer). This assumes that the buffer is still around. In our app we reset std::cerr's rdbuf. Unfortunately there is no way to access s_error_buffer.

Describe the solution you'd like

Ideally there should be a way to control the lifetime of ResourceManager. Or there should be a finalize_io function that can be called by the user.

Describe alternatives you've considered

Not messing with std::cerr's buffer ... but I don't see anything in the standard forbidding this.

Additional context

n/a.

evaleev avatar Jul 29 '21 16:07 evaleev

Hey @evaleev - thanks for reporting this. I believe it's actually an error in what we implemented. The log and 'replay' output streams are correctly set to a specific file, e.g. https://github.com/LLNL/Umpire/blob/develop/src/umpire/util/io.cpp#L139

The intent was to do the same for errors, but it looks like we didn't ever implement that!

Would that solution be okay for you?

davidbeckingsale avatar Aug 02 '21 23:08 davidbeckingsale

@davidbeckingsale yes, sure, if Umpire uses (and most importantly, manages the lifetime of) its own streambufs correctly that will solve this issue for us. Thanks!

evaleev avatar Aug 04 '21 17:08 evaleev

gentle bump @davidbeckingsale :)

evaleev avatar Apr 20 '23 12:04 evaleev