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

Adds pthreads dependency for UnitsHelper #419

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

mattw-nws
Copy link
Contributor

Adds explicit dependency on threading for unit conversion (in core_mediator library). This eliminates "Unknown error -1" messages from the unit conversion code and makes output match between builds with no MPI or Python enabled and builds with MPI or Python (or both) enabled. (Enabling Python or MPI causes pthreads to be linked implicitly.) Without this, all unit conversion fails if ngen is built without Python or MPI, which resulted in a mismatch in output between builds without Python/MPI and builds with either.

Additions

  • Added CMakeLists directives to require pthreads

Removals

Changes

Testing

  1. Manual tests on builds without Python or MPI, checking/comparing output with Python/MPI enabled builds. (Notably: GoogleTest builds with pthreads, so the automated tests pass without this fix!)

  2. Checking binary dependencies with ldd

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
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist (automated report can be put here)

Target Environment support

  • Linux

@mattw-nws mattw-nws requested review from hellkite500 and stcui007 May 31, 2022 15:43
@stcui007
Copy link
Contributor

stcui007 commented Jun 1, 2022

I have tested this bug fix on Sugar Creek, HUC01, and a small artificial hydrofabric. They all give consistent results between the serial run and parallel runs with a number of chosen CPU cores: 8, 16, 32, 64, 96. So it looks like this fixes the issue encountered.

Copy link
Contributor

@stcui007 stcui007 left a comment

Choose a reason for hiding this comment

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

Has left a comment.

@hellkite500 hellkite500 merged commit b425113 into master Jun 1, 2022
@hellkite500 hellkite500 deleted the unit-conv-pthreads-dependency-fix branch June 1, 2022 22:30
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.

3 participants