comp.lang.ada
 help / color / mirror / Atom feed
* Ada and multi-core CPUs
@ 2005-09-09 21:33 tmoran
  2005-09-10  8:27 ` Wilhelm Spickermann
  2005-09-12 15:48 ` Marc A. Criley
  0 siblings, 2 replies; 8+ messages in thread
From: tmoran @ 2005-09-09 21:33 UTC (permalink / raw)


I finally got around to testing a sort.  I split the data array in half,
sorting one half with the main program and the other with a separate task,
then merged the two half-results.  It's substantially (about 60% as long
for 100K floats) faster than splitting, sort one half, then the other
half, then merge.  And easy to program in Ada.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada and multi-core CPUs
  2005-09-09 21:33 Ada and multi-core CPUs tmoran
@ 2005-09-10  8:27 ` Wilhelm Spickermann
  2005-09-10 17:27   ` tmoran
  2005-09-12 15:48 ` Marc A. Criley
  1 sibling, 1 reply; 8+ messages in thread
From: Wilhelm Spickermann @ 2005-09-10  8:27 UTC (permalink / raw)


Hi,

tmoran@acm.org wrote:

> Iï¿œsplitï¿œtheï¿œdataï¿œarrayï¿œinï¿œhalf,
> sorting one half with the main program and the other with a
> separate task, then merged the two half-results.

Instead of merging, you could also insert another parallel sort,
one for both of the upper quarters and the other for both of the
lower quarters. After that, only the two inner quarters need to
be merged or sorted (perhaps recursively). 
(see D. E. Knuth: The Art of Computer Programming, Vol III
Sorting and Searching, 5.3.4 Networks for Sorting)

Wilhelm Spickermann




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada and multi-core CPUs
  2005-09-10  8:27 ` Wilhelm Spickermann
@ 2005-09-10 17:27   ` tmoran
  2005-09-10 22:01     ` Adrian Knoth
  0 siblings, 1 reply; 8+ messages in thread
From: tmoran @ 2005-09-10 17:27 UTC (permalink / raw)


> Instead of merging, you could ...
  There are many ways to make a parallel sort.  My point was that here
is a very standard time consuming operation, very simple Ada code can
make a simple dual-tasking version, and that version on a hyperthreading
CPU really does run a lot faster.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada and multi-core CPUs
  2005-09-10 17:27   ` tmoran
@ 2005-09-10 22:01     ` Adrian Knoth
  2005-09-10 22:49       ` tmoran
  0 siblings, 1 reply; 8+ messages in thread
From: Adrian Knoth @ 2005-09-10 22:01 UTC (permalink / raw)


tmoran@acm.org <tmoran@acm.org> wrote:

>> Instead of merging, you could ...
>   There are many ways to make a parallel sort.  My point was that here
> is a very standard time consuming operation, very simple Ada code can
> make a simple dual-tasking version, and that version on a hyperthreading
> CPU really does run a lot faster.

Only Hyperthreading with single-core or a real dual-core/SMP-system?


-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Einer spinnt immer. Wenn zwei spinnen, wird's schlimmer



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada and multi-core CPUs
  2005-09-10 22:01     ` Adrian Knoth
@ 2005-09-10 22:49       ` tmoran
  2005-09-12 16:21         ` Jeffrey Carter
  0 siblings, 1 reply; 8+ messages in thread
From: tmoran @ 2005-09-10 22:49 UTC (permalink / raw)


> Only Hyperthreading with single-core or a real dual-core/SMP-system?
I ran the test on my single-core hyperthreaded system.  If you have a
true dual-core system I'd be curious to hear your results.
  After running in 60% of the time by splitting in half, sorting,
then merging the two halves, I tried burying the tasking inside
a quicksort.  On the first partitioning, one of the partitions goes
to a separate task.  That ran around 75%, perhaps because the
partitions are likely not the same size.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada and multi-core CPUs
  2005-09-09 21:33 Ada and multi-core CPUs tmoran
  2005-09-10  8:27 ` Wilhelm Spickermann
@ 2005-09-12 15:48 ` Marc A. Criley
  2005-09-12 19:43   ` tmoran
  1 sibling, 1 reply; 8+ messages in thread
From: Marc A. Criley @ 2005-09-12 15:48 UTC (permalink / raw)


tmoran@acm.org wrote:
> I finally got around to testing a sort.  I split the data array in half,
> sorting one half with the main program and the other with a separate task,
> then merged the two half-results.  It's substantially (about 60% as long
> for 100K floats) faster than splitting, sort one half, then the other
> half, then merge.  And easy to program in Ada.

Write it up and submit for publication.  Chip Multi-Processing 
(multi-core CPUs) seems to be a hot technical issue; it was the theme of 
the latest (9/05) issue of ACM Queue.

-- Marc A. Criley
-- McKae Technologies
-- www.mckae.com
-- DTraq - XPath In Ada - XML EZ Out



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada and multi-core CPUs
  2005-09-10 22:49       ` tmoran
@ 2005-09-12 16:21         ` Jeffrey Carter
  0 siblings, 0 replies; 8+ messages in thread
From: Jeffrey Carter @ 2005-09-12 16:21 UTC (permalink / raw)


tmoran@acm.org wrote:
> 
> I ran the test on my single-core hyperthreaded system.

Curious Subject for a report on a single-core CPU. I find the results 
more interesting now that I know they apply to a single-core system.

My work computer runs WinXP on one or more P4HT processors. Control 
Panel => System, General tab, reports 4 CPUs. Task manager allows 
processes to have "affinity" for up to 2 CPUs. How many CPUs are in the 
machine? I'm not sure, but I think it's one.

-- 
Jeffrey Carter
"Now go away or I shall taunt you a second time."
Monty Python and the Holy Grail
E-mail: jeffrey_r_carter-nr [commercial-at]
         raytheon [period | full stop] com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Ada and multi-core CPUs
  2005-09-12 15:48 ` Marc A. Criley
@ 2005-09-12 19:43   ` tmoran
  0 siblings, 0 replies; 8+ messages in thread
From: tmoran @ 2005-09-12 19:43 UTC (permalink / raw)


> Write it up and submit for publication.  Chip Multi-Processing
> (multi-core CPUs) seems to be a hot technical issue; it was the theme of
> the latest (9/05) issue of ACM Queue.
    I sent them a letter to the editor.  Perhaps someone with better
writing skills than myself could send them an article.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-09-12 19:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-09 21:33 Ada and multi-core CPUs tmoran
2005-09-10  8:27 ` Wilhelm Spickermann
2005-09-10 17:27   ` tmoran
2005-09-10 22:01     ` Adrian Knoth
2005-09-10 22:49       ` tmoran
2005-09-12 16:21         ` Jeffrey Carter
2005-09-12 15:48 ` Marc A. Criley
2005-09-12 19:43   ` tmoran

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