-
Notifications
You must be signed in to change notification settings - Fork 35
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
Reduce celer-sim
memory usage and improve its CELER_LOG
transport output
#1550
Reduce celer-sim
memory usage and improve its CELER_LOG
transport output
#1550
Conversation
Test summary 4 215 files 6 481 suites 15m 2s ⏱️ Results for commit 013edc0. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thought: we definitely don't want people with 20GB memory usage by accident 😬
Why do we not flush it every events? (I.e. store in the result in a |
Oh, the ROOT output is fine. This is dumped at the end via output->output(&cout); and is necessary if |
…ream condition bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last change I think :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more from me too :) thanks @stognini!
So turning on ROOT 'solves' the problem. The issue is only if the output is JSON. correct? If it is correct, do we really store 25GB in a text file !? (humm okay that was the total memory, was it the file size then?) |
Using ROOT wouldn't solve it, since we'd end up having both ROOT and json outputs. So I proposed the option to minimize the json info, which is also useful if you just want to time the execution. I did not check how large a final file would have been since I did not worry about directing the |
Yikes :(
Indeed text based information should be minimized. What kind of information is in the json file? What information is being dropped? What information is being kept? How much really needs to be in a file that is directly human? What is the maximum sizes where the JSON is still actually readable? (few MB?). How much of the information that is not strictly needed in the human readable file can be stored in (yet another) ROOT file? |
@pcanal This is the "diagnostic" JSON output which wasn't meant to have much data at all. It's primarily meant to help us analyze performance data and do simple postprocessing. Because it's performance related, we want it to be easy/automatic to stand up, which rules ROOT out. For output that scales with increasing problem difficulty (e.g. the transport results) maybe we should hardcode/use a backdoor environment variable for the maximum number of iterations before we stop saving and writing. |
@stognini out of curiosity, how many events were you running and was this with both One final modification you could make in the |
If I recall correctly that was a 10M events, 1 primary each. And yes both of those options were off. I turned off all json options I could, related to writing info. |
humm ... 'easy/automatic' is clearly doable in ROOT (delta the learning curve). Things that a human readable (json) format would give you are ability to grep through random-ish text, quick visual inspection (vi/less) [albeit if was remembers the structure RDataFrame::Display might work as well). and web display (github actions). Most of which disappear if the file is too large. Example of 'quick' textual display of a ROOT file content:
See also
This makes some sense. (Although the next request is also a start (i.e. capture from the 100th events to the 150th events instead of the first 50 events). |
I mean easy for other people to install, or (like our external) automatic. |
Thought I answered this thread, just to notice that I probably never hit the
For the |
@stognini one last update that would also slightly improve the memory usage:
|
For large simulations the
SimulationResult::events
(which is astd::vector<TransporterResult>
) continuously grows in-memory, being flushed to disk only at the end ofceler-sim
. This can lead to huge memory usage---in one test,celer-sim
reached >25 GB. Another effect that slows down the run and clutters the I/O is theCELER_LOG
message issued at every new event. To address these, this PR adds two options toRunnerInput
:bool transporter_result
, which only accumulates event data on request.size_type print_progress
, which if set toN
(N>0
), will only issue theCELER_LOG
message afterN
events.