Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Test https://github.com/NREL/OpenStudio/pull/5194 #1242

Closed
wants to merge 4 commits into from

Conversation

joseph-robertson
Copy link
Contributor

Pull Request Description

[description here]

Checklist

Not all may apply:

  • Tests (and test files) have been updated
  • Documentation has been updated
  • Changelog has been updated
  • openstudio tasks.rb update_measures has been run
  • No unexpected regression test changes on CI (checked comparison artifacts)

@jmarrec
Copy link
Contributor

jmarrec commented May 15, 2024

I can consistently reproduce the crash, but it's weeeeeeeeeeird.

Using a docker, I ran

bundle install
sed -i -e 's/[[:space:]]*$//' resources/options_lookup.tsv # Remove whitespace
(sed -u 1q ; sort -k1 -k2) < resources/options_lookup.tsv > sorted_options_lookup.tsv
mv sorted_options_lookup.tsv resources/options_lookup.tsv # Sort on first two columns
openstudio workflow/run_analysis.rb -y project_testing/testing_upgrades.yml

Then I kept only testing_upgrades/buildstock.csv and modified the project_testing/testing_upgrades.yml to be

output_directory: testing_upgrades/output

sampler:
  type: precomputed
  args:
    sample_file: ../testing_upgrades/buildstock.csv

I also kept only two measures in the upgrades

That way I can consistently run the same datapoints via

openstudio workflow/run_analysis.rb -y project_testing/testing_upgrades.yml --keep_run_folders --debug -i 1 --threads 1
  • I can only reproduce the crash using a docker. If I run the same on my native ubuntu 20.04 machine, it does not crash!
  • I was trying to isolate the issue by dumping the runner.workflow before the crash by inserting a line just before
    apply_upgrade = runner.getPastStepValuesForMeasure('apply_upgrade') # FIXME: this causes a segfault for some reason
    • Either runner.workflow.saveAs('CURRENT_WORKFLOW.osw') or File.write("CURRENT_WORKFLOW.osw", runner.workflow.to_s)
    • Weirdly enough, if I do that,the crash is gone 🤷

@jmarrec
Copy link
Contributor

jmarrec commented May 15, 2024

I tried dumping the OSW instead in the ReportUtilityBills.rb measure (at the end of the run() I added runner.workflow.saveAs('../report_utility_bills_CURRENT_WORKFLOW.osw'))

The crash still happens in docker.

But if I pop into an irb/pry session and load it, no crash

require 'openstudio'
w = OpenStudio::WorkflowJSON.new('testing_upgrades/output/run2/run/report_utility_bills_CURRENT_WORKFLOW.osw')
runner = OpenStudio::Measure::OSRunner.new(w)
runner.getPastStepValuesForMeasure('apply_upgrade')
=> {:option_01_cost_1_multiplier_to_apply=>"Wall Area, Above-Grade, Conditioned (ft^2)",
 :option_01_cost_1_value_to_apply=>"2.21",
 :option_01_cost_2_multiplier_to_apply=>"",
[...]

@jmarrec
Copy link
Contributor

jmarrec commented May 15, 2024

Similarly, while I do see it crash with ruby launching

"/usr/local/openstudio-3.8.0-rc2/bin/openstudio" run -w "/var/simdata/openstudio/testing_upgrades/output/run2/testing_upgrades-Walls.osw"

If I issue the command myself in the docker, it works.

@afontani afontani closed this May 15, 2024
@joseph-robertson joseph-robertson deleted the test-os-5194 branch May 16, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants