NREL / resstock

Highly granular modeling of residential building stocks at national, regional, and local scales using OpenStudio/EnergyPlus.
https://resstock.nrel.gov
Other
103 stars 51 forks source link

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

Closed joseph-robertson closed 1 month ago

joseph-robertson commented 1 month ago

Pull Request Description

[description here]

Checklist

Not all may apply:

jmarrec commented 1 month ago

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
jmarrec commented 1 month ago

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 commented 1 month ago

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.