Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Parallel computing in version 7 Vs version 8
Posted:
Jan 10, 2013 9:39 PM


Hi All,
I'm trying to modify a fairly large chunk of code so that I can make use of the parallel computing capabilities. There are many many things that are confusing me but the first problem I have is the following. If I have something like
SetSharedVariable[pri] pri = {}; maybeprime = i; j = 1; k = 500; ParallelDo[ If[PrimeQ[maybeprime], AppendTo[pri, {i, maybeprime}]; Print[i]] , {i, j, k}] pri Length[pri]
This appears to work in version 8 but not 7. To make it work in 7 I need to use
DistributeDefinitions[maybeprime].
This is fine except that in the code I am interested in modifying I have hundreds of definitions. Do I really need to go through the entire thing and explicitly list every single definition in the form
DistributeDefinitions[def1, def2, ..., def100]
since I have to use version 7?
Many thanks in advance,
Jonny



