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

Thread-safety fixes in bands #219

Merged
merged 4 commits into from
Oct 21, 2023
Merged

Thread-safety fixes in bands #219

merged 4 commits into from
Oct 21, 2023

Conversation

pablosanjose
Copy link
Owner

@pablosanjose pablosanjose commented Oct 20, 2023

There were some thread safety bugs in multithreaded bands

  • Arpack segfaults if it is used with threads because the package is currently non thread-safe (Segmentation fault when using Arpack and Threads.@threads JuliaLinearAlgebra/Arpack.jl#86). We now use a single thread in this case (and any other solver that declares is_thread_safe(::AbstractEigenSolver) = false
  • There was a bug in apply(solver, h, ...) whereby all threads would end up writing on the same Bloch matrix. Now fixed.
  • We should never use multithreading with bands(hf::Function, ...), because hf may very well not be thread-safe

@pablosanjose pablosanjose changed the title Thread-safe bands fixes Thread-safety fixes in bands Oct 20, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (1613b41) 92.54% compared to head (6f035f8) 92.55%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #219   +/-   ##
=======================================
  Coverage   92.54%   92.55%           
=======================================
  Files          34       34           
  Lines        5443     5450    +7     
=======================================
+ Hits         5037     5044    +7     
  Misses        406      406           
Files Coverage Δ
src/apply.jl 92.34% <100.00%> (ø)
src/solvers/eigen.jl 97.72% <100.00%> (+0.10%) ⬆️
src/bands.jl 97.66% <91.66%> (+0.02%) ⬆️

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

@pablosanjose pablosanjose merged commit 8c866df into master Oct 21, 2023
8 checks passed
@pablosanjose pablosanjose deleted the threadsafe_bands branch October 21, 2023 14:38
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.

2 participants