NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
486 stars 186 forks source link

Error messages "already initialized constant" when running OSW workflow #5081

Open macumber opened 6 months ago

macumber commented 6 months ago

Issue overview

When running a workflow with the TBD measure (https://github.com/rd2/tbd/releases/tag/v3.4.0) there are a bunch of error messages about "warning: already initialized constant" that occur when adding output reports. I think this might be because the runner re-loads the measure a second time so any constants are redefined. However, this second load is not something the measure writer can really control.

Current Behavior

The "warning: already initialized constant" messages might be confusing to users

Expected Behavior

There should be no "warning: already initialized constant" error messages.

Steps to Reproduce

  1. Create workflow with TBD measure (https://github.com/rd2/tbd/releases/tag/v3.4.0)
  2. Run workflow with openstudio.exe --verbose run --show-stdout -w workflow.osw
  3. Notice that "warning: already initialized constant" warnings occur after "Beginning to collect output requests from Reporting measures."

Possible Solution

Maybe it is possible to clear constants between running measures? Might be possible to list constants/globals before and after each measure run and clear those after each run?

Details

Environment

Some additional details about your environment for this issue (if relevant):

Context

Confusing to users, potentially makes users think there are issues with the measure

macumber commented 6 months ago

@brgix FYI

brgix commented 6 months ago

EDIT: @macumber, these messages do pop up when running either the OSM or prototype test suites. Sorry for the confusion.

DavidGoldwasser commented 6 months ago

@shorowit and @joseph-robertson I think you may use global constants across measures? Just wanted to tag you on this so any changes made for this don't negativity impact those workflows.