I'm starting to use Mathematica's parallelization more frequently, and noticed an oddity I would appreciate to be explained. Please feel free to correct my terminology.
When on the main kernel, variables and functions defined will be passed through to parallel kernels. So running:
varA = 5;
ParallelDo[Print[varA], 3]
Will result in 3 prints of 5
. However, when I use a dollar signed variable like $MinPrecision
I see that running:
$MinPrecision = 1000;
Print[$MinPrecision]
ParallelDo[Print[$MinPrecision], 3]
Will result in 1 print of 1000
, expected, and 3 prints of 0
, weird. Of course this can be circumvented with ParallelEvaluate[$MinPrecision = 1000;]
, but when is ParallelEvaluate
necessary and when isn't it?