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

parallel computing for storing output #716

Merged
merged 5 commits into from
Dec 22, 2023

Conversation

AminTorabi-NOAA
Copy link
Contributor

Update on write_flowveldepth_netcdf function for parallel computing. In this setup, each iteration of the loop prepares a job for parallel processing, and the Parallel block at the end executes all these jobs. The helper function will receive each subset of the data and be responsible for processing it and writing it to the appropriate file format.

Additions

  • helper function added and some part of the write_flowveldepth_netcdf function moved there for more readability

Removals

Changes

Testing

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

stream_output_internal_frequency = 5):
stream_output_internal_frequency = 5,
cpu_pool = 6,
use_parallel = True):
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this use_parallel has not been added to output.py when the function gets called? If you want to do it this way, you also need to determine when/how use_parallel is determined based on user input. I think you might be able to just drop this though and use only cpu_pool in the if/else statements. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sure. So I can just say if cpu_pul > 1 do parallel otherwise don't. The only caveat is user have to set cpu_pool = 1 in output.py not here (the value 6 here doesn't matter)

Copy link
Contributor

Choose a reason for hiding this comment

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

cpu_pool is already an input into nwm_output_generator in output.py, so it just needs to be added as in input into nhd_io.write_flowveldepth_netcdf()

@AminTorabi-NOAA AminTorabi-NOAA merged commit e149ba5 into NOAA-OWP:master Dec 22, 2023
4 checks passed
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