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

3835 improve cli runtime #4028

Merged
merged 3 commits into from
Aug 7, 2020
Merged

3835 improve cli runtime #4028

merged 3 commits into from
Aug 7, 2020

Conversation

lefticus
Copy link
Contributor

Pull request overview

lefticus added 2 commits July 18, 2020 13:10
 * Module.autoload is used to load openstudio_init_extended.rb
 * Any access to any of the OpenStudio:: sub-namespaces triggers this load

On test system "puts 'Hello World'" test decreases from .53s to .33s

Addresses #3835
@lefticus lefticus added Enhancement Request Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Jul 28, 2020
@tijcolem
Copy link
Collaborator

tijcolem commented Aug 5, 2020

Thanks @lefticus! I tested and the speedup on this is impressive, especially when just running ruby scripts using the cli.
However, I ran into an error running our regression tests though.

$ openstudio model_tests.rb -n test_plenums_rb

# Running tests with run options :

Running for OpenStudio 3.0.1-beta+70fa46c421
Running for OpenStudio 3.0.1-beta+70fa46c421 (Previous=3.0.0)

# Running tests with run options -n test_plenums_rb --seed 58235:

E

Finished tests in 5.741190s, 0.1742 tests/s, 0.0000 assertions/s.


Error:
ModelTests#test_plenums_rb:
RuntimeError: Exit code 1:
Error executing argv: ["run", "-w", "/home/ubuntu/OpenStudio-resources/testruns/plenums.rb/in.osw"]
Error: superclass must be a Class (NilClass given) in :/ruby/2.5.0/gems/openstudio-workflow-2.0.0/lib/openstudio/workflow_runner.rb:42:in `<main>'
eval:175:in `eval'
eval:175:in `require_embedded_absolute'
eval:108:in `require'
:/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
eval:192:in `require_relative'
:/ruby/2.5.0/gems/openstudio-workflow-2.0.0/lib/openstudio-workflow.rb:50:in `<main>'
eval:175:in `eval'
eval:175:in `require_embedded_absolute'
eval:160:in `block in require_embedded'
eval:154:in `each'
eval:154:in `require_embedded'
eval:129:in `rescue in require'
eval:95:in `require'
:/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
:/openstudio_cli.rb:914:in `execute'
:/openstudio_cli.rb:760:in `execute'
:/openstudio_cli.rb:1754:in `<main>'
eval:175:in `eval'
eval:175:in `require_embedded_absolute'
eval:160:in `block in require_embedded'
eval:154:in `each'
eval:154:in `require_embedded'
eval:113:in `require'
eval:3:in `<main>'

    /home/ubuntu/OpenStudio-resources/test_helpers.rb:352:in `block in run_command'
    :/ruby/2.5.0/open3.rb:205:in `popen_run'
    :/ruby/2.5.0/open3.rb:95:in `popen3'
    /home/ubuntu/OpenStudio-resources/test_helpers.rb:336:in `run_command'
    /home/ubuntu/OpenStudio-resources/test_helpers.rb:699:in `sim_test'
    /home/ubuntu/OpenStudio-resources/model_tests.rb:602:in `test_plenums_rb'

1 tests, 0 assertions, 0 failures, 1 errors, 0 skips

Steps to reproduce.
On Ubuntu 18.04 Image


$ wget https://openstudio-ci-builds.s3-us-west-2.amazonaws.com/incremental/develop/4028/OpenStudio-3.0.1-beta%2B70fa46c421-Linux.deb  # Test package from this PR. 
$ sudo dpkg -i OpenStudio-3.0.1-beta+70fa46c421-Linux.deb 
$ git clone https://github.com/NREL/OpenStuido-resources && cd OpenStuido-resources
$ openstudio model_tests.rb -n test_plenums_rb # Any test will yeild the same error.  



@tijcolem
Copy link
Collaborator

tijcolem commented Aug 7, 2020

Thanks @jmarrec. That did and now test is passing. This is good to go.

@tijcolem tijcolem merged commit ff4cf58 into develop Aug 7, 2020
@tijcolem tijcolem deleted the 3835_ImproveCLIRuntime branch August 7, 2020 14:29
@lefticus
Copy link
Contributor Author

Thanks @jmarrec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Request Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve CLI runtime?
4 participants