I am running Mathematica 7, and I am trying to run a simple Do
loop in parallel, using ParallelDo
. The following standard, sequential code works fine:
len = 10;
A = Table[0, {len}];
Do[
A[[i]] = i*10;
, {i, 1, len}]
However, if I use ParallelDo
instead of the standard Do
, this code gives error messages:
len = 10;
A = Table[0, {len}];
ParallelDo[
A[[i]] = i*10;
, {i, 1, len}]
The error messages that I get are:
Set::noval: Symbol A in part assignment does not have an immediate value.
Set::noval: Symbol A in part assignment does not have an immediate value.
Set::noval: Symbol A in part assignment does not have an immediate value.
Set::noval: Symbol A in part assignment does not have an immediate value.
Set::noval: Symbol A in part assignment does not have an immediate value.
Set::noval: Symbol A in part assignment does not have an immediate value.
General::stop: Further output of Set::noval will be suppressed during this calculation.
General::stop: Further output of Set::noval will be suppressed during this calculation.
Set::noval: Symbol A in part assignment does not have an immediate value.
Set::noval: Symbol A in part assignment does not have an immediate value.
Set::noval: Symbol A in part assignment does not have an immediate value.
Set::noval: Symbol A in part assignment does not have an immediate value.
Is there anything I can do to run this Do loop in parallel?
Thank you!
Andrew DeYoung
Carnegie Mellon University