by d0mine · 3y ago · 0 comments
results = ThreadPool(workers=1000).imap_unordered(calc, inputs)
print(math.fsum(results))
Due to the magic of the fsum alg, the result is deterministic whatever order we get results in.
https://docs.python.org/3/library/math.html#math.fsumI guess if determinism is so important implementations can be changed, it is just maybe not that high priority.
You could use just one thread on your 10000 thread GPU too and it would be deterministic, sure. Completely beside the point.