Skip to main content
added 16 characters in body
Source Link
Tobias Hagge
  • 1.4k
  • 9
  • 17

This non-answer (addressing Szabolcs' observation) won't fit in a comment.

In the parallel kernels, data and foo are Equal, satisfy SameQ, and have, as near as I can tell, the equivalent Language`ExtendedFullDefinition (how to backtick?), but one can see from the traces that the evaluation paths are different.

This non-answer won't fit in a comment.

In the parallel kernels, data and foo are Equal, satisfy SameQ, and have, as near as I can tell, the equivalent Language`ExtendedFullDefinition (how to backtick?), but one can see from the traces that the evaluation paths are different.

This non-answer (addressing Szabolcs' observation) won't fit in a comment.

In the parallel kernels, data and foo are Equal, satisfy SameQ, and have, as near as I can tell, the equivalent Language`ExtendedFullDefinition, but one can see from the traces that the evaluation paths are different.

added 2 characters in body
Source Link
Rojo
  • 42.8k
  • 7
  • 98
  • 190

In the parallel kernels, data and foo are Equal, satisfy SameQ, and have, as near as I can tell, the equivalent Language*ExtendedFullDefinitionLanguage`ExtendedFullDefinition (how to backtick?), but one can see from the traces that the evaluation paths are different.

In the parallel kernels, data and foo are Equal, satisfy SameQ, and have, as near as I can tell, the equivalent Language*ExtendedFullDefinition (how to backtick?), but one can see from the traces that the evaluation paths are different.

In the parallel kernels, data and foo are Equal, satisfy SameQ, and have, as near as I can tell, the equivalent Language`ExtendedFullDefinition (how to backtick?), but one can see from the traces that the evaluation paths are different.

Source Link
Tobias Hagge
  • 1.4k
  • 9
  • 17

This non-answer won't fit in a comment.

The following makes me suspect that the problem has something to do with how the parallel kernels are representing data internally:

LaunchKernels[];

datatest = Table[rule[x, x], {2}];
data = Table[Rule[x, x], {2}];

Trace[datatest]
(* ==> {datatest,{rule[x,x],rule[x,x]}}*)
Trace[data]
(* ==> {data,{x->x,x->x}}*)

DistributeDefinitions[datatest, data];

ParallelEvaluate[foo = datatest /. rule -> Rule];

ParallelEvaluate[Trace[datatest]]
(* ==>{{datatest,{rule[x,x],rule[x,x]}},{datatest,{rule[x,x],rule[x,x]}},
  {datatest,{rule[x,x],rule[x,x]}},{datatest,{rule[x,x],rule[x,x]}},
  {datatest,{rule[x,x],rule[x,x]}},{datatest,{rule[x,x],rule[x,x]}},
  {datatest,{rule[x,x],rule[x,x]}},{datatest,{rule[x,x],rule[x,x]}}} *)

ParallelEvaluate[Trace[data]]
(* ==> {{data,{x->x,x->x},{x->x,x->x},{x->x,x->x},{x->x,x->x}},
  {data,{x->x,x->x},{x->x,x->x},{x->x,x->x},{x->x,x->x}},
  {data,{x->x,x->x},{x->x,x->x},{x->x,x->x},{x->x,x->x}},
  {data,{x->x,x->x},{x->x,x->x},{x->x,x->x},{x->x,x->x}},
  {data,{x->x,x->x},{x->x,x->x},{x->x,x->x},{x->x,x->x}},
  {data,{x->x,x->x},{x->x,x->x},{x->x,x->x},{x->x,x->x}},
  {data,{x->x,x->x},{x->x,x->x},{x->x,x->x},{x->x,x->x}},
  {data,{x->x,x->x},{x->x,x->x},{x->x,x->x},{x->x,x->x}}} *)

ParallelEvaluate[Trace[foo]]
(* {{foo,{x->x,x->x}},{foo,{x->x,x->x}},{foo,{x->x,x->x}},
  {foo,{x->x,x->x}},{foo,{x->x,x->x}},{foo,{x->x,x->x}},
  {foo,{x->x,x->x}},{foo,{x->x,x->x}}} *)

In the parallel kernels, data and foo are Equal, satisfy SameQ, and have, as near as I can tell, the equivalent Language*ExtendedFullDefinition (how to backtick?), but one can see from the traces that the evaluation paths are different.