Skip to content
Snippets Groups Projects

Add _defaultdumprng for _GLOBAL_RNG

Merged Lukas Hupe requested to merge lhupe-main-patch-65656 into dev
1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
+ 2
0
@@ -111,6 +111,8 @@ function (s::SaveCallback)(sim::Simulation)
end
# Xoshiros are small and can be dumped every snapshot, MersenneTwisters are huge and shouldn't be written as often
# the GLOBAL_RNG can't be properly serialized anyway so we just give up
_defaultdumprng(::Random._GLOBAL_RNG) = false
_defaultdumprng(::Random.Xoshiro, _) = true
_defaultdumprng(::Random.MersenneTwister, s) = (s.nextsnap % 10 == 0)
Loading