Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #15530

Re: The container abstraction and parallel programming

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: The container abstraction and parallel programming
Date 2012-01-07 22:03 +1300
Message-ID <9mqg3lFdr5U6@mid.individual.net> (permalink)
References <je7uhf$hjj$1@speranza.aioe.org> <9mpj60Fdr5U5@mid.individual.net> <je8vto$bi6$1@speranza.aioe.org>

Show all headers | View raw


On 01/ 7/12 09:31 PM, jacob navia wrote:
> Le 07/01/12 01:50, Ian Collins a écrit :
>> On 01/ 7/12 12:02 PM, jacob navia wrote:
>>> Today, more than 10 years tafter Intel introduced the first SIMD
>>> instructions it is still not possible to use those instructions to do
>>> SIMD programming when you use C and two mainstream compilers like gcc or
>>> MSVC.
>>>
>>>  From the C side there is absolutely no support for this type of
>>> programming, even though plain arrays could do the trick obviously.
>>
>> That may be the case for those compilers, but not for others. For
>> example the Sun Studio compilers (I'd expect Intel to offer something as
>> well) have a number of vector processing optimisations which include simd.
>>
>
> Yes, Intel and Sun, as hardware vendors, have a real interest in making
> people use the features of their hardware and will try to propose
> either automatically SIMD deduction or inline assembly that supports
> their features directly.
>
> Problem is, even after dozens of years and millions and millions of
> dollars in research, automatic SIMD parallelization remains VERY
> difficult for the genral case. The problem, basically, is as follows:
>
> Automatic parallelization must PROVE that no dependencies exist
> between the array members, no unforeseen side effects can possibly
> occur and ONLY THEN the constructs in question can be parallelized.
>
> All this needs extensive program analysis, what is made even more
> difficult with the model of separate module compilation...

> High level constructs designed to allow the programmer assert that
> he/she wants parallel programming FOR THIS OBJECT simplify the
> task of the compiler, allowing for simpler compilers and more
> widespread use.

I guess pragmas are another option, as used for OpenMP.  We already have 
the restrict keyword to simplify analysis with pointer parameters, maybe 
something similar for parallelisation?

>>> The container abstraction, specifically the valarray container, could be
>>> used to *mean* SIMD using operator overloading.
>>
>> A similar approach has been used by some compilers for many years,
>> typically implemented as some form of "performance library" for vector
>> type operations.
>>
>
> Yes, I just wanted to propose that idea not for a single compiler but
> for the language in general.

I do see your point, but there are many CPU/OS specific tricks used to 
get the optimum performance on a particular platform, which is way 
vendor's compilers generally squeeze the best performance from a system. 
  Would this on its own do enough to justify its inclusion in the language?

-- 
Ian Collins

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-07 00:02 +0100
  Re: The container abstraction and parallel programming blp@cs.stanford.edu (Ben Pfaff) - 2012-01-06 15:08 -0800
    Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-07 00:27 +0100
      Re: The container abstraction and parallel programming blp@cs.stanford.edu (Ben Pfaff) - 2012-01-06 15:30 -0800
        Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-07 00:41 +0100
  Re: The container abstraction and parallel programming Kaz Kylheku <kaz@kylheku.com> - 2012-01-07 00:04 +0000
    Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-07 09:06 +0100
    Re: The container abstraction and parallel programming Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-01-08 03:42 -0800
  Re: The container abstraction and parallel programming Ian Collins <ian-news@hotmail.com> - 2012-01-07 13:50 +1300
    Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-07 09:31 +0100
      Re: The container abstraction and parallel programming Ian Collins <ian-news@hotmail.com> - 2012-01-07 22:03 +1300
      Re: The container abstraction and parallel programming Stephen Sprunk <stephen@sprunk.org> - 2012-01-07 07:39 -0600
        Re: The container abstraction and parallel programming Gene <gene.ressler@gmail.com> - 2012-01-07 09:27 -0800
          Re: The container abstraction and parallel programming Stephen Sprunk <stephen@sprunk.org> - 2012-01-08 11:37 -0600
            Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-08 18:42 +0100
        Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-08 11:48 +0100
          Re: The container abstraction and parallel programming ec429 <ec429@cam.ac.uk> - 2012-01-08 11:16 +0000
          Re: The container abstraction and parallel programming Stephen Sprunk <stephen@sprunk.org> - 2012-01-08 11:52 -0600
            Re: The container abstraction and parallel programming Keith Thompson <kst-u@mib.org> - 2012-01-08 14:17 -0800
              Re: The container abstraction and parallel programming pete <pfiland@mindspring.com> - 2012-01-08 22:08 -0500
              Re: The container abstraction and parallel programming Stephen Sprunk <stephen@sprunk.org> - 2012-01-09 11:07 -0600
                Re: The container abstraction and parallel programming Keith Thompson <kst-u@mib.org> - 2012-01-09 14:55 -0800
            Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-09 00:22 +0100
          Re: The container abstraction and parallel programming Nobody <nobody@nowhere.com> - 2012-01-09 14:19 +0000
            Re: The container abstraction and parallel programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-09 16:40 +0000
            Re: The container abstraction and parallel programming Kaz Kylheku <kaz@kylheku.com> - 2012-01-09 17:53 +0000
            Re: The container abstraction and parallel programming Gene <gene.ressler@gmail.com> - 2012-01-10 16:58 -0800
  Re: The container abstraction and parallel programming Robert Wessel <robertwessel2@yahoo.com> - 2012-01-07 01:28 -0600
  Re: The container abstraction and parallel programming Jens Gustedt <jens.gustedt@loria.fr> - 2012-01-07 09:39 +0100
    Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-07 09:54 +0100
      Re: The container abstraction and parallel programming Jens Gustedt <jens.gustedt@loria.fr> - 2012-01-07 11:36 +0100
  Re: The container abstraction and parallel programming Gareth Owen <gwowen@gmail.com> - 2012-01-08 08:08 +0000
    Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-08 11:41 +0100
      Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-08 11:53 +0100
      Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-08 11:59 +0100
      Re: The container abstraction and parallel programming ec429 <ec429@cam.ac.uk> - 2012-01-08 11:05 +0000
        Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-08 12:29 +0100
          Re: The container abstraction and parallel programming ec429 <ec429@cam.ac.uk> - 2012-01-08 13:35 +0000
      Re: The container abstraction and parallel programming gwowen <gwowen@gmail.com> - 2012-01-09 01:09 -0800
      Re: The container abstraction and parallel programming Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-26 09:23 -0800
        Re: The container abstraction and parallel programming jacob navia <jacob@spamsink.net> - 2012-01-26 23:41 +0100
          Re: The container abstraction and parallel programming Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-07 16:18 -0800

csiph-web