MathGroup Archive 2010

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

Search the Archive

Another question on ParallelDo

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112142] Another question on ParallelDo
  • From: Iván Lazaro <gaminster at gmail.com>
  • Date: Thu, 2 Sep 2010 02:30:07 -0400 (EDT)

Hi All!

I'm a noob using parallelizing tools in mathematica. However, the time this
problem takes in one kernel, make me think about this possibility. So, this
is the simplified code.

SetSharedVariable[lista1, lista]

ParallelDo[Do[Seen = RandomReal[{0, 100}, Num];
  Expected = RandomReal[{0, 100}, Num];

  VMedio = (1/Num)*Sum[Expected[[i]], {i, 1, Num}];

  Error = Sum[(Seen[[i]] - Esperado[[i]])^2, {i, 1, Num}];

  Medio = Sum[(Seen[[i]] - VMedio)^2, {i, 1, Num}];

  AppendTo[lista, Error/Medio], {10000}];
 a = Max[lista];
 AppendTo[lista1, {a, Num}],
{Num, 1, 4}]


The real problem takes Num from 50 to 150. This simplified problem, in one
kernel, finish in 10 seconds. But this one never ends. What I am doing
wrong?

Thanks a lot!


  • Prev by Date: Using 'Module' inside 'Compile'
  • Next by Date: Re: coordinates in LogLogPlots
  • Previous by thread: Re: Using 'Module' inside 'Compile'
  • Next by thread: Re: Another question on ParallelDo