Fix bug in expMSSA control flags#154
Merged
michael-petersen merged 7 commits intodevelfrom Aug 16, 2025
Merged
Conversation
added 3 commits
July 18, 2025 12:46
…rflow while computing basis elements with large harmonic orders
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes a bug in the expMSSA class where totVar and totPow were incorrectly declared as boolean types but used as double values for norm computations. The fix separates the control flags from the computed values and improves cache file handling.
- Converts
totVarandtotPowfrom boolean to double types for norm calculations - Introduces new boolean flags
varFlagandpowFlagto control the normalization behavior - Adds cache file support for the new flags and improves HDF5 attribute handling
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| include/SLGridMP2.H | Adds static member variables for grid construction heuristics |
| exputil/SLGridMP2.cc | Implements adaptive grid boundaries and enhanced diagnostic output |
| expui/expMSSA.cc | Fixes boolean/double type confusion and adds flag handling |
| expui/expMSSA.H | Updates class definition with separate flag and value variables |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
michael-petersen
approved these changes
Aug 16, 2025
Member
michael-petersen
left a comment
There was a problem hiding this comment.
I can confirm this is all behaving as expected; still surprised the compiler didn't catch this, but seems that we are good now.
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
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.
The issue
The
expMSSAheader definestotVarandtotPowas boolean but uses them as doubles to compute the norm. Not sure how this is legal code? But that's how it appears.The fix
totVarandtotPowdoubles.varFlagandpowFlagas boolean class data set by thetotVarandtotPowYAM configuration flagNotes
While this is formally a big, I think, I'm basing the PR on
devel, anticipating an upcoming merge tomain