From: johnscpg@googlemail.com
Subject: Re: Toy computational "benchmark" in Ada (new blog post)
Date: Thu, 6 Jun 2019 18:42:05 -0700 (PDT)
Date: 2019-06-06T18:42:05-07:00 [thread overview]
Message-ID: <ed2964f8-ce39-4307-9740-28ac60ae3836@googlegroups.com> (raw)
In-Reply-To: <55b14350-e255-406c-ab11-b824da77995b@googlegroups.com>
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
next prev parent reply other threads:[~2019-06-07 1:42 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 11:05 Toy computational "benchmark" in Ada (new blog post) David Trudgett
2019-06-06 17:48 ` Olivier Henley
2019-06-06 23:14 ` David Trudgett
2019-06-06 23:27 ` Paul Rubin
2019-06-07 5:24 ` David Trudgett
2019-06-07 5:36 ` Paul Rubin
2019-06-06 20:31 ` Jeffrey R. Carter
2019-06-06 23:02 ` David Trudgett
2019-06-07 0:13 ` Paul Rubin
2019-06-07 4:50 ` Paul Rubin
2019-06-07 5:41 ` David Trudgett
2019-06-07 6:00 ` Paul Rubin
2019-06-07 6:25 ` David Trudgett
2019-06-07 6:38 ` Paul Rubin
2019-06-07 5:28 ` David Trudgett
2019-06-07 5:57 ` Paul Rubin
2019-06-07 6:21 ` David Trudgett
2019-06-07 6:22 ` Paul Rubin
2019-06-07 6:29 ` David Trudgett
2019-06-07 6:42 ` Paul Rubin
2019-06-07 17:55 ` Jeffrey R. Carter
2019-06-08 11:00 ` David Trudgett
2019-06-07 1:42 ` johnscpg [this message]
2019-06-07 5:34 ` David Trudgett
2019-06-08 10:17 ` David Trudgett
2019-06-08 1:14 ` johnscpg
2019-06-08 10:56 ` David Trudgett
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox