TuringLang / AbstractMCMC.jl

Abstract types and interfaces for Markov chain Monte Carlo methods
https://turinglang.org/AbstractMCMC.jl
MIT License
78 stars 18 forks source link

Remove use of `threadid` #95

Closed devmotion closed 2 years ago

devmotion commented 2 years ago

One must not use threadid in @threads for ...., as discussed in https://discourse.julialang.org/t/behavior-of-threads-threads-for-loop/76042. This PR implements an alternative suggested in https://github.com/JuliaMolSim/DFTK.jl/issues/588.

Edit: Since @spawn was introduced in Julia 1.3, we have to drop Julia < 1.3 or add special version guards.

codecov[bot] commented 2 years ago

Codecov Report

Merging #95 (bb7ced2) into master (fe972e8) will increase coverage by 0.05%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #95      +/-   ##
==========================================
+ Coverage   97.68%   97.73%   +0.05%     
==========================================
  Files           7        7              
  Lines         216      221       +5     
==========================================
+ Hits          211      216       +5     
  Misses          5        5              
Impacted Files Coverage Δ
src/sample.jl 98.03% <100.00%> (+0.06%) :arrow_up:

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 fe972e8...bb7ced2. Read the comment docs.

cpfiffer commented 2 years ago

Failing tests were known and relate to MCMCChains, I ignored them and merged in.