comp.lang.ada
 help / color / mirror / Atom feed
From: Gene <gene.ressler@gmail.com>
Subject: Re: How many hardware threads?
Date: Mon, 12 Jul 2010 17:01:00 -0700 (PDT)
Date: 2010-07-12T17:01:00-07:00	[thread overview]
Message-ID: <4627c02d-c44c-4841-bd77-e25aee4be173@q12g2000yqj.googlegroups.com> (raw)
In-Reply-To: xah7sg1n8ib8$.26txy5fbnmui.dlg@40tude.net

On Jul 12, 3:40 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On Sun, 11 Jul 2010 20:47:41 -0400, Peter C. Chapin wrote:
> > I see a couple of difficulties with writing effective parallel programs
> > for "ordinary" applications (that is, applications that are not
> > embarrassingly parallel). One difficulty is load balancing: how can one
> > decompose a problem to keep all processors reasonably busy? The other
> > difficulty is scalability: how can one design a single program that can
> > use 2, 4, 16, 128, or more processors effectively without knowing ahead
> > of time exactly how many processors there will be? I'm not an expert in
> > Ada tasking but it seems like these questions are as big a problem for
> > Ada as they are for any other language environment.
>
> Back in 90's, during the era of transputers, concurrent algorithms were
> decomposed knowing in advance the number of processors and the topology of
> the network of. (Unlike to multi-cores the transputers didn't share memory,
> they communicate over serial links connected physically) That time the
> consensus was that the problem is not solvable in general. So you designed
> up front both the algorithm and the topology.
>
> > I'm not an expert in
> > Ada tasking but it seems like these questions are as big a problem for
> > Ada as they are for any other language environment.
> > I'm not looking for a solution to all tasking problems here. But there
> > is one feature that seems like a necessary prerequisite to such a
> > solution. The language (or its standard library) needs to provide a
> > portable way for the program to determine how many hardware threads are
> > available.
>
> Well, maybe, but I don't think it would bring much. Especially because
> normally cores support multi-tasking. It would be more important for the
> architectures with the cores that do not (GPU etc).
>
> BTW, "hardware thread" = core? processor? ALU + an independent memory
> channel? etc. It is quite difficult to define and the algorithm's
> performance may heavily depend on the subtleness. ARG would say, look, it
> does not make sense for all platforms, forget it.
>
> > I'm about to write a simple program that decomposes into parallel,
> > compute-bound tasks quite nicely. How many such tasks should I create?
>
> Back in time it was popular to make it adaptive. I.e. you monitor the
> performance and adjust the size of the working threads pool as you go. I
> remember some articles on this topic, but it was long long ago...
>
> --
> Regards,
> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de

Dmitry has it exactly right.  When a "hardware thread" can be anything
from a fraction of a core to a node on an Ethernet-connected cluster,
how many you have is not such an important question.

Guessing high and allowing the OS to sort things out has severe
limitations.  What to guess?  4? 16? 256?

When there is only a small number of independent performance control
variables, e.g. one in the case of a common thread pool, the self-
monitoring and adjustment scheme is the only one with legs.

Other multi-threading models like work stealing present a more complex
tuning problem.  Evolutionary (genetic) algorithms ought to be a
powerful way for software to adapt to its own environment. Is there
anyone doing work on this?



  parent reply	other threads:[~2010-07-13  0:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-12  0:47 How many hardware threads? Peter C. Chapin
2010-07-12  2:31 ` Jeffrey R. Carter
2010-07-12 17:04   ` Pascal Obry
2010-08-16 19:36     ` Yannick Duchêne (Hibou57)
2010-08-17  3:45       ` Randy Brukardt
2010-08-17  9:27       ` Pascal Obry
2010-07-12  2:38 ` tmoran
2010-07-12  7:40 ` Dmitry A. Kazakov
2010-07-12 17:14   ` Warren
2010-07-13  0:01   ` Gene [this message]
2010-07-13  1:09     ` Shark8
2010-07-12 10:08 ` anon
2010-07-12 11:04 ` Ludovic Brenta
2010-07-12 11:47 ` Egil Høvik
replies disabled

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