9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Roman V. Shaposhnik" <rvs@sun.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] GCC/G++: some stress testing
Date: Sun,  2 Mar 2008 19:31:16 -0800	[thread overview]
Message-ID: <1204515076.27006.173.camel@goose.sun.com> (raw)
In-Reply-To: <E329B8ED-63E6-42C7-BB0B-81F4FAF79962@telus.net>

On Sun, 2008-03-02 at 12:34 -0800, Paul Lalonde wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> CSP doesn't scale very well to hundreds of simultaneously executing
> threads (my claim, not, as far as I've found yet, anyone else's).

I take it that you really do mean "simultaneous". As in: you actually
have hundreds of cores available on the same system. I'm actually
quite curious to find out what's the highest number of cores available
of a single shared memory systems that you, or anybody else has
experienced in practice so far (mine would be 32 == 8 CPUs x 4 cores AMD
Barcelona)? Now even more important question is -- what are the
expectations for, this number in 5 years from now?

> Programming the memory hierarchy is really a specific instance of
> programming for masking latency.  This goes well beyond inserting
> prefetches in an optimization stage,

In fact the more I think about it, the more it seems like having
a direct way of manipulating L1/L2 caches would be more of a benefit
than a curse at this point. Prefetches are nothing but a patchwork
over the fundamental need for programming memory hierarchy in an
efficient way. But, I guess, there's more to it on the hardware side
than just crafting additional opcodes.

> presenting itself as problem
> decompositions that keep the current working set in cache (at L3, L2,
> or L1 granularity, depending), while simultaneously avoiding having
> multiple processors chewing on the same data (which leads to vast
> amounts of cache synchronization bus traffic).  Successful algorithms
> in this space work on small bundles of data that either get flushed
> back to memory uncached (to keep more cache for streaming in), or in
> small bundles that can be passed from compute kernel to compute
> kernel cheaply.  Having language structures to help with these
> decompositions and caching decisions is a great help - that's one of
> the reasons why functional programming keeps rearing its head in this
> space.  Without aliasing and global (serializing) state it's much
> easier to analyze the program and chose how to break up the
> computation into kernels that can be streamed, pipelined, or
> otherwise separated to allow better cache utilization and parallelism.

Very well said, indeed! I can't agree more, especially on the issue
of functional programming being very well suited for parallelism.
In fact, here at Sun we've had a curious little experiment run by
Tim Bray:
   http://www.tbray.org/ongoing/When/200x/2007/09/20/Wide-Finder
with a very unexpected result as to what would be the ideal
language for what seems to be an embarrassingly parallel problem.

> Currently, the best performing programs I know for exploiting the
> memory hierarchy are C and C++ programs written in a  "kernel
> composition" kind of model that the language supports poorly.  You
> can do it, but it feels more like coding in assembly than like
> expressing your algorithms.  Much of the template metaprogramming is
> about taking measures of cache spaces and data sets and turning out
> code (statically) tuned to those sizes.  There's a huge opportunity
> for a JIT language to allow better adaptability to changing data sets
> and numbers of active threads.

These techniques help. No doubt about it. Still, I don't think that we
have much of choice when the # of compute units hits hundreds of
thousands -- at that level shared state  and side effects propagated
through it will be just too much to stomach. We clearly need a very
different way of thinking about programming and also the way of
expressing our ideas. None of the mainstream languages seem to fit
the bill. And as far as I can tell this makes it one of the hottest
research areas in the industry. Everybody wants to hit that jackpot
by inventing C for the parallel world.

Thanks,
Roman.

P.S. We had Don Knuth lecturing at Sun Labs a couple of days ago and he
gave us all a real scare when he officially proclaimed that he could NOT
see any way of how his reasoning about computation and algorithms
could be applied to parallelism. In fact, in his latest volume he has
an explicit disclaimer to that effect.


  parent reply	other threads:[~2008-03-03  3:31 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-01  4:55 lucio
2008-03-01  6:02 ` Eric Van Hensbergen
2008-03-01  6:25   ` lucio
2008-03-01  6:39   ` Lyndon Nerenberg
2008-03-01  6:52     ` lucio
2008-03-01  6:59       ` Lyndon Nerenberg
2008-03-01  7:42         ` lucio
2008-03-01  7:56           ` Lyndon Nerenberg
2008-03-01  7:11     ` ron minnich
2008-03-01  7:29       ` Lyndon Nerenberg
2008-03-01 16:40         ` ron minnich
2008-03-01 16:50           ` Bruce Ellis
2008-03-01  8:14       ` lucio
2008-03-01 11:13         ` hiro
2008-03-01 11:47           ` [9fans] intellect? Lyndon Nerenberg
2008-03-01 11:51             ` Lyndon Nerenberg
2008-03-01 11:53             ` Charles Forsyth
2008-03-01 12:11             ` hiro
2008-03-01 12:37               ` hiro
2008-03-01 16:22     ` [9fans] GCC/G++: some stress testing Eric Van Hensbergen
2008-03-01  7:12 ` ron minnich
2008-03-01  7:32   ` Lyndon Nerenberg
2008-03-01 11:49 ` Charles Forsyth
2008-03-01 11:58   ` lucio
2008-03-01 18:15   ` don bailey
2008-03-01 18:24     ` erik quanstrom
2008-03-01 20:19     ` lucio
2008-03-01 21:36       ` ron minnich
2008-03-02  1:07         ` Paul Lalonde
2008-03-02  4:28           ` ron minnich
2008-03-02  8:03             ` Bruce Ellis
2008-03-02 11:12           ` Charles Forsyth
2008-03-02 16:21             ` Paul Lalonde
2008-03-02 18:59               ` erik quanstrom
2008-03-02 20:34                 ` Paul Lalonde
2008-03-02 22:00                   ` Philippe Anel
2008-03-03  3:19                     ` ron minnich
2008-03-03  9:12                       ` Philippe Anel
2008-03-03  3:25                     ` Paul Lalonde
2008-03-03  9:12                       ` Philippe Anel
2008-03-04  2:31                         ` Paul Lalonde
2008-03-03  3:31                   ` Roman V. Shaposhnik [this message]
2008-03-04  0:49                     ` erik quanstrom
2008-03-04  2:17                       ` Paul Lalonde
2008-03-04  4:52                         ` erik quanstrom
2008-03-04 10:57                     ` Paweł Lasek
2008-03-04 14:57                       ` ron minnich
2008-03-04 15:55                         ` Philippe Anel
2008-03-04 18:27                           ` ron minnich
2008-03-04 18:00                       ` Roman V. Shaposhnik
2008-03-07  5:21   ` lucio
2008-03-07 10:21     ` Russ Cox
2008-03-07 11:15       ` Pietro Gagliardi
2008-03-07 18:49         ` Skip Tavakkolian
2008-03-07 18:55           ` lucio
2008-03-07 17:22       ` lucio
2008-03-01 14:45 ` lejatorn
2008-03-01 14:49   ` Pietro Gagliardi
2008-03-01 15:17     ` lucio
2008-03-01 16:35       ` Pietro Gagliardi
2008-03-01 16:41       ` ron minnich
2008-03-01 16:53         ` Bruce Ellis
2008-03-01 17:13           ` ron minnich
2008-03-01 20:29             ` geoff
2008-03-01 21:36               ` ron minnich
2008-03-01 22:29                 ` Bruce Ellis
2008-03-04  7:35         ` Lyndon Nerenberg
2008-03-01 15:02   ` lucio
2008-03-01 16:31     ` Eric Van Hensbergen
2008-03-01 17:52     ` lejatorn
2008-03-02 17:57     ` sqweek
2008-03-02 18:22       ` lucio
2008-03-02 20:56       ` cinap_lenrek
2008-03-09 17:53 Aharon Robbins
2008-03-09 17:57 ` Bruce Ellis
2008-03-09 18:28 ` Pietro Gagliardi
2008-03-09 19:17   ` erik quanstrom
2008-03-09 19:22   ` Skip Tavakkolian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204515076.27006.173.camel@goose.sun.com \
    --to=rvs@sun.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).