Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2009

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

Search the Archive

ParallelTable[ ]

  • To: mathgroup at
  • Subject: [mg100768] ParallelTable[ ]
  • From: "Scot Martin" <smartin at>
  • Date: Sat, 13 Jun 2009 06:04:21 -0400 (EDT)
  • Organization: Harvard University
  • Reply-to: <scot_martin at>

Just started looking at the parallel computing. This seems a very good
option for me because any "long" calculations I have are usually tied to
list manipulation.


For background,$ProcessorCount returns "2" on my machine. 


I tried this command:


AbsoluteTiming[ParallelTable[i^2, {i, 1000000}]]


The required time was 9.28 s.



I followed with this command:


AbsoluteTiming[Table[i^2, {i, 1000000}]]


The requied time was 0.86 s.




So, you can imagine my confusion. Can anyone explain why parallel table
generation took 10 times as long?



[Incidentally and perhaps related, the command of Timing[ParallelTable[i^2,
{i, 1000000}]] takes 0.078 s. This leaves me very confused because the
computer obviously take much longer to execute, i.e., I am sitting at my
console for closer to 9.28 s than 0.078 s. The command of Timing[Table[i^2,
{i, 1000000}]] takes 0.875 s. What gives?]



Looking forward to everyone's insights!

  • Prev by Date: Re: Correction to "Fundamental Theorem of Calculus and Mathematica"
  • Next by Date: Re: RandomReal gets stuck
  • Previous by thread: Re: How to use R within Mathematica
  • Next by thread: Re: ParallelTable[ ]