-
Notifications
You must be signed in to change notification settings - Fork 32
Performance improvements to 3D winding number query #1777
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
base: develop
Are you sure you want to change the base?
Conversation
| query_mesh --min -0.5 -0.5 --max 0.5 0.5 --res 3 3 --slice-z 0.0 --order 1) | ||
| set_tests_properties(quest_winding_number_3d_tet_slice PROPERTIES | ||
| PASS_REGULAR_EXPRESSION "4 patches .* 12 trimming curves") | ||
| # 3D query regression-style runs (20^3 grid) over several STEP models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a bunch of tests to track performance and correctness as I worked through these optimizations.
We should not merge this into develop as is since it'll be too slow for debug configs.
Before merging, I'll update the tests to run at a reasonable resolution for normal testing.
| return m_curveQuadratureMaps[curveIndex][hash_key]; | ||
| // Cache quadrature data per trimming curve keyed by (refinementLevel, refinementIndex). | ||
| // Note: `quadNPts` is fixed in the 3D winding-number implementation (currently 15). | ||
| const auto make_key = [](int level, int index) -> std::uint64_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These map enhancements are related to things I did in my branch. I combined the curveIndex, refinementLevel and refinementIndex into a single std::uint64_t and ditched the axom::Array too. It was worth it in my timings, and it sped up creating the caches on multiple threads.
|
|
||
| struct DerivativeBasisWorkspace | ||
| { | ||
| axom::Array<T> ders; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are up to 5 array allocations here. Based on how these are used, it looks like they could be replaced with views that point into a single axom::Array that contains the storage for all of the arrays. On thinking about this some more, it looks like they probably do not resize that often.
Optionally computes and prints the L2 and Linf norms of the fields and the number of nonzero containment entries and inout volume.
Uses a FlatMap instead of a std::map, and try_emplace to avoid extra lookups.
…pan() to avoid excessive mallocs The associated memory will be retained between runs. Note: This will not work for device
Increases resolution on faster tests and updates baselines. Adds a test for the boxed_sphere.
Uses std::unordered_map instead of std::map.
Moves swithc for cases out of for loop.
Avoids extra allocations and divisions.
2f4463b to
8501b4a
Compare
Summary
feature/kweiss/wn-example-3Dbranch