LIHPC-Computational-Geometry / coupe

the concurrent partitioner
https://LIHPC-Computational-Geometry.github.io/coupe/
Apache License 2.0
13 stars 3 forks source link

rcb for cartesian meshes #256

Closed hhirtz closed 2 years ago

hhirtz commented 2 years ago

Run the benchmark with

cargo bench --bench rcb_cartesian -- [--sample-size 10]

Run the test program with

cargo run -- WIDTH HEIGHT [RCB_ITERS]
codecov[bot] commented 2 years ago

Codecov Report

Base: 52.07% // Head: 49.37% // Decreases project coverage by -2.70% :warning:

Coverage data is based on head (ba6c80a) compared to base (f400e15). Patch coverage: 0.30% of modified lines in pull request are covered.

:exclamation: Current head ba6c80a differs from pull request most recent head 6914432. Consider uploading reports for the commit 6914432 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #256 +/- ## ========================================== - Coverage 52.07% 49.37% -2.71% ========================================== Files 36 38 +2 Lines 6924 7269 +345 ========================================== - Hits 3606 3589 -17 - Misses 3318 3680 +362 ``` | [Impacted Files](https://codecov.io/gh/LIHPC-Computational-Geometry/coupe/pull/256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LIHPC-Computational-Geometry) | Coverage Δ | | |---|---|---| | [src/cartesian.rs](https://codecov.io/gh/LIHPC-Computational-Geometry/coupe/pull/256/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LIHPC-Computational-Geometry#diff-c3JjL2NhcnRlc2lhbi5ycw==) | `0.00% <0.00%> (ø)` | | | [src/lib.rs](https://codecov.io/gh/LIHPC-Computational-Geometry/coupe/pull/256/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LIHPC-Computational-Geometry#diff-c3JjL2xpYi5ycw==) | `100.00% <ø> (ø)` | | | [src/main.rs](https://codecov.io/gh/LIHPC-Computational-Geometry/coupe/pull/256/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LIHPC-Computational-Geometry#diff-c3JjL21haW4ucnM=) | `4.76% <4.76%> (ø)` | | | [src/algorithms/recursive\_bisection.rs](https://codecov.io/gh/LIHPC-Computational-Geometry/coupe/pull/256/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LIHPC-Computational-Geometry#diff-c3JjL2FsZ29yaXRobXMvcmVjdXJzaXZlX2Jpc2VjdGlvbi5ycw==) | `91.58% <0.00%> (-0.26%)` | :arrow_down: | | [tools/src/lib.rs](https://codecov.io/gh/LIHPC-Computational-Geometry/coupe/pull/256/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LIHPC-Computational-Geometry#diff-dG9vbHMvc3JjL2xpYi5ycw==) | `0.17% <0.00%> (-0.02%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LIHPC-Computational-Geometry). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=LIHPC-Computational-Geometry)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

hhirtz commented 2 years ago

Grid size now use std::num::NonZeroUsize so that Grid::position_of cannot panic.

I also added 2D and 3D specializations for Grid::position_of:

image

becomes

image

also did it for Grid::index_of:

image

https://godbolt.org/z/PnnbP6Ef6

Benchmarks on a 1000x1000 grid (single-threaded)

before           time:   [42.831 ms 42.899 ms 42.976 ms]
nonzerousize     time:   [42.563 ms 42.625 ms 42.695 ms]
specialization   time:   [33.154 ms 33.301 ms 33.510 ms]