in reply to Re^11: PDL and srand puzzle
in thread PDL and srand puzzle
Predictability Summary:
non-threads
# Processes - CORE CORE::srand(N); CORE::rand(); - PDL CORE::srand(N); # This also, for MCE predictable results PDL::srand(N); # PDL v1.062 ~ v1.089 PDL::srandom(N); # PDL v1.089_01 PDL->random; # MCE v1.895 - Math::Prime::Util CORE::srand(N); # This also, for MCE predictable results Math::Prime::Util::srand(N); Math::Prime::Util::drand(); Math::Prime::Util::irand64(); - Math::Random CORE::srand(N); # This also, for MCE predictable results Math::Random::random_set_seed(N, N); Math::Random::random_normal(); Math::Random::random_uniform(); - Math::Random::MT::Auto CORE::srand(N); # This also, for MCE predictable results Math::Random::MT::Auto::set_seed(N); Math::Random::MT::Auto::rand();
threads
# Threads (matching non-threads output), requires MCE v1.894 - CORE CORE::srand(N); CORE::rand(); - Math::Prime::Util CORE::srand(N); # This also, for MCE predictable results Math::Prime::Util::srand(N); Math::Prime::Util::drand(); Math::Prime::Util::irand64(); - Math::Random::MT::Auto CORE::srand(N); # This also, for MCE predictable results Math::Random::MT::Auto::set_seed(N); Math::Random::MT::Auto::rand(); - Not possible PDL or Math::Random
Running threads, I'm unable to generate predictable results using PDL or Math::Random (random_normal/random_uniform), regardless seeding the generator per each thread.
See the complete demonstration here. Run Perl with -Mthreads to spin threads.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: PDL and srand puzzle
by jo37 (Curate) on Jun 08, 2024 at 11:46 UTC | |
by marioroy (Prior) on Jun 08, 2024 at 14:54 UTC | |
by etj (Priest) on Jun 09, 2024 at 14:06 UTC | |
by marioroy (Prior) on Jun 09, 2024 at 16:25 UTC | |
by etj (Priest) on Jun 10, 2024 at 10:49 UTC |