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:27:14 -0700 (PDT)
Date: 2009-09-28T12:27:14-07:00	[thread overview]
Message-ID: <96599435-110b-4213-a075-69cbeec204c5@m11g2000yqf.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:
> Some more observations:
>
> - SSE2 code performs 8% faster when suitable compilation options
>   are present, -mfpmath=sse -msse2 (this is currently the case).
>   Then digits 15 should probably stay in the declaration of Real.
>

Some more notes on this puzzle ...

As far as I can tell, using

  type Real is digits 16;

is like using   -mfpmath=387   on the command line during
compilation.   -mfpmath=sse -msse2   is usually (always?)
the default.  Amazingly, you can now use -mfpmath=387,sse.
(When I try -mfpmath=387,sse, it usually makes things worse,
but not always.)

With mandelbrot.adb, I find   -mfpmath=387  (or digits 16)
the faster option.  It may just be an accident of my
machine+compiler combination.


My timings are all on Intel processors.  On AMD processors
I would not be surprised if digits 15 is the faster.


Here are some timings of mandelbrot.adb, using 1 worker
task, and

   gnatmake -O3 -gnatnp mandelbrot.adb

 (same as: gnatmake -O2 -gnatp  mandelbrot.adb)

On a fairly new PC, single core, with
gnat 4.3.4 or 4.3.2, xeon X5460 3.16GHz:

  digits 16:

   real    0m34.871s
   user    0m34.446s
   sys     0m0.068s

  digits 15 (with  -mfpmath=sse -msse2):

   real    0m43.657s
   user    0m43.247s
   sys     0m0.056s


On an old PC, single core:
gnat 4.3.2, xenon 2.8 GHz

  digits 16:

   real    1m31.885s
   user    1m31.210s
   sys     0m0.224s

  digits 15 (with  -mfpmath=sse -msse2):

   real    1m42.453s
   user    1m41.706s
   sys     0m0.184s

As mentioned in an earlier post, on spectralnorm.adb
(another one of these benchmarks at the shootout site),
"digits 16" was the faster choice.  It was a lot faster
than "digits 15" on my 2 PC's. On the test machine it was
faster, but by a smaller margin.  But  spectralnorm.adb
may not predict mandelbrot.adb very well.

Jonathan



  parent reply	other threads:[~2009-09-28 19:27 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 [this message]
2009-09-29 15:26       ` Georg Bauhaus
2009-09-28 19:52     ` jonathan
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