Re: Another question on ParallelDo
- To: mathgroup at smc.vnet.net
- Subject: [mg112160] Re: Another question on ParallelDo
- From: Robert Pigeon <robert.pigeon at videotron.ca>
- Date: Fri, 3 Sep 2010 06:07:19 -0400 (EDT)
Maybe.... Check the documentation on ParallelDo... You do not use Do after a ParelleDo. Robert -----Message d'origine----- De : Iv=E1n Lazaro [mailto:gaminster at gmail.com] Envoy=E9 : 2 septembre 2010 02:30 =C0 : mathgroup at smc.vnet.net Objet : [mg112142] Another question on ParallelDo 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!