MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Parallel computing in version 7 Vs version 8

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129402] Parallel computing in version 7 Vs version 8
  • From: Jonathan Frazer <J.Frazer at sussex.ac.uk>
  • Date: Thu, 10 Jan 2013 21:42:37 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

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



  • Prev by Date: Re: Manipulate: Tracking symbols which are not stated explicitly
  • Next by Date: Modern Differential Geometry for Mathematica 9
  • Previous by thread: Re: How can I import a file wiht a space as a separator?
  • Next by thread: Modern Differential Geometry for Mathematica 9