-
Notifications
You must be signed in to change notification settings - Fork 596
Volume Calculation enhancement including refactoring and real-valued scoring implementation #3732
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
Open
vitmog
wants to merge
14
commits into
openmc-dev:develop
Choose a base branch
from
vitmog:vol-calc
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rejection one, the switch and documentaion changes are provided
… root volume calculation routine
Contributor
|
If you're already fixing this PR, could you also move the MPI datatype declaration and destruction to src/initialize.cpp and src/finalize.cpp in the same way the other MPI data types are declared and destroyed? |
Author
|
No problem, I will move the MPI-related part along with the fix, but not until 12 hours from now |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is just a modification of PR #3645 reduced according to the suggestion of @GuySten: all code about the ray tracing volume estimator was removed by a single commit.
This PR:
max_iterationsparameter which partially fixes Volume calculation enhancements #1702;vol_calcregression test input which became explicit after the volume estimator's change;However, the number of changed lines is still quite large because the refactoring required moving code blocks from the
VolumeCalculation::execute()routine to specific new ones. I think it could be useful to take a look at the full code of each variant: original and current. If the current variant seems worse than the original, then the proposed refactoring is not successful, I guess.The implementation of the new features is quite straightforward except for the refactoring which is discussed below separately.
Details
The initial scheme of the hit estimator was intended for binary scoring only, i.e. a score could be equal just either to$0$ or $1$ , and did not support the sample splitting into batches. Thus the simplified tallies were used which are represented just by two integer STL vectors per problem assumed to conform to each other. Therefore, usage of real-valued scoring required implementation of fully-fledged tallies and related MPI-structures. Also, some semantic changes have been made for refactoring of the quite large
VolumeCalculation::execute()method to simplify the further extension of its functionality. Despite the significant size of changes, the original general code structure and algorithms were kept.The switch to real-valued scoring to batches instead of the binary-valued ones required creation of the data structures for tallies and methods to work with them. In its turn, that required organization of the MPI and OpenMP data interchanges.
Of course, I would have been happy not to refactor the code, but the only alternative -- to follow the original VC-paradigm by adding several hundred more of lines right in
VolumeCalculation::execute()and extending the MPI data interchange for packing diverse-type data into the vector buffers -- seemed like the worse variant. While the goal of my work was not refactoring, it is not completed -- there are still issues of improvement. Perhaps some blocks of code, like tally manipulations, could be replaced by analogs from the main part of OpenMC, but they have seemed to me not abstract enough to reuse them here right now. It could be interesting also in the context of the issue of "filtered" tallies normalization by Volume Calculation.To simplify reviewing, I have added notes as temporary comments about relative changes starting from
// TO REVIEWER:by a single commit in the rest.@GuySten, after rethinking, I got that, probably, it is not what you expected, because the size has not decreased dramatically. It is because, on the one hand, I cannot split the refactoring keeping the full functionality at the intermediate stages, because the data structures and MPI/OpenMP-related parts are coupled tightly. On the other hand, pushing the introduced features only could require some redesign and make this PR unrelated to the main PR. Please let me know about your thoughts.
Checklist
I have made corresponding changes to the documentation (if applicable)