3
$\begingroup$

for the following program:

Unprotect[Power];
Power[0, 0] = 1;
Protect[Power];
ParallelTable[0^0, {4}]

I have the following result:

(kernel 1) Power::indet : Indeterminate expression 0^0 encountered.
(kernel 2) Power::indet : Indeterminate expression 0^0 encountered.
(kernel 1)Power::indet : Indeterminate expression 0^0 encountered.
(kernel 2)Power::indet : Indeterminate expression 0^0 encountered. {Indeterminate, Indeterminate, Indeterminate, Indeterminate}

This certainly means that the kernels do not inherit the modification of Power since

Table[0^0, {4}]

leads to:

{1, 1, 1, 1}

How can I do to propagate the modification of Power to the kernels ? Thank you

$\endgroup$

1 Answer 1

4
$\begingroup$

You need to evaluate the modification of Power in all Kernels. Try using ParallelEvaluate like this:

ParallelEvaluate[
    CompoundExpression[
       Unprotect[Power],
       Power[0, 0] = 1,
       Protect[Power]
    ]
];

Now

ParallelTable[0^0, {4}]
(* {1, 1, 1, 1} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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