Path: utzoo!attcan!uunet!mcvax!ruuinf!atze
From: atze@ruuinf.UUCP (Drs. A. Dijkstra)
Newsgroups: comp.sys.transputer
Subject: parallel C, Parsec
Keywords: C, parallel
Message-ID: <517@ruuinf.UUCP>
Date: 11 Jul 88 09:59:41 GMT
Organization: Univ of Utrecht, Dept of CS
Lines: 144
Some weeks ago i have posted information about the parallel C
compiler from Parsec.
I got some reactions, of which most of them wanted more
specific information.
Well, this is the extra information which i am posting
at the responsibility and on behalf of Parsec.
I hope this will satisfy questions w.r.t. compiler.
More info can be obtained at the address mentioned below.
-------------------------------- FROM HERE --------------------------------
PARSEC'S PARALLEL PROGRAMMING SYSTEM
In the last few weeks, and following a discussion on the availability
of parallelized C for transputers, there have been inquiries
about the Parallel C compiler from Parsec. In the following, I
will describe the most important features of this compiler and
the supporting Par.C System, which will be available from the end
of this month (July), and which will cost 3900 Dutch Guilders or
the equivalent in other currencies.
The Par.C System can be purchased in a version which runs on a
T414 transputer under Parsytec's MEGATOOL, or all by itself with
a loader/server on the host. Also, the Par.C System can be used
as a cross-compiler, running on an IBM, or on other host systems.
It is possible to obtain source codes to the loader/server, in
order to adapt its functioning to the needs of special systems.
This makes it possible to embed the developed transputer program
into a host program.
THE Par.C PARALELL C COMPILER
Parsec's Par.C System makes it possible to write parallel
programs in an extended version of the C programming language.
The extensions are few, but very powerful and easy to use. We
have chosen this approach of parallelizing the language, because
it enables the compiler to generate faster code, and the
extensions can be used in a flexible way. Besides that, the
parallel C source is much clearer than standard C using function
calls for parallelism and communication, and therefore it is
easier to write and understand parallel C programs.
The Par.C compiler recognises the full Kernighan and Ritchie
standard C language, including the extensions described in "C: a
reference manual" by Harbison and Steele. In the near future,
Par.C will be upgraded to meet the Draft Proposed ANSI C
standard.
The extensions related to parallel programming are the following:
1. DATATYPE CHANNEL
A channel is a point-to-point connection between two processes,
which can only be used for synchronous communication. This means,
that both processes must have arrived at the corresponding
communication statements before the datatransfer takes place.
Both processes are kept waiting until the message has been
properly transferred.
A channel can be used in both directions and for different
messages. The programmer should take care to check on
correspondence of the size of the transmitted and received
messages on both sides.
A channel can be declared and placed:
channel ChannelName; /* declaration of channel */
channel *ChannelPointer; /* declaration of pointer */
channel ChannelArray[SIZE]; /* array of channels */
channel *ChannelPointer = 0x80000000; /* initialization */
Communication is done using the assignment operator:
ChannelName = VariableName; /* output */
VariableName = ChannelName; /* input */
The variables sent can be constants, or any other available types
in C, incuding structures.
2. PAR CONSTRUCT
The par construct is used to start up a number of concurrently
running processes on the same transputer. The par construct looks
like this:
par {
(compound) statement;
......
(compound) statement;
}
Each (compound) statement can be any piece of code, including
other par constructs, and is started up as a seperate process.
The process executing a par construct will await termination of
all started up processes, before proceeding execution of the code
following the par. In this way, the closing brackets of the par
construct function as a synchronisation point, and the results of
all started up processes in that par can be used after this
point.
3. SELECT CONSTRUCT
The most complicated of the extensions to the standard C language
in Par.C is the select construct. In short, it is used to wait
for the first of a number of specified possible events to occur.
The event that triggers the select determines which piece of code
will be executed next. The syntax of the select is as follows:
select within