Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability shut down umpire's I/O cleanly #616

Open
evaleev opened this issue Jul 29, 2021 · 3 comments
Open

ability shut down umpire's I/O cleanly #616

evaleev opened this issue Jul 29, 2021 · 3 comments

Comments

@evaleev
Copy link
Contributor

evaleev commented Jul 29, 2021

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.

@davidbeckingsale
Copy link
Member

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?

@evaleev
Copy link
Contributor Author

evaleev commented Aug 4, 2021

@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
Copy link
Contributor Author

evaleev commented Apr 20, 2023

gentle bump @davidbeckingsale :)

evaleev added a commit to ValeevGroup/tiledarray that referenced this issue Jan 8, 2024
evaleev added a commit to ValeevGroup/tiledarray that referenced this issue Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants