Rm unused member fn, if stmt, header includes, param registrations#32781
Rm unused member fn, if stmt, header includes, param registrations#32781nmnobre wants to merge 6 commits intoidaholab:nextfrom
Conversation
|
Job Documentation, step Docs: sync website on e4b0c1c wanted to post the following: View the site here This comment will be updated on new commits. |
|
Job Coverage, step Generate coverage on e4b0c1c wanted to post the following: Framework coverage
Modules coverageCoverage did not change Full coverage reportsReports
This comment will be updated on new commits. |
||||||||||||||||||||||||||
|
Job Precheck, step Clang format on 2bf8ed9 wanted to post the following: Your code requires style changes. A patch was auto generated and copied here
Alternatively, with your repository up to date and in the top level of your repository:
|
lindsayad
left a comment
There was a problem hiding this comment.
Here are my thoughts:
- I think the warehouse change should be reverted. I like relying on filtering through attributes which have caches associated with them and then maintaining the invariant that
queryIntoshould only be acting on candidates that match the typeT - I think all the system attribute name registrations should be restored. Those have a nice parallel with the libMesh backend
- I like the change to remove the
typestring parameter fromgetMFEMObjectas it removes what feels like redundant typing at the call-sites. I wonder if we can restore the idea that was originally present in this PR with something like
template <typename T>
const std::string & mfemSystemName()
{
static const std::string system = []()
{
auto params = T::validParams();
return params.getSystemAttributeName();
}();
return system;
}and then use in getMFEMObject like
theWarehouse()
.query()
.condition<AttribSystem>(mfemSystemName<T>())
.condition<AttribThread>(tid)
.condition<AttribName>(name)
.queryInto(objs);Then we only pay the input parameters construction cost once per template instantiation
|
All done. |
lindsayad
left a comment
There was a problem hiding this comment.
It's a little sad to slow down by that factor, but until someone complains about the overhead, I think the code cleanliness is worth it
|
An alternative that should bring back the .25%, while keeping the call-sites clean, is lindsayad/moose@8b46e400ee9. |
What if we can get 0.20% instead? 😈 Btw, that metric is obtained with |
|
|
Lol. I spent too much time on this changing |
|
|
I'm not seeing it anywhere |
You're right, my bad. I missed that. So it matches the semantics in this PR but avoids the performance hit.
Is it? We are currently doing it in next in I'm sorry, but how bad is it if I say I actually prefer to keep things as they are in next? I don't really like all the boilerplate code we need to add... In addition to registering a base name (maybe still literally) and a system name (probably now retrieved), the dev now has to add a static member (which at first sight will look unintelligible as they need to know what it is for)... I think the literals are just more readable. From my side I'm happy to drop what I suggested, I'll just downgrade this PR to the other minor tweaks identified along the way. If what we take away from all this discussion is that the current solution in next is the best compromise, that's absolutely fine by me - this is what the scientific method is all about after all. |
Indeed, this is the case!
Haha it's not bad at all. I think that's a fine conclusion. It will save me days' work fixing apps missing includes of |
lindsayad
left a comment
There was a problem hiding this comment.
Approving the new state of the PR
|
Job Test, step Results summary on e4b0c1c wanted to post the following: Framework test summaryCompared against f7d8b00 in job civet.inl.gov/job/3796767. No change Modules test summaryCompared against f7d8b00 in job civet.inl.gov/job/3796767. No change |

Reason
Originally posted by @nmnobre in #32701 (review)
Design
The key here is simply to retrieve the system attribute name from the template type:
const std::string system = T::validParams().getSystemAttributeName();Impact
Devs won't have to deal with redundant system attribute names, simplifying the API calls.
EDIT: After much back and forth, we've decided to drop the initial purpose for this PR.