MathGroup Archive 2009

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

Search the Archive

Re: ParallelTable doesn't work, but Table does

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101724] Re: ParallelTable doesn't work, but Table does
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Wed, 15 Jul 2009 07:10:37 -0400 (EDT)
  • References: <h3hjk1$1u0$1@smc.vnet.net>

You don't state what the problem is, and since you don't provide the
complete code I can't find out for myself (and anyways, my laptop is a
single core one so that wouldn't work either)

but might it be that your use of global variables is the culprit? You
are using a whole set of them (J, E1 ...) and since many instances of
the loop calulation run in parallel that is bound to cause problems.

Cheers -- Sjoerd


On Jul 14, 11:37 am, Iv=E1n Lazaro <gamins... at gmail.com> wrote:
> I'm having a problem using ParallelTable, but with Table there is no prob=
lem
> at all. The problem is that the calculation in Table is so long, so I thi=
nk
> ParallelTable would make it faster.
>
> This is the code I parallelize:
>
> DistributeDefinitions[r, A, Variable, JacobianMatrix, CondIni, Ecua, Num,
> Time, Y, YI9]
>
> ParallelTable[
>
> J=JacobianMatrix[Ecua[r2,r3,r4,a12,a13,a14,a21,a23,a24,a31,a32,a34,a41,=
a42,a43],Variable[]];
>
> E1=Flatten[Transpose[J.Y]];
>
> EQ3=Table[D[Subscript[x, i][t],{t,1}]==
> Ecua[r2,r3,r4,a12,a13,a14,a21,a23,a24,a31,a32,a34,a41,a42,a43][[i]],{i,1,=
4}];
>
> EQ9=Table[D[Subscript[x, i][t],{t,1}]==E1[[i-4]],{i,5,20}];
>
> sol=NDSolve[Join[EQ9,EQ3,YI3,YI9],Table[Subscript[x,
> i][t],{i,1,20}],{t,0,Time},MaxSteps-> Infinity,AccuracyGoal->2];
>
> u=Table[Random[],{4}];
>
> PhiT=Transpose[Table[{Subscript[x, i][t],Subscript[x, i+4][t],Subscript=
[x,
> i+8][t],Subscript[x, i+12][t]},{i,5,8}]/.sol/.t-> Time];
>
> ExpLyap=Log[Norm[PhiT.u]]/Time,
>
> {a12,0,0.01,0.01},{a13,0,0.01,0.01},{a14,0,0.01,0.01},{a21,0,0.01,0.01},{=
a23,0,0.01,0.01},{a24,0,0.01,0.01},{a31,0,0.01,0.01},{a32,0,0.01,0.01},{a34=
,0,0.01,0.01},{a41,0,0.01,0.01},{a42,0,0.01,0.01},{a43,0,0.01,0.01},{r2,0.0=
1,0.02,0.01},{r3,0.01,0.02,0.01},{r4,0.01,0.02,0.01}]
>
> If someone has an idea, i would apreciate it.



  • Prev by Date: Re: Interactive .nb works, but converted .nbp fails
  • Next by Date: Re: ParallelTable doesn't work, but Table does
  • Previous by thread: Re: ParallelTable doesn't work, but Table does
  • Next by thread: Dynamic freeze