comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: should I be interested in ada?
Date: 1999/02/23
Date: 1999-02-23T00:00:00+00:00	[thread overview]
Message-ID: <7av53r$goc$2@plug.news.pipex.net> (raw)
In-Reply-To: 36D1D862.41C6@lanl.gov

William Clodius wrote in message <36D1D862.41C6@lanl.gov>...
[...]
|>    procedure Reorder (Object: in out Vector; Index: in Selection) is
|>       Temp: constant Vector := Object;
|>    begin
|>       for i in Index'Range loop
|>          Object(Index(i)) := Temp(i);
|>       end loop;
|>    end;
|> <snip>
|
|Even neglecting parallelization issues, the above code does not catch
|the semantics of the FORALL loop, in particular the FORALL does not
|require that either X or J be dimensioned 1:N, only that:
|
|1. the index range include 1:N;
|2. X's range include all values of J(1:N); and
|3. the values of J(1:N) not have any duplicates.
|
|As a result Temp as declared above is assumed to be larger than the
|requirements might actually be, and Index might range past the desired
|bounds.


Its true that the Ada code doesn't capture the same semantics - essentially
that no component of Object will be assigned more than once (and they can be
assigned in any order) - but I'm not sure that this will make any difference
in practice (for a non-parallel target).

The Ada procedure is inlined, so the optimizer may have the opportunity to
eliminate null operations (e.g. assignment to self). I think Temp being too
long will often not be a problem (for a clever dataflow analysing
optimiser). Anyway, the problem can always be got around 'by force', by
passing one or two more parameters into the procedure.

As for the 'parallelization issues', possibly one or two pragmas might help
for SIMD machines (as suggested by another poster recently, I think).

   pragma Assume(Parallel_Update,Object);
   pragma Assume(Spanning_Bijection,Index);

This is, admittedly, a bit hypothetical, since (to my knowledge) there is no
Ada compiler targetting a SIMD architecture, and no immediate prospect of
there being one.

Parallel processor targets can be catered for, in Ada, by encapsulating a
multiple-task solution inside a procedure. I have constructed such a thing
myself (for matrix inversion), as a 'technology demonstrator'. Not neat, but
effective.

|William B. Clodius Phone: (505)-665-9370
|Los Alamos Nat. Lab., NIS-2     FAX: (505)-667-3815
|PO Box 1663, MS-C323    Group office: (505)-667-5776
|Los Alamos, NM 87545            Email: wclodius@lanl.gov

-------------------------------------
Nick Roberts
-------------------------------------








  reply	other threads:[~1999-02-23  0:00 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-14  0:00 should I be interested in ada? Phillip Helbig
1999-02-15  0:00 ` Gautier
1999-02-15  0:00 ` Marin David Condic
1999-02-23  0:00   ` David Starner
1999-02-16  0:00 ` Ken Thomas
1999-02-17  0:00   ` Nick Roberts
1999-02-18  0:00     ` robert_dewar
1999-02-18  0:00       ` Nick Roberts
1999-02-18  0:00         ` William Clodius
1999-02-18  0:00           ` dennison
1999-02-18  0:00     ` robert_dewar
1999-02-18  0:00       ` Nick Roberts
1999-02-18  0:00         ` robert_dewar
1999-02-19  0:00           ` Nick Roberts
1999-02-19  0:00             ` robert_dewar
1999-02-19  0:00               ` Nick Roberts
1999-02-20  0:00                 ` robert_dewar
1999-02-22  0:00                   ` dennison
1999-02-22  0:00                   ` Nick Roberts
1999-02-23  0:00                     ` Robert I. Eachus
1999-02-24  0:00                       ` White rabbit (was: should I be interested in ada?) dennison
1999-02-25  0:00                       ` Alice books " JP Thornley
1999-02-25  0:00                         ` Robert I. Eachus
1999-02-20  0:00                 ` should I be interested in ada? robert_dewar
1999-02-20  0:00                   ` Steve Doiel
1999-02-19  0:00               ` William Clodius
1999-02-19  0:00               ` dennison
1999-02-19  0:00                 ` William Clodius
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00                 ` Nick Roberts
1999-02-20  0:00                   ` robert_dewar
1999-02-22  0:00                     ` Nick Roberts
1999-02-19  0:00               ` Phillip Helbig
1999-02-18  0:00         ` William Clodius
1999-02-18  0:00           ` robert_dewar
1999-02-19  0:00             ` William Clodius
1999-02-19  0:00               ` Nick Roberts
1999-02-20  0:00                 ` robert_dewar
1999-02-22  0:00                   ` Nick Roberts
1999-02-22  0:00                     ` William Clodius
1999-02-23  0:00                     ` robert_dewar
1999-02-23  0:00                       ` Nick Roberts
1999-02-22  0:00                 ` William Clodius
1999-02-23  0:00                   ` Nick Roberts [this message]
1999-02-23  0:00                     ` William Clodius
1999-02-25  0:00                       ` Nick Roberts
1999-02-25  0:00                         ` robert_dewar
1999-02-23  0:00               ` Robert I. Eachus
1999-02-24  0:00                 ` Nick Roberts
1999-02-26  0:00                   ` Robert A Duff
1999-02-27  0:00                     ` Semantic info pragmas (was: should I be interested in ada?) Nick Roberts
1999-03-01  0:00                       ` Samuel Tardieu
1999-03-01  0:00                         ` Robert A Duff
1999-02-24  0:00                 ` should I be interested in ada? William Clodius
1999-02-24  0:00               ` William Clodius
1999-02-25  0:00                 ` Nick Roberts
1999-02-25  0:00                   ` robert_dewar
1999-02-26  0:00                     ` Nick Roberts
1999-02-18  0:00           ` nabbasi
1999-02-18  0:00             ` robert_dewar
1999-02-18  0:00         ` Jerry Petrey
1999-02-18  0:00           ` fraser
1999-02-19  0:00             ` Matthew Heaney
1999-02-20  0:00               ` fraser
1999-02-18  0:00           ` Nick Roberts
1999-02-18  0:00             ` Joel Seidman
1999-02-18  0:00             ` Dan Nagle
1999-02-18  0:00               ` nabbasi
1999-02-19  0:00               ` Nick Roberts
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00                   ` Nick Roberts
1999-02-19  0:00                     ` robert_dewar
1999-02-21  0:00                       ` William Clodius
1999-02-23  0:00                         ` Robert I. Eachus
1999-02-19  0:00                     ` William Clodius
1999-02-20  0:00                       ` Nick Roberts
1999-02-21  0:00                         ` robert_dewar
1999-02-21  0:00                           ` William Clodius
1999-02-22  0:00                           ` Nick Roberts
1999-02-19  0:00                 ` Dan Nagle
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                     ` Dan Nagle
1999-02-19  0:00                     ` Nick Roberts
1999-02-23  0:00                     ` Peter Hermann
1999-02-20  0:00 ` Hartmut H. Schaefer
1999-02-20  0:00   ` bill
1999-02-21  0:00     ` dewar
1999-02-21  0:00   ` dewar
1999-02-22  0:00     ` dennison
replies disabled

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