Perform topological sort to order components - #428
cmacmackin wants to merge 31 commits into
Conversation
|
This is nearly done. Remaining tasks:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #428 +/- ##
==========================================
+ Coverage 59.73% 60.52% +0.78%
==========================================
Files 98 98
Lines 10270 10479 +209
Branches 1482 1520 +38
==========================================
+ Hits 6135 6342 +207
+ Misses 3488 3481 -7
- Partials 647 656 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a75b2ce to
8d049e2
Compare
c31490e to
e650c1c
Compare
e650c1c to
9dbeed5
Compare
9dbeed5 to
04a8977
Compare
04a8977 to
8fc17e0
Compare
|
I missed this in #421, but I see that you added a long-needed feature - a better way to determine species type which is based on the charge: hermes-3/src/component_scheduler.cxx Lines 339 to 352 in 8fc17e0 There is already a function that does the same in hermes-3/include/hermes_utils.hxx Lines 61 to 70 in 053c9bb Ideally there should be only one tool to do this, and your new one seems more robust. Is there any reason not to replace the one in |
Probably not. I just wasn't sure if people would be happy about me changing that bit of code. Note that this will require changing the function signature of |
|
I went through the sorting algorithm and I see that you have left a good amount of comments on the individual bits. However, I found it difficult to get my head around what's going on just because of the amount of steps involved. It would be very useful to have a paragraph describing how the algorithm works step-by-step, either in the docs or in the comments (or both) |
|
There are some places (e.g., when writing tests) where it was convenient to just be able to have a list of species names and use the old heuristics to categorise them. Probably not a good enough reason to keep that though. |
ZedThree
left a comment
There was a problem hiding this comment.
LGTM, thanks @cmacmackin!
There's some trivial bits that I'm happy to fix myself
8fc17e0 to
73593b7
Compare
Use CRTP to get component name for registration.
This required some changes to how options are accessed, so that we can more easily get/set only the domain or only the bounds.
aacebfa to
4572264
Compare
mikekryjak
left a comment
There was a problem hiding this comment.
I gave another serious go at going through everything and left a few comments. My preference would be that we merge this with a flag to disable the sort if needed (enabled by default is fine) as well as a facility to print the as-written and as-sorted component list to console on initialisation.
We also definitely need to make a release before merging this in.
| /// permissions on the boundaries and read permissions for the | ||
| /// interior. | ||
| /// | ||
| /// FIXME: Currently these permissiosn are not expressed properly, due |
There was a problem hiding this comment.
is this FIXME still active? what does it take to fix it and what are the possible risks of leaving it unfixed?
There was a problem hiding this comment.
This limitation still exists and it would be nontrivial to implement the desired feature. The permission system doesn't currently allow conditional logic that depends on any other variables or regions. I played around a bit with a system for providing this over last Christmas break, but it would significantly delay getting this merged if we wanted something like that.
I think the risks of leaving this unfixed are relatively low. It could, in principle, result in spurious errors from circular dependencies in the sorting algorithm, but nothing like that has surfaced so far. I'll cherrypick the commits allowing us to turn off the sorting algorithm and incorporate that into this PR, so we'd have a fallback if we do encounter a situation like this.
Co-authored-by: mikekryjak <62797494+mikekryjak@users.noreply.github.com> Co-authored-by: Chris MacMackin <cmacmackin@gmail.com>
|
I've addressed all comments left in review. |
Using the access control information introduced in #421, this PR makes it possible for Hermes-3 to work out the order of components at run-time. This will make things far simpler and more robust for users. It will also fail faster if there is an unsatisfiable or circular dependency.
Closes #384.