Skip to content

Reducer: New wrapper class for ReduceOps and ReduceData#4933

Merged
WeiqunZhang merged 10 commits intoAMReX-Codes:developmentfrom
WeiqunZhang:reducer_mask
Feb 4, 2026
Merged

Reducer: New wrapper class for ReduceOps and ReduceData#4933
WeiqunZhang merged 10 commits intoAMReX-Codes:developmentfrom
WeiqunZhang:reducer_mask

Conversation

@WeiqunZhang
Copy link
Copy Markdown
Member

@WeiqunZhang WeiqunZhang commented Feb 3, 2026

I think this is easier to use than ReduceOps and ReduceData.

@WeiqunZhang WeiqunZhang marked this pull request as draft February 3, 2026 00:28
@WeiqunZhang
Copy link
Copy Markdown
Member Author

Let's compare performance with #4925.

@WeiqunZhang WeiqunZhang requested a review from ax3l February 3, 2026 00:30
@WeiqunZhang WeiqunZhang force-pushed the reducer_mask branch 3 times, most recently from 27e54b6 to d93c0d4 Compare February 3, 2026 00:35
@WeiqunZhang
Copy link
Copy Markdown
Member Author

WeiqunZhang commented Feb 3, 2026

Will add documentation later in this PR.

I think this is easier to use than ReduceOps and ReduceData.

Also add the capability of masking out results. The user still needs to
provide an arbitrary value (e.g., 0) of masked-out reduction to avoid
potential floating point exceptions.
@WeiqunZhang
Copy link
Copy Markdown
Member Author

/run-hpsf-gitlab-ci

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

@amrex-gitlab-ci-reporter
Copy link
Copy Markdown

GitLab CI 1410750 finished with status: success. See details at https://gitlab.spack.io/amrex/amrex/-/pipelines/1410750.

@WeiqunZhang
Copy link
Copy Markdown
Member Author

Unfortunately the performance is not what we like. Below are results from perlmutter. The no-mask runs used the development branch

| mask              |    CPU |      GPU |
|-------------------+--------+----------|
| 1/5               | 0.0872 | 0.000948 |
| 3/5               | 0.1215 | 0.001256 |
| 5/5               | 0.1605 | 0.001400 |
| no mask, 5-tuple  | 0.1228 | 0.001369 |
|-------------------+--------+----------|
| 1/30              | 1.9000 | 0.009122 |
| 5/30              | 1.9757 | 0.011989 |
| 10/30             | 1.8627 | 0.014982 |
| 15/30             | 1.8612 | 0.018074 |
| 20/30             | 1.8955 | 0.020463 |
| 25/30             | 2.1386 | 0.021982 |
| 30/30             | 2.1604 | 0.021791 |
| no mask, 30-tuple | 1.1798 | 0.012412 |

@ax3l For ImpactX, the best approach might be to have a few common combination of reductions, instead of truly runtime.

@WeiqunZhang
Copy link
Copy Markdown
Member Author

I still like the new wrapper class, but I am going to remove the mask from it.

@WeiqunZhang WeiqunZhang marked this pull request as ready for review February 4, 2026 01:47
@WeiqunZhang
Copy link
Copy Markdown
Member Author

/run-hpsf-gitlab-ci

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 4, 2026

@amrex-gitlab-ci-reporter
Copy link
Copy Markdown

GitLab CI 1412008 finished with status: failed. See details at https://gitlab.spack.io/amrex/amrex/-/pipelines/1412008.

@asalmgren asalmgren self-requested a review February 4, 2026 05:15
@WeiqunZhang WeiqunZhang merged commit c3c8f71 into AMReX-Codes:development Feb 4, 2026
74 checks passed
@WeiqunZhang WeiqunZhang deleted the reducer_mask branch February 4, 2026 18:27
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