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

Bypass interior solar distribution calculation at night #8182

Merged
merged 4 commits into from
Aug 12, 2020

Conversation

lgu1234
Copy link
Contributor

@lgu1234 lgu1234 commented Aug 3, 2020

Pull request overview

LBL identified 20 hotspots for speed improvement. InitIntSolarDistribution is one of hotspots. The interior solar distribution calculation is performed every time step. The present check-in bypasses the calculation at night, because no solar is available at night.

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 any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

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
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

// IntDifIncInsSurfAmountRep(SurfNum) = IntDifIncInsSurfIntensRep(SurfNum) * &
// (Surface(SurfNum)%Area + SurfaceWindow(SurfNum)%DividerArea)
// IntDifIncInsSurfAmountRepEnergy(SurfNum) = IntDifIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec
if (SunIsUp) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do any variables need to be set to 0 when the sun is down? I wonder if the last time these variables were calculated when the sun was up will be used during the night. Maybe they are set to 0 elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rraustad There are 3 variables inside section:

            IntBmIncInsSurfIntensRep(SurfNum) 
            IntBmIncInsSurfAmountRep(SurfNum) 
            IntBmIncInsSurfAmountRepEnergy(SurfNum)

The variables are initialized at 0 in the beginning of InitSolarHeatGains before calling InitIntSolarDistribution. Therefore, no additional initialization is needed.

@lgu1234 lgu1234 added the Performance Includes code changes that are directed at improving the runtime performance of EnergyPlus label Aug 5, 2020
@Nigusse Nigusse self-assigned this Aug 10, 2020
@Nigusse
Copy link
Contributor

Nigusse commented Aug 10, 2020

This is clean modification for performance. I will update the branch, run the unit tests locally and push the branch.

@Nigusse
Copy link
Contributor

Nigusse commented Aug 10, 2020

@Myoldmopar Run the unit test locally and all passed. If the CI machine comes clean, this branch can be merged in.

@Myoldmopar
Copy link
Member

Thanks for looking it over and running tests, @Nigusse. CI looks happy so far, I'll take a final peek and if all is well it should merge in the morning.

@Nigusse Nigusse self-requested a review August 11, 2020 13:18
Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like primarily just formatting cleanup here, and that the actual functional changes are minimal. I share @rraustad's concern that skipping over the functionality could end up leaving variables with previous data. I see you have determined which variables are used and that they are properly initialized, so I will take that, and also rely on CI to show whether this causes any unexpected diffs.

@Myoldmopar
Copy link
Member

And as I already noted, CI is not showing any diffs at all, so I feel good about these changes. I'm going to pull in develop locally just to verify, but I assume this will go in shortly.

Copy link
Contributor

@Nigusse Nigusse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The report variables are already initialized earlier. I am okay with the current fix.

@Myoldmopar
Copy link
Member

Thanks for the fix @lgu1234 and for reviewing, @Nigusse. The unit tests pass locally with develop pulled in. Merging now.

@Myoldmopar Myoldmopar merged commit c1628a0 into develop Aug 12, 2020
@Myoldmopar Myoldmopar deleted the BypassAtNight branch August 12, 2020 17:11
@Myoldmopar
Copy link
Member

@lgu1234 there wasn't an issue or Pivotal ticket for this, was there? If so assign them to me so I can close them.

@lgu1234
Copy link
Contributor Author

lgu1234 commented Aug 12, 2020

@Myoldmopar This PR does not have an issue and an associated Pivotal ticket. Thanks.

@lgu1234
Copy link
Contributor Author

lgu1234 commented Aug 12, 2020

@Nigusse I just created an issue as Bypass interior solar distribution calculation at night #8201and a Pivotal ticket as #174304363.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Performance Includes code changes that are directed at improving the runtime performance of EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants