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

[BREAKING] Multi-threading of CommonSolve functions #17

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Conversation

lxvm
Copy link
Owner

@lxvm lxvm commented Jan 3, 2025

This pr will enable multi-threading of CommonSolveIntegralFunction and CommonSolveFourierIntegralFunction. This should be beneficial for costly integrands which take longer than a millisecond to solve as well as for parallelizing NestedQuad.

TODO:

  • implement CommonSolveIntegralFunction parallelization for remaining algorithms
  • implement CommonSolveFourierIntegralFunction parallelization for all algorithms.
  • Document AbstractSpecialization and AbstractExecutor interfaces
  • Try getting EvalCounter to work with the multi-threading
  • Document usage of executor, specialization, and EvalCounter with examples
  • Automatically parallelize the Fourier series evaluation
  • Add tests for executor and specialization interfaces

NOTES:

  • Bug fixed in how NestedQuad tolerances are set in inner integrals. Previously, tolerances were set at init time (sometimes incorrectly in the case of AutoBZProblems) and only the outer integral tolerance was updated to the desired tolerance at solve! time, but inner integrals were stuck with the tolerances provided at init time. Now, the tolerance provided at solve! time is used by all nested integrals, hopefully with improved performance.
  • CommonSolveIntegralFunction interface changed, replacing (update!, postsolve) pair for a single solve! function
  • nthreads keywords removed from MonkhorstPack, PTR, AutoSymPTR, and AutoPTR algorithms
  • New executor interface introduced for IntegralFunction, CommonSolveFourierIntegralFunction, FourierIntegralFunction, CommonSolveFourierIntegralFunction, NestedQuad, IAI in order to control serial vs multi-threaded execution
  • New specialization interface introduced for CommonSolveFourierIntegralFunction, CommonSolveFourierIntegralFunction, NestedQuad, IAI to control the tradeoff of compilation vs runtime performance
  • Breaking changes mean this PR will be released in AutoBZCore v0.5

Copy link

codecov bot commented Feb 15, 2025

Codecov Report

Attention: Patch coverage is 80.97282% with 133 lines in your changes missing coverage. Please review.

Project coverage is 82.50%. Comparing base (206cb7a) to head (30ed98b).

Files with missing lines Patch % Lines
src/fourier.jl 80.95% 56 Missing ⚠️
src/algorithms.jl 71.71% 28 Missing ⚠️
src/interfaces.jl 52.63% 27 Missing ⚠️
src/algorithms_meta.jl 93.97% 10 Missing ⚠️
src/algorithms_autosymptr.jl 87.50% 6 Missing ⚠️
ext/AutoBZCoreFunctionWrappersExt.jl 0.00% 3 Missing ⚠️
src/domains.jl 0.00% 2 Missing ⚠️
src/brillouin.jl 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
- Coverage   86.32%   82.50%   -3.83%     
==========================================
  Files          19       20       +1     
  Lines        1324     1509     +185     
==========================================
+ Hits         1143     1245     +102     
- Misses        181      264      +83     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lxvm lxvm changed the title Multi-threading of CommonSolve functions [BREAKING] Multi-threading of CommonSolve functions Feb 16, 2025
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.

1 participant