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,FREEMAIL_FROM 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 Path: g2news1.google.com!postnews.google.com!b30g2000yqd.googlegroups.com!not-for-mail From: jonathan Newsgroups: comp.lang.ada Subject: Re: Multicore problem Date: Tue, 9 Mar 2010 16:08:26 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <80b7542b-38d7-4da2-aa50-1c734b3c516c@q2g2000pre.googlegroups.com> <4b968f0e$0$1996$4f793bc4@news.tdc.fi> <71a2ea77-f97d-4e48-ba82-8322974f5c2b@s36g2000prh.googlegroups.com> NNTP-Posting-Host: 143.117.23.238 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1268179706 13591 127.0.0.1 (10 Mar 2010 00:08:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 10 Mar 2010 00:08:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b30g2000yqd.googlegroups.com; posting-host=143.117.23.238; posting-account=Jzt5lQoAAAB4PhTgRLOPGuTLd_K1LY-C User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021719 Iceweasel/3.0.6 (Debian-3.0.6-3),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9503 Date: 2010-03-09T16:08:26-08:00 List-Id: On Mar 9, 6:48=A0pm, Anatoly Chernyshev wrote: > > 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? > > Right now it is small, 23 Mb, for the purposes of algorithm honing. > 2Mb L2 cache. In perspective the array could be 4-8 Gb (not for my > current machine, of course). > > > 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. > > Each task begins in the cell of its designated area of array, and then > does a Markov walk all around the place using the cell pointers. Of course I can't say much about your specific problem. I can tell you (the little) I learned battling something similar (using linux and GNAT). The problem I was up against was latency: minimum time to send data, no matter how small the data, between 2 cores on the same processor. I measured this time as about 40 microseconds, (exchange of data between cores). Might have been 20 or 60, but think 10's of microseconds. If message passing (or sharing data in an array) is more frequent than this, you'll never see a speed up on the several cores. (Some expensive networks advertise latencies of a few microseconds, and some experimental operating systems advertise sub-microsecond latencies.) So you should not think of passing data more frequently than say every 200 or 400 microseconds if you want to see speedup. Which is a long time .. you can do 10's of thousands of floating point operations in that time! Jonathan