Newsgroups: comp.parallel
From: heinze@i41s5.ira.uka.de (Ernst A. Heinz)
Subject: Re: [Q] Any PRAM simulators out there?
Keywords: IPD Modula-2*, PRAM simulator
Organization: University of Karlsruhe, FRG
Date: Sun, 5 Feb 1995 01:23:53 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Message-ID: <3gnofn$563@nz12.rz.uni-karlsruhe.de>

Hello!

Our Modula-2* system effectively is a PRAM compiler because our FORALL equals
those used in standard textbooks on PRAM algorithms. FYI I include the
announcement of our system below. Sequential and thread-parallel versions
of our Modula-2* system for Solaris 2.x are to be released soon.

Greetings from Germany.

=Ernst=
-- 
+--------------------------------------------------------+-------------------+
| Ernst A. Heinz              (email: heinze@ira.uka.de) |                   |
| Institut fuer Programmstrukturen und Datenorganisation | Make it as simple |
| Fakultaet fuer Informatik, Universitaet Karlsruhe      | as possible, but  |
| Postfach 6980, D-76128 Karlsruhe, F.R. Germany         | not simpler.      |
| (Voice: ++49/(0)721/6084386, FAX: ++49/(0)721/694092)  |                   |
+--------------------------------------------------------+-------------------+

"It has recently been found out that research causes cancer in rats!"

*******************************************************************************

***   F I N A L L Y   R E L E A S E D   A N D   A V A I L A B L E   N O W   ***


+------------------------------------------------------------------------------+
|                                                                              |
|                                                                              |
|                  M o d u l a - 2 *   Programming Environment                 |
|                                                                              |
|                                  created by                                  |
|                                                                              |
|            Thomas Gauweiler,  Stefan U. Haenssgen,  Ernst A. Heinz           |
|              Paul Lukowicz,  Hendrik Mager,  Michael Philippsen              |
|                                                                              |
|                            email:  msc@ira.uka.de                            |
|                                                                              |
|                                                                              |
|                    registration email:  ipdm2s@ira.uka.de                    |
|                                                                              |
|                                                                              |
|         Institute for Program Structures and Data Organization (IPD)         |
|                           Department of Informatics                          |
|                            University of Karlsruhe                           |
|                                 F.R. Germany                                 |
|                                                                              |
|                                April 10, 1994                                |
|                                                                              |
|                                                                              |
+------------------------------------------------------------------------------+


The IPD Modula-2* team is pleased to announce the final release of version 9401
of the new Modula-2* programming environment for the following architectures:

I386  =  386/486/Pentium PC running BSDI/386 Unix (sequential)
KSRS  =  Kendall Square Research KSR-1/KSR-2 running KSR-OS (sequential)
LINX  =  386/486/Pentium PC running Linux (sequential)
MIPS  =  R3000/R4000 DECStation running Ultrix (sequential)
SUN3  =  680x0 Sun-3 running SunOS (sequential)
SUN4  =  SPARC Sun-4/SparcStation running SunOS (sequential)

In the near future IPD Modula-2* version 9401 will also be available for two
real parallel machines:

KSRP  =  Kendall Square Research KSR-1/KSR-2 running KSR-OS (parallel)
MASP  =  MasPar MP-1/MP-2 with DECStation frontend running MP-Ultrix (parallel)

Please stay tuned if you are interested in the latter!


+---------------+
| Functionality |
+---------------+

We have experienced our Modula-2* system to be a very useful tool for research,
education, and even large scale program development.

The outstanding advantages of the IPD Modula-2* system follow from its unique
support of explicitly parallel high-level language constructs on a variety of
parallel and sequential machines. This and the fact that it does not cost
anything if solely used for research and/or educational purposes, make our
Modula-2* system an attractive and valuable platform for classes and courses in
parallel programming. The Modula-2* parallel libraries "msEnum", "msReduce", and
"msScan", included in the system with complete source codes, surely add to this
attraction. These libraries efficiently implement various primitive parallel
operations like reductions and scans for one-dimensional arrays.

But the IPD Modula-2* system is  n o t  only directed towards parallel
programming. Beside its explicitly parallel features, it is a complete
sequential Modula-2 programming environment offering:

 - an optimizing compiler translating Modula-2 source programs to portable C,
 - transparent interfacing and full integration of foreign modules written in C,
 - a sophisticated cross-architecture make facility generating standard Unix
   makefiles that trigger the separate compilation of Modula-2 and generated or
   foreign C modules (including automatic re-compilation whenever necessary),
 - X Windows and Emacs development support,
 - and some basic libraries (e.g. "msFIO", "msIO", "msMath", and "msTimer").

Although the translation to C causes some complications and disadvantages,
mainly the missing option of runtime range and index checking, we are still
convinced that its gains clearly outnumber the associated problems. The central
arguments for C as an "intermediate" language are availability, portability, and
resulting native code quality. Furthermore, many real parallel computer systems
do not even support lower-level languages than C which was quite important for
our Modula-2* effort.

The biggest drawback of the IPD Modula-2* system is the lack of good and
consistent symbolic debugging support in terms of the language. Naturally, you
can always use your favourite C debugger to investigate the generated C codes.
Beside "debugging by value printing" this is what we usually do. It actually
works fine because the generated C programs resemble the Modula-2 originals very
closely as for structure, readability, and identifiers. But the scheme is far
from satisfactory, of course!


+--------------+
| Availability |
+--------------+

The IPD Modula-2* system is available for 386/486/Pentium PCs running Linux,
R3000/R4000 DECStations running Ultrix, SPARC Sun-4s or SparcStations running
SunOS, 680x0 Sun-3s running SunOS, and MasPar MP-1/MP-2 massively parallel
systems with DECStation frontends running MP-Ultrix.

In addition to the above platforms on which the IPD Modula-2* environment
actually runs, it is able to generate code for 386/486/Pentium PCs running
BSDI/386 Unix and Kendall Square Research KSR-1/KSR-2 parallel systems
running KSR-OS. Program development for these target machines is supported
by an easy-to-use and fully automatic cross-architecture make facility.

The following table lists all the machines and their symbolic architecture
names currently supported by the IPD Modula-2* system.

I386  =  386/486/Pentium PC running BSDI/386 Unix (sequential)
KSRP  =  Kendall Square Research KSR-1/KSR-2 running KSR-OS (parallel)
KSRS  =  Kendall Square Research KSR-1/KSR-2 running KSR-OS (sequential)
LINX  =  386/486/Pentium PC running Linux (sequential)
MASP  =  MasPar MP-1/MP-2 with DECStation frontend running MP-Ultrix (parallel)
MIPS  =  R3000/R4000 DECStation running Ultrix (sequential)
SUN3  =  680x0 Sun-3 running SunOS (sequential)
SUN4  =  SPARC Sun-4/SparcStation running SunOS (sequential)


+--------------+
| Distribution |
+--------------+

You can get the IPD Modula-2* distributions for all supported architectures by
anonymous ftp from "ftp.ira.uka.de" [129.13.10.90] in the directory
"pub/programming/modula2star". Please do not forget to use binary mode when
retrieving any of them! Their names and functionalities are listed below.

 - "ipdm2s-install"               (installation script)
 - "ipdm2s.doc.tar"               (documentation archive)
 - "ipdm2s.<VERSION>.<ARCH>.tgz"  (distribution archives)

The IPD Modula-2* distribution contains only binaries. Unfortunately, we cannot
make the sources of our system publicly available. (:-Considering the state of
our sources and the many hacks contained therein, this seems to be a wise scheme
anyhow ...-:) The documentation archive features abundant gzip'ed documentation
(well, at least sort of) and comes in "tar" format. The distribution archives
are in gzip'ed "tar" format and consist of:

 - compiler "msc",
 - symbolic source-level debugger prototype "msdb" (available for SUN4 only),
 - makefile generator "msmfg",
 - main cross-architecture make facilty driver "mm",
 - several useful command scripts (e.g. "mmclean", "msdel", "msrun", "msproj"),
 - graphical X Windows environment panel "xmsp",
 - Emacs elisp-mode "m2s.el" for Modula-2*,
 - parallel libraries "msEnum", "msReduce", and "msScan",
 - some basic libraries (e.g. "msFIO", "msIO", "msMath", "msTimer"), and
 - collected Modula-2* example programs.


+--------------+
| Installation |
+--------------+

To install version <VERSION> of the IPD Modula-2* system in directory
<INSTALL_DIR> for architecture <ARCH> please execute:

  "ipdm2s-install <VERSION> <INSTALL_DIR> <ARCH>"

*** WARNING ***
  The install script overwrites the files ".mspath", "Xmsp", and "architecture"
  in the directory <INSTALL_DIR>. If you have already installed IPD Modula-2*
  for another architecture and possibly modified these files, you should back
  them up before starting the new install procedure.
     The install script also overwrites any existing IPD Modula-2* installation
  in directory <INSTALL_DIR> for architecture <ARCH>. If you want to keep your
  current installation you must back it up, too.


+--------------+
| Registration |
+--------------+

Although IPD Modula-2* does not cost anything if solely used for research and/or
educational purposes, we ask you to send a registration email to our electronic
registration secretary "ipdm2s@ira.uka.de". Please clearly state your name and
current affiliation as well as all archives you retrieved, installed, and intend
to use. Thank you very much for your co-operation in advance!

Keeping such a registration database is advantageous for both you and us. In
case of bug fixes and updates, we can directly inform each registered user. As
for funding the future of IPD Modula-2*, evidence of a world-wide user base may
decide between "life and death".

For further information and bug reports please contact the IPD Modula-2* team
at "msc@ira.uka.de".


+---------------------+
| Language Extensions |
+---------------------+

The programming language Modula-2* was developed to support high-level and
machine-independent parallel programming. As described in [1], it embodies the
following features:

 - An arbitrary number of processes operate on data in the same  s i n g l e 
   address space. Note that shared memory is not required. The single address
   space merely permits all memory to be addressed uniformly but not necessarily
   at uniform speed.

 - Synchronous and asynchronous parallel computations as well as arbitrary
   nestings thereof can be formulated in a totally machine-independent way.

 - Procedures may be called in any context, sequential or parallel, and at any
   nesting depth. Additional parallel computations can be spawned inside
   procedures (recursive parallelism).

 - All abstraction mechanisms of Modula-2 are available for parallel programs.

Despite its many achievements, Modula-2* extends Modula-2 with just two new
language constructs of simple and compact nature:

1.  The distribution of array data may optionally be specified by so-called
    a l l o c a t o r s.  These are machine-independent layout hints for the
    compiler without any semantic meaning.

      Allocator ::= LOCAL | SPREAD | CYCLE | SBLOCK | CBLOCK .

      ArrayType ::= ARRAY <SimpleType> [<Allocator>]
                          {"," <SimpleType> [<Allocator>]} OF <Type> .

    Date arrays will only be physically distributed over the available processor
    memories if any of their dimensions are decorated with allocators other than
    LOCAL. If no allocator is specified at all it defaults to LOCAL. Therefore,
    the below declarations of B and C are effectively equivalent.

    VAR  A: ARRAY[1..n] SPREAD OF INTEGER;
         B: ARRAY[1..n], [1..n] OF INTEGER;
         C: ARRAY[1..n] LOCAL, [1..n] LOCAL OF INTEGER;
         D: ARRAY[1..n] SBLOCK, [1..n] SBLOCK OF INTEGER;

2.  To support explicitly parallel computations, Modula-2* introduces the
    F O R A L L  statement in a synchronous and an asynchronous version.

      ForallStatement ::= FORALL <Ident> ":" <SimpleType> IN (PARALLEL | SYNC)
                          [  <VariableDeclaration>
                          BEGIN      ]
                            <StatementSequence>
                          END .

    Here, <SimpleType> denotes an enumeration or a possibly non-static subrange,
    i.e. the boundary expressions may contain variables. The FORALL creates as
    many (conceptual) processes as there are elements in <SimpleType>. The
    identifier introduced by the FORALL statement is local to it and serves as a
    runtime constant for every created process. The runtime constant of each
    process is initialized to a unique value of <SimpleType>.
       All processes created by a FORALL obtain private instances of variables
    declared in the optional <VariableDeclaration> part. Then they execute the
    statements in <StatementSequence>. The END of a FORALL imposes a synchroni-
    zation barrier on the participating processes; termination of the whole
    FORALL is delayed until all created processes have finished their execution
    of <StatementSequence>.
       The processes of a synchronous FORALL execute <StatementSequence> in
    lock-step, while they run concurrently in the asynchronous case. Hence, for
    non-overlapping vectors X, Y, Z an asynchronous FORALL statement suffices to
    implement the vector addition X=Y+Z.

    FORALL i: [1..n] IN PARALLEL
      Z[i] := X[i] + Y[i];
    END;

    In contrast to the above, parallel modifications of overlapping data
    structures may require synchronization. Here, synchronous FORALLs even allow
    for easy formulation of arbitrary irregular data permutations.

    FORALL i: [1..n] IN SYNC
      X[i] := X[p(i)];
    END;

    The above synchronous FORALL permutes vector X according to permutation
    function p(). The synchronous semantics ensure that all RHS elements X[p(i)]
    are read and temporarily stored before any LHS variable X[i] is written.
       The behaviour of branches and loops inside synchronous FORALLs is defined
    with a MSIMD (multiple SIMD) machine in mind. Consequently, Modula-2* does
    not require any synchronization between different branches of synchronous
    CASE or IF statements. The exact synchronous semantics of all Modula-2*
    statements, including nested FORALLs, and the effects of allocator
    declarations are described in [2] and [3].
       To illustrate the syntax and semantics of private variable declarations
    inside FORALLs we close this section with an example of a naively parallel
    matrix multiply combined with a matrix transposition that computes the
    resulting matrix C according to C=trans(A*B).

    FORALL i: [1..n] IN PARALLEL
      FORALL j: [1..n] IN PARALLEL
        VAR Cij, k: INTEGER;
      BEGIN
        Cij := 0;
        FOR k:=1 TO n DO            (* calculate vector product of i-th row   *)
          INC(Cij, A[i,k]*B[k,j]);  (* of A and j-th column of B in local Cij *)
        END;
        C[j,i] := Cij;              (* transposition by storing Cij in C[j,i] *)
      END;
    END;


+---------+
| Credits |
+---------+

The Modula-2* environment was developed at the Institute for Program Structures
and Data Organization (IPD), Department of Informatics, University of Karlsruhe,
F.R. Germany. During the long time of its creation the IPD Modula-2* system
engaged many people as the following list of kernel contributors demonstrates:

 - Thomas Gauweiler     (distribution, documentation, msmfg, test suite)
 - Stefan U. Haenssgen  (debugger, msXDW, xmsp)
 - Ernst A. Heinz       (compiler, demos, documentation, drivers, libraries)
 - Paul Lukowicz        (compiler, demos)
 - Hendrik Mager        (semantic analysis)
 - Michael Philippsen   (benchmarks, compiler, test suite)

We thank Walter F. Tichy and Christian G. Herter for their initial definition
of the Modula-2* language extensions.

Furthermore, Juergen Fritsch deserves due credits for his corrections and
extensions of the Modula-2* parallel libraries "msEnum", "msReduce", and
"msScan" --- thank you, Juergen!


+------------+
| Literature |
+------------+

[1]  S.U. Haenssgen, E.A. Heinz, P. Lukowicz, M. Philippsen, and W.F. Tichy.
     "The Modula-2* environment for parallel programming."
     In Proceedings of the Working Conference on Programming Models for
     Massively Parallel Computers, Berlin, Germany, September 20-22, 1993.
     (available by anonymous ftp from i41s10.ira.uka.de [129.13.13.110]
      in directory "pub/m2s" as "pmmp93.ps", "pmmp93.ps.gz", or "pmmp93.ps.Z")

[2]  W.F. Tichy and C.G. Herter.
     "Modula-2*: An extension of Modula-2 for highly parallel,
      portable programs."
     Technical Report No. 4/90, Department of Informatics,
     University of Karlsruhe, January 1990.
     (available by anonymous ftp from i41s10.ira.uka.de [129.13.13.110]
      in directory "pub/m2s" as "m2s90.ps", "m2s90.ps.gz", or "m2s90.ps.Z")

[3]  J.R. Smith.
     "The design and analysis of parallel algorithms.
      Chapter 3: Modula-2*."
     Oxford University Press, December 1992.

[4]  M. Philippsen, E.A. Heinz, and P. Lukowicz.
     "Compiling machine-independent parallel programs."
     ACM SIGPLAN Notices, Volume 28, No. 8, pages 99-108, August 1993.

[5]  M. Philippsen, T.M. Warschko, W.F. Tichy, C.G. Herter, E.A. Heinz,
     and P. Lukowicz.
     "Project Triton: Towards improved programmability of parallel computers."
     In D.J. Lija and P.L. Bird (editors), The Interaction of Compilation
     Technology and Computer Architecture, Kluwer Academic Publishers, 1994.


