Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: ParallelTable[ ]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100801] Re: ParallelTable[ ]
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Sun, 14 Jun 2009 05:41:02 -0400 (EDT)
  • References: <h0vtju$74n$1@smc.vnet.net>

Hi,

ParallelTable[] take longer, because parallel computing take
usual longer than serial one. Since the data must be distributed
to the processors and the results must be collected additional
to the original work, it must take longer ! You can't do more
and expect it will be faster.

Regards
   Jens

Scot Martin wrote:
> 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: weird escaping problem with StringPattern inside Module[]
  • Next by Date: Re: Combined Set, SetDelayed
  • Previous by thread: ParallelTable[ ]
  • Next by thread: Re: Re: ParallelTable[ ]