Skip to content

Conversation

@joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Dec 2, 2025

Pull request overview

File run_translation.rb in the OpenStudio-workflow-gem has a return before FT, but OSWorkflow.cpp in OpenStudio's src/workflow folder does not. We'll now expect no in.idf or pre-preprocess.idf.

Furthermore, the OpenStudio-workflow-gem saves the model to in.osm even if the workflow was halted. This PR maintains that behavior.

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • 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

@joseph-robertson joseph-robertson self-assigned this Dec 2, 2025
@joseph-robertson joseph-robertson added severity - Normal Bug component - Workflow Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Dec 2, 2025
@joseph-robertson joseph-robertson changed the base branch from develop to 3.11.0-rc1 December 2, 2025 20:36
@joseph-robertson joseph-robertson changed the title Return before FT for halted workflow For halted workflow, return before FT and OSM save Dec 2, 2025
@joseph-robertson joseph-robertson changed the base branch from 3.11.0-rc1 to develop December 4, 2025 16:43
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

🧪 Test Results Dashboard

Summary

Metric Value
Total Tests 4156
Passed 4146
Failed 10
Errors 0
Skipped 0
Success Rate 99.8%
Generated 2025-12-15 16:46:56 UTC

⚠️ Minor Issues Detected

🔍 Failed Tests (10 failures)

Linux-c++ (10 failures)

OpenStudioCLI.Classic.test_measure_manager.OpenStudioCLI.Classic.test_measure_manager (run1)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle.CLITest-test_bundle-bundle (run1)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle_git.CLITest-test_bundle-bundle_git (run1)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle_native_embedded.CLITest-test_bundle-bundle_native_embedded (run1)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle.CLITest-test_bundle-bundle (run3)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle_git.CLITest-test_bundle-bundle_git (run3)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle_native_embedded.CLITest-test_bundle-bundle_native_embedded (run3)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle.CLITest-test_bundle-bundle (run2)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle_git.CLITest-test_bundle-bundle_git (run2)

Error Message:

Failed

Full Details:

No details available
CLITest-test_bundle-bundle_native_embedded.CLITest-test_bundle-bundle_native_embedded (run2)

Error Message:

Failed

Full Details:

No details available

📊 Test Run Information

Run XML File Status
run1 results.xml ✅ Found
run3 results.xml ✅ Found
run2 results.xml ✅ Found

@joseph-robertson joseph-robertson marked this pull request as ready for review December 5, 2025 23:27
LOG(Info, "Workflow halted, skipping OSM to IDF translation");
// This allows model arguments to still be calculated
workspace_ = Workspace{};
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

that's ok.

Comment on lines 197 to 201
// Skip saving the OSM if halted
if (runner.halted()) {
LOG(Info, "Workflow halted, skipping saving the OSM");
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure whether we actually want this or not.

This is saving to root dir only if debug.

And the in.osm is saved in the run/ folder anyways.

Also, It's say the source of truth should be the classic CLI. Run this example https://github.com/NREL/OpenStudio-workflow-gem/blob/4a799dbf4c5477610c9e9665dfa7729fe74fc52e/spec/files/halt_workflow_osw/halt_workflow.osw

cd OpenStudio-workflow-gem/spec/files/halt_workflow_osw
openstudio classic --verbose run --show-stdout --debug -w halt_workflow.osw

I do end up with the "in.osm" (and in.idf, empty) in the root dir.

Copy link
Collaborator

Choose a reason for hiding this comment

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

git clean -fxd
openstudio classic --verbose run --show-stdout -w halt_workflow.osw
git ls-files . --ignored --exclude-standard --others
out.osw
run/data_point.zip
run/data_point_out.json
run/finished.job
run/in.osm
run/measure_attributes.json
run/objectives.json
run/pre-preprocess.idf
run/results.json
run/run.log
run/started.job

Copy link
Collaborator

Choose a reason for hiding this comment

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

Before fix

git clean -fxd
openstudio run --show-stdout -w halt_workflow.osw
git ls-files . --ignored --exclude-standard --others
out.osw
run/data_point.zip
run/data_point_out.json
run/finished.job
+ run/in.idf
run/in.osm
run/measure_attributes.json
run/pre-preprocess.idf  # And this is full of stuff
run/results.json
run/run.log
run/started.job

Copy link
Collaborator

Choose a reason for hiding this comment

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

With this PR:

git clean -fxd
$os_build/Products/openstudio run --show-stdout -w halt_workflow.osw
git ls-files . --ignored --exclude-standard --others

I still have run/in.idf and run/pre-processed.idf but at least they contain only the "Version" object.

(py312)(3.2.2)julien@halt_workflow_osw (master *=)$ cat run/in.idf 

Version,
  25.2.0;                                 !- Version Identifier

(py312)(3.2.2)julien@halt_workflow_osw (master *=)$ cat run/pre-preprocess.idf 

Version,
  25.2.0;                                 !- Version Identifier

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So with halt workflow (debug or not), we'll now expect no in.idf or pre-preprocess.idf, but we'll still expect an (almost empty) in.osm?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, in.osm would not be necessarily empty
Seed + whatever measure ran until halted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And the reason for preserving in.osm is mainly to stay consistent with the classic workflow? You don't think it makes more sense to not produce the in.osm?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Consistent with workflow-gem.

And I could see myself wanting to look at in.osm (I could halt workflow before FT for that reason: don't fail, but produce the model with measures applied). Anyways, if I even think there's a valid application out there and I don't see a strong drawback, I'd want to keep the existing behavior in check.

And I do not see a strong drawback here (only one I can think of is disk space, but that's not a very pressing concern).

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that you can specify the "completed status" when you halt the workflow, and it can be "Success", "Fail", "Invalid", and "Cancel". We are using "Invalid" in ResStock, which arguably could mean that you shouldn't get an in.osm. But it's not the end of the world. The most important thing is to not get an in.idf, considering that you won't be running the simulation.

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 8, 2025

@joseph-robertson I'm tempted to say that the RunPreprocess check for halted is misplaced in the original workflow gem: https://github.com/NREL/OpenStudio-workflow-gem/blob/4a799dbf4c5477610c9e9665dfa7729fe74fc52e/lib/openstudio/workflow/jobs/run_preprocess.rb#L46-L49

the C++ implementation does it exactly the same.

// Skip the pre-processor if halted
if (runner.halted()) {
LOG(Info, "Workflow halted, skipping the EnergyPlus pre-processor");
return;
}

I don't see why you would create pre-process.idf and apply energyplus output requests if you halted, and didn't create an IDF to begin with.

(But then again, I completely fail to see what haltWorkflow is all about since I never had a use case for it)

…): no point creating pre-process.idf nor collecting E+ output requests
@shorowit
Copy link
Contributor

shorowit commented Dec 8, 2025

(But then again, I completely fail to see what haltWorkflow is all about since I never had a use case for it)

It’s possible that ResStock (and I assume ComStock) are the only users of it. It’s used to skip simulations when an upgrade doesn’t apply to a given building sample. See #2601

@jmarrec
Copy link
Collaborator

jmarrec commented Dec 9, 2025

@anchapin the windows node is offline and can't be launched from jenkins admin panel

https://ci.openstudio.net/computer/openstudio%2Dwin%2Dserver%2Dvs%2D2019%2Dssh%2Dincr%2Daws/log

SSHLauncher{...}
[12/09/25 08:07:16] [SSH] Opening SSH connection to xxx.xxx.xxx.xxx

No route to host (Host unreachable)
SSH Connection failed with IOException: "No route to host (Host unreachable)", retrying in 30 seconds. There are 3 more retries left.

@anchapin
Copy link
Collaborator

anchapin commented Dec 9, 2025

@anchapin the windows node is offline and can't be launched from jenkins admin panel

https://ci.openstudio.net/computer/openstudio%2Dwin%2Dserver%2Dvs%2D2019%2Dssh%2Dincr%2Daws/log

SSHLauncher{...}
[12/09/25 08:07:16] [SSH] Opening SSH connection to xxx.xxx.xxx.xxx

No route to host (Host unreachable)
SSH Connection failed with IOException: "No route to host (Host unreachable)", retrying in 30 seconds. There are 3 more retries left.

I'm working on making a new windows node on AWS since our old one had to be shut down. I'm hoping it will be ready soon but I'm dealing with 'packer' difficulties.

@joseph-robertson
Copy link
Collaborator Author

joseph-robertson commented Dec 11, 2025

Run folder:

Before
image

After
image

@ci-commercialbuildings
Copy link
Collaborator

ci-commercialbuildings commented Dec 15, 2025

CI Results for bd3c759:

@joseph-robertson joseph-robertson merged commit 5eac20d into develop Dec 15, 2025
3 of 6 checks passed
@joseph-robertson joseph-robertson deleted the fix-halt-workflow branch December 15, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component - Workflow Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. severity - Normal Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants