From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ee1e7bdc743a3545 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca.giganews.com!nntp.giganews.com!aotearoa.belnet.be!news.belnet.be!feed1.news.be.easynet.net!news.skynet.be!newsgate.cistron.nl!newsgate.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Tue, 09 Mar 2010 20:10:02 +0200 From: Niklas Holsti Organization: Tidorum Ltd User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Multicore problem References: <80b7542b-38d7-4da2-aa50-1c734b3c516c@q2g2000pre.googlegroups.com> In-Reply-To: <80b7542b-38d7-4da2-aa50-1c734b3c516c@q2g2000pre.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4b968f0e$0$1996$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 81.17.205.61 X-Trace: 1268158222 news.tdc.fi 1996 81.17.205.61:43678 X-Complaints-To: abuse@tdcnet.fi Xref: g2news1.google.com comp.lang.ada:9492 Date: 2010-03-09T20:10:02+02:00 List-Id: 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 . @ .