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

Use linear interpolation in DragForcing #1323

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

marchdf
Copy link
Contributor

@marchdf marchdf commented Nov 1, 2024

Summary

This is much more efficient than the current implementation since it does a bisection search. Also instead of a nearest neighbor it uses a linear interpolation. One can recover the previous implementation by just using the new nearest_search.

Pull request type

Please check the type of change introduced:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Checklist

The following is included:

  • new unit-test(s)
  • new regression test(s)
  • documentation for new capability

This PR was tested by running:

  • the unit tests
    • on GPU
    • on CPU
  • the regression tests
    • on GPU
    • on CPU

@marchdf marchdf marked this pull request as draft November 1, 2024 20:39
@marchdf marchdf force-pushed the fix-drag-search branch 3 times, most recently from 479083a to 1a28cdf Compare November 1, 2024 21:28
@marchdf marchdf marked this pull request as ready for review November 1, 2024 21:31
@marchdf marchdf marked this pull request as draft November 2, 2024 01:51
@hgopalan
Copy link
Contributor

hgopalan commented Nov 2, 2024

Here are some timing tests for a case with ~ 13 million cells on 208 cores

Older nearest search: Time spent in Evolve(): 2914.012737
New linear interpolation: Time spent in Evolve(): 2579.18432

@hgopalan hgopalan marked this pull request as ready for review November 2, 2024 18:53
@marchdf
Copy link
Contributor Author

marchdf commented Nov 4, 2024

@hgopalan Thanks for doing that comparison. I thought of a better/less complicated way. Would you mind checking the timing with the latest?

@marchdf marchdf marked this pull request as draft November 4, 2024 16:29
@marchdf marchdf marked this pull request as ready for review November 4, 2024 17:33
@hgopalan
Copy link
Contributor

hgopalan commented Nov 4, 2024

@hgopalan Thanks for doing that comparison. I thought of a better/less complicated way. Would you mind checking the timing with the latest?

Here are some timing tests for a case with ~ 13 million cells on 208 cores

Older nearest search: Time spent in Evolve(): 2914.012737
New Old linear interpolation: Time spent in Evolve(): 2579.18432
New linear interpolation: Time spent in Evolve(): 2343.574082

@marchdf
Copy link
Contributor Author

marchdf commented Nov 4, 2024

1.25X speedup. I will take it ;)

@marchdf marchdf enabled auto-merge (squash) November 4, 2024 19:05
@marchdf marchdf merged commit 2efa3f8 into Exawind:main Nov 4, 2024
15 checks passed
@marchdf marchdf deleted the fix-drag-search branch November 4, 2024 19:23
hgopalan pushed a commit to hgopalan/amr-wind that referenced this pull request Nov 4, 2024
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.

3 participants