Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Parallel computing in version 7 Vs version 8
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
J.Frazer

Posts: 13
Registered: 3/9/11
Parallel computing in version 7 Vs version 8
Posted: Jan 10, 2013 9:39 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.