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

Small: Quality of life changes for downstream codes #1143

Merged
merged 14 commits into from
Aug 7, 2024

Conversation

lroberts36
Copy link
Collaborator

@lroberts36 lroberts36 commented Jul 29, 2024

PR Summary

  • Access tensor indices of ParArray3D in pack using VariableState.
  • Include radiation constant in PhysicalConstants
  • Add a TypeList wrapper for lists of types that allows for concatenation, pulling out types at specific indices, etc.
  • Allow for solvers to work on a non-base container

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

Neat trick.

Comment on lines 65 to 67
int t{0};
int u{0};
int v{0};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe should be initialized to some signal var indicating they haven't been set, like -1?

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 on the default init.

Unrelated to this PR and a more general performance question: Has anyone looked at the impact on performance when putting more and more info in the packs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, probably so. Also maybe would be better to store as an array? Not totally sure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The message from @pgrete didn't show up for me before. I have not looked carefully at the performance impact, but at least when I put variable state in initially I didn't see any slow down. Of course, there is now more state stored there...

Copy link
Collaborator Author

@lroberts36 lroberts36 Jul 31, 2024

Choose a reason for hiding this comment

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

If this is a performance issue, there are definitely things that can be removed and some things that can be moved to the sparse pack itself. That being said, having easy access to this information simplifies a lot of code.

Comment on lines 65 to 67
int t{0};
int u{0};
int v{0};
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 on the default init.

Unrelated to this PR and a more general performance question: Has anyone looked at the impact on performance when putting more and more info in the packs?

@lroberts36 lroberts36 requested review from Yurlungur and pgrete July 31, 2024 03:47
@lroberts36 lroberts36 changed the title WIP: Small: Quality of life changes for downstream codes Small: Quality of life changes for downstream codes Jul 31, 2024
src/interface/variable_state.hpp Show resolved Hide resolved
src/utils/type_list.hpp Show resolved Hide resolved
Copy link
Collaborator

@pgrete pgrete left a comment

Choose a reason for hiding this comment

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

LGTM (no implementation related comment/question)

src/solvers/mg_solver.hpp Show resolved Hide resolved
std::vector<int> shape = {})
: params_(params_in), iter_counter(0), eqs_(eq_in) {
std::vector<int> shape = {}, const std::string &container = "base")
: params_(params_in), iter_counter(0), eqs_(eq_in), container_(container) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just thinking out loud here (independent of this PR): We are still sharing comm buffer of each variable across containers, aren't we?
Do we have any control over ensuring that only one communication piece is running/using the comm buffers in a task list at any given time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't have any control over that and I agree that if you had a task list that had independent groups of tasks that worked on different containers but also communicated you could possibly run into issues where one container grabs messages meant for another container. That is similar to some of the issues I had to fix for multi-grid in this PR. I am not sure what the best approach to dealing with this is. Making buffers for each container doesn't seem ideal and it could be a little tricky to build buffers and MPI tag maps for multiple containers in the current framework (since now buffers are built right after remesh, not at the point when containers are first asked for). Maybe we should put up a warning issue about this.

src/utils/type_list.hpp Show resolved Hide resolved
@lroberts36 lroberts36 enabled auto-merge August 6, 2024 18:12
@lroberts36 lroberts36 merged commit 8feea2c into develop Aug 7, 2024
53 checks passed
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

Successfully merging this pull request may close these issues.

4 participants