6
$\begingroup$

This is a small question regarding the relationship between the $DistributedContexts variable and the ParallelEvaluate command. Specifically, the Properties and Relations section of the documentation of the former documents the following behaviour:

Find all parallel functions that currently use $DistributedContexts:

 Select[Names["System`Parallel*"], 
  MemberQ[Options[Symbol[#]], 
    DistributedContexts :> $DistributedContexts] &]

However, if I evaluate that code I get

{"ParallelArray","ParallelCombine","ParallelDo","ParallelEvaluate", "ParallelMap",
"ParallelProduct", "ParallelSum", "ParallelTable", "ParallelTry"}

which differs from the above by the addition of ParallelEvaluate. I find this pretty bizarre, as that function is present since v7.0, and it is quite natural for it to have

Options[ParallelEvaluate]

(* -> {DistributedContexts :> $DistributedContexts}*)

Is this behaviour version-dependent? Can someone explain why that function is missing from that list? Or is this simply a documentation bug?


Update: I have been in touch with WRI and they concur that this is a documentation bug, so it should probably be fixed in the next release.

$\endgroup$
4
$\begingroup$

Yes, the behavior is version-dependent and this is currently a documentation bug.

ParallelEvaluate acquired the DistributedContexts option as of version 10.4.0. The documentation example should have been reevaluated to reflect the new behavior.

$\endgroup$
  • $\begingroup$ Thanks for this. I'll report it in the morning. $\endgroup$ – Emilio Pisanty Mar 23 '16 at 2:04
  • $\begingroup$ Just to confirm, though, you're saying ParallelEvaluate did not have this option in v10.3? $\endgroup$ – Emilio Pisanty Mar 23 '16 at 2:06
  • $\begingroup$ Correct, it was only introduced in 10.4. $\endgroup$ – ilian Mar 23 '16 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.