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

Add an observer for tracking the size of DataBox items #5858

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

kidder
Copy link
Member

@kidder kidder commented Mar 17, 2024

Proposed changes

This adds an event that can be used to track the sizes of DataBox items. It is not added to any executable, as it seems to add some compilation time. To use it, add it as an Event similar to the MonitorMemory event.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

Copy link
Member

@nilsdeppe nilsdeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor things and some optionals in question form. Let me know what you think, please squash directly :)

auto& observer_writer_proxy = Parallel::get_parallel_component<
observers::ObserverWriter<Metavariables>>(cache);
const std::string subfile_name =
"/ObserveDataBox/" + pretty_type::name<ContributingComponent>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this file name be specified in ObserveDataBox like we do for other observations? Maybe otherwise name this ObserveDataBoxSizeInMb? Long, but extremely unlikely to conflict with anything

};
} // namespace detail

class ObserveDataBox : public Event {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some doxygen comment so this shows up?

How difficult would it be to write a simple test that just verifies this works with say 1 singleton, 1 nodegroup, and 1 array (with 3 elements?)? If it's difficult, I'm happy to defer since this feature is very necessary

Copy link
Member

@nilsdeppe nilsdeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fixup LGTM. Please squash!

- Adds a function to observe the size in bytes of all non-reference items
  in a DataBox
- Adds an observer to gather the sizes in MB of each item (summed over all
  elements) for the DataBoxes of each component
@nilsdeppe nilsdeppe added the auto-merge GitHub's auto-merge has been enabled for this PR. label Apr 15, 2024
@nilsdeppe nilsdeppe merged commit eded15d into sxs-collaboration:develop Apr 15, 2024
22 checks passed
@kidder kidder deleted the databox_size branch April 16, 2024 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge GitHub's auto-merge has been enabled for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants