Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make floating point exceptions consistent across platforms #8255

Merged
merged 1 commit into from
Sep 7, 2020

Conversation

nealkruis
Copy link
Member

Pull request overview

This disables underflow exceptions on Windows debug builds to be consistent with Unix debug builds (and moves the code setting exceptions to the same location). Disabling underflow exceptions means the hardware will round any values in the underflow gap to zero and continue.

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally

@nealkruis nealkruis added Defect Includes code to repair a defect in EnergyPlus DoNotPublish Includes changes that shouldn't be reported in the changelog labels Sep 4, 2020
@nealkruis nealkruis added this to the EnergyPlus 9.4.0 milestone Sep 4, 2020
@nealkruis nealkruis requested a review from mjwitte September 4, 2020 22:52
@nealkruis nealkruis self-assigned this Sep 4, 2020
@nealkruis
Copy link
Member Author

@mjwitte @Myoldmopar I was thinking about making some unit tests that simply test enabling/disabling certain floating point exceptions, but it wouldn't actually be testing any of the EnergyPlus source code. Do you think it's still worth while? If so, where would the tests go?

@Myoldmopar
Copy link
Member

Yeah, that would be a weird test. Let's not worry about wedging it into some standard unit test form.

CI is fine with these changes, did we land on an IDF that we can use as a test case though?

@nealkruis
Copy link
Member Author

#8233 was an issue @mjwitte posted about 2 weeks ago (fails on 5ZoneCoolBeam.idf with San Francisco weather). I confirmed that this change avoids the underflow exception there.

@Myoldmopar
Copy link
Member

Gotcha, I'm building on Windows now to verify the fix.

@Myoldmopar
Copy link
Member

Built debug builds of develop and this branch on Windows. Encountered the underflow exception in develop, and this branch passes successfully. This is good to go. Thanks @nealkruis!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Defect Includes code to repair a defect in EnergyPlus DoNotPublish Includes changes that shouldn't be reported in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Underflow due to tiny solar values
7 participants