Skip to content

Feature: Faster histogram construction when the number of bins exceeds 80#162

Merged
rouson merged 2 commits into
mainfrom
speed-up-histograms
Jun 26, 2024
Merged

Feature: Faster histogram construction when the number of bins exceeds 80#162
rouson merged 2 commits into
mainfrom
speed-up-histograms

Conversation

@rouson

@rouson rouson commented Jun 24, 2024

Copy link
Copy Markdown
Contributor

This pull request switches the cloud-microphysics histogram_t constructor to using a different algorithm when the number of bins exceeds a threshold of 80, above which the new algorithm out-performs the original algorithm. The original algorithm used do concurrent, but required accessing the entire data once per bin. The new algorithm is inherently serial, but only accesses the data set once, keeping a running tally of the bin count. In a future commit, the new algorithm will also use do concurrent with compilers that support Fortran 2023 reduce locality.

This commit switches the `cloud-microphysics` `histogram_t`
constructor to using a different algorithm when the number of bins
reaches a threshold of 80, at which value the new algorithm
outperforms the original algorithm.  The original algorithm used
`do concurrent`, but required accessing the entire data once per
bin. The new algorithm is inherently serial, but only accesses the
data set once, keeping a running tally of the bin count.
@rouson rouson force-pushed the speed-up-histograms branch from b9c3fc9 to c15c9d2 Compare June 24, 2024 04:56
@rouson rouson force-pushed the speed-up-histograms branch from 2639452 to 9d69ccb Compare June 25, 2024 04:29
@rouson rouson marked this pull request as ready for review June 25, 2024 16:11
@rouson rouson requested a review from davytorres June 25, 2024 16:11
@rouson rouson merged commit f97d59f into main Jun 26, 2024
@rouson rouson deleted the speed-up-histograms branch June 26, 2024 17:08
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