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

Allow reference tags to list multiple arguments #3142

Merged
merged 2 commits into from Feb 21, 2023

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Apr 30, 2021

Proposed changes

Remove parent_tags and use argument_tags instead. This removes the restriction that reference tags can only have a single argument. My use case for this is to store an elastic constitutive relation per block in the global cache and reference the correct one in the element's DataBox, which needs both the global cache tag and the element ID.

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
    major new feature if appropriate.

Further comments

@nilsvu nilsvu requested a review from kidder April 30, 2021 21:47
@nilsvu
Copy link
Member Author

nilsvu commented Apr 30, 2021

@kidder The unit tests pass, but could you make sure I didn't majorly mess up the compute-item dependency tracking? I'll also add more tests.

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.

Looks good. I would like to see this feature merged :)

Might be good to add a reference tag that depends on a reference tag? Something like if some bool is true then choose tag Scalar1 otherwise Scalar2 where Scalar1 and Scalar2 are in two different Variables. Then test that mutating the bool, or either of the Variables tags has the tag be updated. I think this will test the new functionality. You could do something similar with compute tags + subitems to be extra sure since probably any bug in this will be horrible to track down in an executable.

@nilsvu nilsvu force-pushed the reftags_args branch 2 times, most recently from 633f898 to ff39be7 Compare February 13, 2023 17:39
@nilsvu
Copy link
Member Author

nilsvu commented Feb 13, 2023

@kidder I have rebased this PR, simplified it, and added some more tests. Could you take a look please?

@nilsvu nilsvu requested review from kidder and removed request for kidder February 14, 2023 18:21
Copy link
Member

@kidder kidder left a comment

Choose a reason for hiding this comment

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

you can squash

* a const reference to the sub-item
* - type alias `argument_tags` that is `tmpl::list<parent_tag>`
* - type alias `argument_tags` that lists tags needed to evaluate `get`
* - static function `get` that, given the item fetched by `argument_tags`,
Copy link
Member

Choose a reason for hiding this comment

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

item -> items

Copy link
Member Author

Choose a reason for hiding this comment

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

done

nilsvu and others added 2 commits February 20, 2023 12:59
This actually simplifies the DataBox logic because
reference tag dependencies are treated the same as
compute item dependencies.
@nilsvu nilsvu merged commit c73d497 into sxs-collaboration:develop Feb 21, 2023
@nilsvu nilsvu deleted the reftags_args branch February 21, 2023 18:29
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.

None yet

3 participants