Mathematica has a useful set of Operators Without Built-In Meanings. For example: CenterDot
, CircleDot
, CirclePlus
, Star
, etc. According to the linked documentation, a user is allowed to define evaluation rules for these symbols. Unfortunately, these symbols are not compatible with parallel evaluation. The following example shows how parallel evaluation leads to an incorrect result when user-defined evaluation rule for CenterDot
is used:
CenterDot = Times;
DistributeDefinitions[CenterDot];
f[n_] := Coefficient[CenterDot[n, x], x];
Table[f[n],{n,1,5}]
{1,2,3,4,5} (* correct *)
ParallelTable[f[n],{n,1,5}]
{0,0,0,0,0} (* wrong *)
I think that the root cause of this bug is that parallel evaluation routines are not allowed to distribute definitions of any symbols from System
context while all Operators Without Built-In Meanings are defined in this very context.
Is there a practical way to use Operators Without Built-In Meanings in parallel calculations?
This question is based on observations made here, where accepted workaround was just to abandon such operators altogether.
ParallelEvaluate
: (1), (2) $\endgroup$