Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #13098
| From | Jonathan Frazer <J.Frazer@sussex.ac.uk> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Parallel computing in version 7 Vs version 8 |
| Date | 2013-01-11 02:39 +0000 |
| Message-ID | <kcnu0j$f9m$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
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
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Parallel computing in version 7 Vs version 8 Jonathan Frazer <J.Frazer@sussex.ac.uk> - 2013-01-11 02:39 +0000
csiph-web