3 ms·
> heard about non-determinism in parallelized code There's a term for it. It's "race condition". It is usually considered a bad thing. Exactly because it makes
by smsm42 7y ago
> heard about non-determinism in parallelized code
There's a term for it. It's "race condition". It is usually considered a bad thing. Exactly because it makes the result of the code unpredictable, unless you take special care to control it. Now they question is - did the authors of the model do it? Given that their advice is "just run it single-threaded" - no they didn't.
- HarryHirsch 7y agoIn MD, you can eliminate race conditions like a computer scientist would or you can listen to the underlying physics and ignore them when appropiate. In real life, we depend on weak causality, not on strong causality. A throw of dice will demonstrate the fact.
- smsm42 7y agoA throw of dice will demonstrate the fact that we shouldn't care about bugs in models caused by race conditions? How does that even make sense?
- rovolo 7y agoThe "race condition" is that the random numbers fed to each thread are nondeterministic given a specific seed. Even though a specific run can't be reproduced due to the nondeterminism, the random values aren't causing math bugs. Let's say we are doing a stock market simulation. You have 2 shares of company A and 5 shares of company B. Your profit depends on the change in share price. srand(seed); // generates: [rand_0, rand_1, ...] total_profit = 2 * profit(rand()) + 5 * profit(rand()); The race condition can result in two different outcomes given the same seed: total_profit = 2 * profit(rand_0) + 5 * profit(rand_1); total_profit = 2 * profit(rand_1) + 5 * profit(rand_0); Both of those outcomes are valid. Even though there's a reproducibility bug, it doesn't affect the correctness of the model.