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,2c57913d6b8220c1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!a32g2000yqm.googlegroups.com!not-for-mail From: jonathan Newsgroups: comp.lang.ada Subject: Re: Tasking for Mandelbrot program Date: Mon, 12 Oct 2009 15:46:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: <911cc4ac-f786-4b44-8656-94756b3d4af3@a32g2000yqm.googlegroups.com> References: <4abebaf4$0$31342$9b4e6d93@newsspool4.arcor-online.net> <4abfd8df$0$31337$9b4e6d93@newsspool4.arcor-online.net> <59856ad8-2434-4370-a1df-875b46b3b7bc@o41g2000yqb.googlegroups.com> <4ad36024$0$7626$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: 143.117.23.126 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1255387598 8160 127.0.0.1 (12 Oct 2009 22:46:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 12 Oct 2009 22:46:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a32g2000yqm.googlegroups.com; posting-host=143.117.23.126; posting-account=Jzt5lQoAAAB4PhTgRLOPGuTLd_K1LY-C User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.14) Gecko/2009091008 Iceweasel/3.0.6 (Debian-3.0.6-3),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8685 Date: 2009-10-12T15:46:38-07:00 List-Id: On Oct 12, 5:58=A0pm, Georg Bauhaus wrote: > Lo and behold! =A0An Ada program is at #1 in two lists > at the Shootout site. =A0Look for mandelbrot, the 64 > bit rankings. =A0Enjoy the moment while it lasts. :-) > Here is the address: http://shootout.alioth.debian.org/u64q/benchmark.php?test=3Dmandelbrot&lang= =3Dall > The high speed is largely due to the new inner loop, > composed by Jonathan Parker. Well, I figured it out by reading the C program;) The C and C++ programs use INTEL sse2 intrinsics to get the best performance out of the sse2 floating point units. The INTEL sse2 intrinsics are IIUC a convenient interface to intel sse2 assembly language: http://msdn.microsoft.com/en-us/library/kcwz153a(VS.71).aspx The result we can be proud of is the finding that GNAT/gcc is just smart enough to produce optimal code without the use of INTEL sse2 intrinsics, at least on the 64 bit machine. The key to getting the best performance out of the SSE hardware was presenting it with 2 identical streams of instructions, each of which starts with different initial conditions. It can be done in high-level language as well as the sse2 intrinsics. The challenge in this part of the shootout was non-trivial: to get the mandelbrot calculation to exploit all 4 cores of the test machine in parallel, (a load-balancing/distributed-processing problem I mentioned earlier in this thread) and to simultaneously put the SSE floating point units to best use. The 4 programs that did the best at this used: C + pthreads + INTEL sse2 intrinsics, C++ + OpenMP + INTEL sse2 intrinsics, ATS + pthreads(?) + INTEL sse2 intrinsics, and Ada + Ada + Ada. Jonathan