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

Feature #2724 mode_openmp #2726

Merged
merged 13 commits into from
Nov 7, 2023
Merged

Conversation

JohnHalleyGotway
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway commented Nov 6, 2023

Expected Differences

This PR includes the following changes:

  1. Update User's Guide with info about OpenMP in MODE.
  2. Refine DataPlane debug functions to make them loop over the data more efficiently and refine their log messages.
  3. Enhance interest.cc:
  • Do the convolution step much more efficiently by updating the algorithm and including OpenMP.
  • Update the SingleFeature class to store a pointer to the split field rather than mask field for each object.
  1. Enhance engine.cc:
  • Stop allocating a full grid of memory for each objects by operating on the SingleFeature split field rather than the mask field.
  • Implement major changes to do_fcst/obs_merge_thresh() function to avoid memory allocation using a map of simple object to cluster ids and vice-versa.
  1. Remove OpenMP from ensemble_stat.cc since it isn't actually used there anymore.
  • Do these changes introduce new tools, command line arguments, or configuration file options? [No]

    If yes, please describe:

  • Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [No]

    If yes, please describe:

Pull Request Testing

  • Describe testing already performed for these changes:

    • Ran some timing tests for MODE using the 3km CONUS HRRR grid, as described in this issue comment. The enhanced convolution algorithm, along with OpenMP improve the runtime.
    • Ran this GHA run during development to confirm that no diffs are introduced.
  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

    • @davidalbo, please confirm that the GHA run for this PR flags no diffs and review the logic of the code changes.
    • @hertneky, please review the doc updates and code changes, as you'd like.
  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes]

    • Added MODE to the list of tools for which OMP_NUM_THREADS can be set.
    • Removed Ensemble-Stat from that list since it no longer computes NMEP.
  • Do these changes include sufficient testing updates? [Yes]

    • I made no testing changes. I could set OMP_NUM_THREADS for MODE, but we're already doing a NP = 0 vs 2 for Grid-Stat. I don't think we need to do the same for MODE.
  • Will this PR result in changes to the test suite? [No]

    If yes, describe the new output and/or changes to the existing output:

  • Please complete this pull request review by [Tues Nov 7].

Pull Request Checklist

See the METplus Workflow for details.

  • Review the source issue metadata (required labels, projects, and milestone).
  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the version that will include these changes
    Select: Coordinated METplus-X.Y Support project for bugfix releases or MET-X.Y.Z Development project for official releases
  • After submitting the PR, select the ⚙️ icon in the Development section of the right hand sidebar. Search for the issue that this PR will close and select it, if it is not already selected.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

…ince its declared as const. The GNU compiler on seneca errors out when constants are included in the shared list while the GNU compiler on my Mac laptop doesn't complain.
… object for each field. Still more work to do to reduce memory usage and also apply OpenMP to the ShapeData::select() function.
…() to exactly reproduce existing results. There were some subtle diffs in the handling of missing data and points off the grid.
…ikely a way to make the memory usage for efficient but it'll require a tweak to the logic.
…ld rather than the individual object fields. And compute pair intersection, union, and sym diff counts from the split field rather than the object fields. This avoid allocating memory for many, many copies of the input grid, which can be quite large depending on the resolution.
…were computing NMEP outputs. That was removed from ensemble-stat in MET version 11.1 but the OpenMP setup remained there. This removes it from ensemble-stat and updates the documentation to accurately indicate that OpenMP currently applies to gen-ens-prod, grid-stat, and now mode.
…ions to be more efficient by accessing the vector of data rather than the slower get(x,y) data accessor function.
…bosity level to avoid unnecessary loops through the data. Note that all calls to the logger would actually create the log message and the logger decides whether or not to print it. Wrapping expensive debugging log messages in vebosity level check is more efficient.
Copy link
Contributor

@davidalbo davidalbo left a comment

Choose a reason for hiding this comment

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

I approve this pull request. I didn't go over this in great detail, the changes look pretty significant. All the unit tests did run successfully, it seems, and your changes are all compatible with those parts of the mode code that I am also modifying. Maybe you can go over what you did with me at some point, so I can learn more. For example you added a 'split' input to SingleFeature::set(), for (I'm sure) a good reason.

… diff a bit more efficient by accessing the data() array directly rather than range-checking with the data(x,y) accessor function.
@JohnHalleyGotway JohnHalleyGotway merged commit 46cf0db into develop Nov 7, 2023
34 checks passed
@JohnHalleyGotway JohnHalleyGotway deleted the feature_2724_mode_openmp branch November 7, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏁 Done
Development

Successfully merging this pull request may close these issues.

Enhance MODE to use OpenMP to make the convolution step faster
3 participants