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

edits to only calculate subnetworks on first iteration of for loops #557

Merged
merged 1 commit into from
Apr 29, 2022

Conversation

shorvath-noaa
Copy link
Contributor

Changes made to only calculate subnetworks on first iteration of for loops. Subnetwork objects needed in compute.py are stored in a new list, subnetwork_list, which is passed to and returned from functions nwm_route and compute_nhd_routing_v02.

Additions

  • New object, subnetwork_list, stores either two (for "by-subnetwork-jit-clustered") or three (for "by-subnetwork-jit") subnetwork objects.
  • subnetwork_list is passed to and returned from two functions, nwm_route and compute_nhd_routing_v02, as second item in list. The first item is the original returns from these functions.
  • Original returns and subnetwork list are extracted as individual objects upon completion of functions nwm_route and compute_nhd_routing_v02 so as to not interfere with ensuing operations to results.

Removals

Changes

Testing

  1. Tested that code completes with loops for all parallel compute methods

Screenshots

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Target Environment support

  • Windows
  • Linux
  • Browser

Accessibility

  • Keyboard friendly
  • Screen reader friendly

Other

  • Is useable without CSS
  • Is useable without JS
  • Flexible from small to large screens
  • No linting errors or warnings
  • JavaScript tests are passing

@shorvath-noaa
Copy link
Contributor Author

@awlostowski-noaa
I got the problem sorted, the model now runs without issues for both methods that require calculation of subnetworks.

BrianAvant
BrianAvant approved these changes Apr 29, 2022
Copy link
Collaborator

@BrianAvant BrianAvant left a comment

Choose a reason for hiding this comment

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

I am clocking a 40x speed up in routing computational time and a 20x improvement in total execution time for hybrid diffusive routing w natural cross sections. Outstanding.

Upon further testing I am not seeing a significant difference in execution time for any of the parallel_compute_methods. I had changed the use_natl_xsections flag in the default config but run_hybrid_routing was still set to False.. All changes to parallel_compute_methods are stable though and run for each of the hybrid scenarios including the refactored network.

@BrianAvant BrianAvant merged commit 851694b into NOAA-OWP:master Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants