Skip to content
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

precompute natural coodinates. #300

Conversation

MFraters
Copy link
Member

@MFraters MFraters commented Jul 3, 2021

Found in #219. Moves the computation of the natural coordinates outside the feature loop and pass it as a reference. This will also contain a commit later to pass the natural coordinates by reference to the distance from curved planes function.

Although it currently looks kinda inconsistent to have a value called point and one called natural_coordinate, I don't think it is a good idea to make them consistent in this pull request, and focus here on the functional change.

edit: although I am open to changing the names in a last seperate commit here or in a new pull request.

@codecov
Copy link

codecov bot commented Jul 3, 2021

Codecov Report

Merging #300 (66200b5) into master (578f0eb) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #300      +/-   ##
==========================================
- Coverage   98.98%   98.98%   -0.01%     
==========================================
  Files          74       74              
  Lines        4155     4142      -13     
==========================================
- Hits         4113     4100      -13     
  Misses         42       42              
Impacted Files Coverage Δ
source/features/continental_plate.cc 100.00% <ø> (ø)
source/features/fault.cc 99.07% <ø> (-0.01%) ⬇️
source/features/mantle_layer.cc 100.00% <ø> (ø)
source/features/oceanic_plate.cc 100.00% <ø> (ø)
source/features/subducting_plate.cc 99.08% <ø> (-0.01%) ⬇️
source/utilities.cc 98.99% <100.00%> (-0.01%) ⬇️
source/world.cc 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 578f0eb...66200b5. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jul 3, 2021

Benchmark Master Feature Difference (99.9% CI)
Slab interpolation simple none 1.152 ± 0.229 (s=392) 1.147 ± 0.208 (s=394) -4.9% .. +4.0%
Slab interpolation curved simple none 1.422 ± 0.039 (s=293) 1.421 ± 0.043 (s=343) -0.8% .. +0.7%
Spherical slab interpolation simple none 1.401 ± 0.008 (s=322) 1.369 ± 0.010 (s=330) -2.5% .. -2.1%
Slab interpolation simple curved CMS 1.541 ± 0.051 (s=306) 1.545 ± 0.050 (s=280) -0.7% .. +1.1%
Spherical slab interpolation simple CMS 4.315 ± 0.020 (s=99) 4.109 ± 0.013 (s=118) -5.0% .. -4.6%
Spherical fault interpolation simple none 1.834 ± 0.013 (s=239) 1.620 ± 0.004 (s=288) -11.9% .. -11.5%

@MFraters MFraters force-pushed the precompute_natueral_coordinates branch from f77f358 to f981a57 Compare July 3, 2021 23:12
@MFraters MFraters added the performance Requests or proposes performance improvements label Jul 3, 2021
@MFraters
Copy link
Member Author

MFraters commented Jul 4, 2021

I think this pull request is also good to go. Thanks for suggesting this @bangerth!
This builds on the improvements made in #301. The benchmarks indicate that it either makes no difference or is significantly faster. My tests also show that it can be sigificantly faster (more than indicated by these benchmarks). I don't like the long namespace identifier WorldBuilder::Utilities::NaturalCoordinate, but that is just needed unless I want to define a using, which will conflict with the features utilities namespace making it even messier.

Also related to the work done in #264

@MFraters
Copy link
Member Author

MFraters commented Jul 4, 2021

It is important to note that this pull request doesn't affect individual plugins at all, just plugin systems. Individual plugins still only get the Cartesian point.

Copy link
Contributor

@bangerth bangerth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's exactly what I had in mind. Nice to see that it makes a difference!

@MFraters MFraters merged commit 0fdffff into GeodynamicWorldBuilder:master Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Requests or proposes performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants