parthenon icon indicating copy to clipboard operation
parthenon copied to clipboard

Add `par_reduce_inner` functions

Open bprather opened this issue 1 year ago • 2 comments

All credit for these to @pdmullen! I will fix bugs if they come up though.

At some point @pdmullen sent me some implementations of inner loops for performing reductions, i.e. par_for_inner but for par_reduce. This is useful if reducing to a vector, replacing values with an average, etc.

I am using the 1D variant in production happily, but haven't needed the 2D and 3D versions yet -- it seems difficult to believe they're incorrect though. I'm poking them upstream as a part of reducing the changeset between KHARMA's parthenon and develop, which is now quite small!

It might be useful to have a unit test for these, which I can add soon.

PR Checklist

  • [ ] Code passes cpplint
  • [ ] New features are documented.
  • [ ] Adds a test for any bugs fixed. Adds tests for new features.
  • [ ] Code is formatted
  • [ ] Changes are summarized in CHANGELOG.md
  • [ ] Change is breaking (API, behavior, ...)
    • [ ] Change is additionally added to CHANGELOG.md in the breaking section
    • [ ] PR is marked as breaking
    • [ ] Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • [ ] CI has been triggered on Darwin for performance regression tests.
  • [ ] Docs build
  • [ ] (@lanl.gov employees) Update copyright on changed files

bprather avatar Jul 31 '24 22:07 bprather

Does #1142 provide this functionality @acreyes?

lroberts36 avatar Aug 01 '24 01:08 lroberts36

Does #1142 provide this functionality @acreyes?

It doesn't at the moment, but it should be straightforward to add

acreyes avatar Aug 08 '24 15:08 acreyes