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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:ce41:: with SMTP id v62mr2542531itg.96.1559871726199; Thu, 06 Jun 2019 18:42:06 -0700 (PDT) X-Received: by 2002:a9d:7741:: with SMTP id t1mr8802057otl.178.1559871725979; Thu, 06 Jun 2019 18:42:05 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!g15no129607itd.0!news-out.google.com!l126ni201itl.0!nntp.google.com!g15no129605itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 6 Jun 2019 18:42:05 -0700 (PDT) In-Reply-To: <55b14350-e255-406c-ab11-b824da77995b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.112.169.186; posting-account=Jzt5lQoAAAB4PhTgRLOPGuTLd_K1LY-C NNTP-Posting-Host: 87.112.169.186 References: <55b14350-e255-406c-ab11-b824da77995b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Toy computational "benchmark" in Ada (new blog post) From: johnscpg@googlemail.com Injection-Date: Fri, 07 Jun 2019 01:42:06 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:56516 Date: 2019-06-06T18:42:05-07:00 List-Id: On Thursday, June 6, 2019 at 12:05:02 PM UTC+1, David Trudgett wrote: > For what it's worth, you may exercise your laughing gear perusing my toy example just for fun at: > > http://www.eclecticse.com.au/2019/06/procedural-map-reduce-and-parallelism.html > > Any tips or suggestions from Ada old hands out there for other ideas to try would be gratefully considered! :-) > > Enjoy! On my machine I get a nice improvement over -O3 when I take the arrays off the heap, and then use the following 2 flags: -march=native -funroll-loops Modifying the programs is easy: --Values_Array : Values_Array_Access := new Values_Array_Type; Values_Array : Values_Array_Type; In the parallel version, change the loop in the task body: -- declare -- Val : Float64 renames Values_Array (Idx); -- begin My_Sum := My_Sum + Values_Array (Idx) ** 2; -- end; The -funroll-loops gave me a nice improvement on the parallel program, less so on the serial version. (Makes no sense to me at all!) If you are running in a Unix shell, you usually need to tell the system if you're going to put giant arrays on the stack. I type this on the command line: ulimit -s unlimited. Jonathan