comp.lang.ada
 help / color / mirror / Atom feed
From: jonathan <johnscpg@googlemail.com>
Subject: Re: Tasking for Mandelbrot program
Date: Mon, 28 Sep 2009 12:52:36 -0700 (PDT)
Date: 2009-09-28T12:52:36-07:00	[thread overview]
Message-ID: <59856ad8-2434-4370-a1df-875b46b3b7bc@o41g2000yqb.googlegroups.com> (raw)
In-Reply-To: 4abfd8df$0$31337$9b4e6d93@newsspool4.arcor-online.net

On Sep 27, 10:27 pm, Georg Bauhaus <rm.tsoh.plus-
bug.bauh...@maps.futureapps.de> wrote:

> - writing the image bytes with Stream_IO removes 6% running time
>   when compared to GNAT.IO.Put.
>   This adds standard Ada but also adds about 10 lines of code for
>   the Put procedure and a Stdout variable. Is it worth it?

Speeding up IO would give you a very detectable improvement
in the multi-core benchmark, since the present program
parallelizes the computation well, and the remaining
problem is a small but irritating IO overhead that can't
be parallelized.

Here are a few timings on 8 cores.
Perfect parallelization would give speed-up factor = 8.

With Output enabled:

  No_Of_Workers (tasks) =  8, speed-up factor = 4.45
  No_Of_Workers (tasks) = 16, speed-up factor = 6.30
  No_Of_Workers (tasks) = 24, speed-up factor = 6.66
  No_Of_Workers (tasks) = 32, speed-up factor = 6.86

With Output disabled, it is nearer the optimal
speed-up factor of 8:

  No_Of_Workers (tasks) = 32, speed-up factor = 7.66

The actual benchmark uses 4 cores, so I suspect that the
present standard setting of No_Of_Workers = 16 is
good.

For those who are interested in this problem as
much as I am, a few more words of explanation ...
The difficulty  with mandelbrot is that if you
parallelize it by breaking it up into
work-segments (break up the outer loop into
segments of equal length), then some work-segments
finish quick, some slow, so we have a load balancing
problem.  The solution Georg came up with breaks
the problem into a number of independent tasks four
time greater in number than the number of cores.
The operating system successfully distributes the
tasks over the cores in such a way that the cores
do comparable amounts of work.
(Hope my description is accurate.)

Jonathan




  parent reply	other threads:[~2009-09-28 19:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-27  1:08 Tasking for Mandelbrot program Georg Bauhaus
2009-09-27 11:24 ` Martin
2009-09-27 21:27   ` Georg Bauhaus
2009-09-28  5:48     ` Martin
2009-09-28 19:27     ` jonathan
2009-09-29 15:26       ` Georg Bauhaus
2009-09-28 19:52     ` jonathan [this message]
2009-10-12 16:58       ` Georg Bauhaus
2009-10-12 22:46         ` jonathan
2009-10-12 23:42           ` Anh Vo
2009-10-13  9:11         ` Mark Lorenzen
2009-10-13  9:39           ` Gautier write-only
2009-10-13 12:57             ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox