comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Multicore problem
Date: Tue, 09 Mar 2010 20:10:02 +0200
Date: 2010-03-09T20:10:02+02:00	[thread overview]
Message-ID: <4b968f0e$0$1996$4f793bc4@news.tdc.fi> (raw)
In-Reply-To: <80b7542b-38d7-4da2-aa50-1c734b3c516c@q2g2000pre.googlegroups.com>

Anatoly Chernyshev wrote:
> Hello, everyone,
> 
> Here is the following problem: large 3D array, which can be processed
> in parallel. Naturally, I was trying to make use of 2 cores on my
> processor by splitting the whole calculation into several parallel
> tasks. Strangely, I could actually see that the program utilizes both
> cores now (even not by 100% as I wished), but the computation time
> increases more than 2 times when there are 2 tasks are running on 2
> cores. During calculation any 2 or more tasks can occasionally modify
> the same array member, for which a protected type is introduced.
> 
> Here are results of benchmarking for my 2 core system (Intel P4 Dual
> Core, Win XP SP3):
> 
> 1 task (50% total proc. load): 680 sec.
> 2 tasks (70-93% load): 1520 sec.
> 4 tasks (70-93% load): 1195 sec.
> 
> Any ideas on why it might happen and how to get around it?

Perhaps the two tasks/cores are competing for data-cache space, and 
causing more cache misses than if a single task/core is active?

How large is your 3D array, compared to the cache?

If this is the problem, you could try to divide the whole problem into 
slices so that each slice processes a part of the 3D array that *can* 
fit in the cache, but can also be processed in parallel by two 
tasks/cores. Not knowing what your processing actually does I can't say 
more about how to slice the problem.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .



  reply	other threads:[~2010-03-09 18:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 17:48 Multicore problem Anatoly Chernyshev
2010-03-09 18:10 ` Niklas Holsti [this message]
2010-03-09 18:48   ` Anatoly Chernyshev
2010-03-09 22:37     ` KarlNyberg
2010-03-10  0:08     ` jonathan
2010-03-10  7:19       ` Anatoly Chernyshev
2010-03-10 18:00         ` Charmed Snark
2010-03-10 19:24         ` tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox