Reactive systems are computer systems that react continuously to their environment, at a speed determined by the latter. Synchronous languages have been designed to facilitate the programming of reactive systems. The main synchronous languages are Esterel, Lustre, Argos, and Signal.
Many reactive systems have to be distributed on several computing sites, for various reasons: performance increase, location of sensors and actuators, fault tolerance. The ocrep tool parallelizes synchronous programs, according to distribution specifications given by the user.
Ocrep is based on the object code parallelization method. It consists in compiling the source program into a single object program, and then parallelizing this centralized program towards as many programs as there are computing sites, so that each site only has to perform its own computations. Therefore, ocrep takes advantage of the existing common format OC for synchronous languages. Indeed, OC code can be obtained from Lustre, Esterel and Argos compilers. Without going into details, an OC program is a finite state automaton with a finite memory for the computations. Ocrep takes as input:
The distribution specifications consist in a partition of the set of inputs and outputs of the program into as many sub-sets as there are computing sites. This assigns a unique computing site to each input/output. Finer specifications can be given by also assigning a computing site to local variables. Concretely, the distribution specification file contains a table of sites, with the same overall syntax as the other OC tables:
site_part : /* empty */ | 'sites:' number_of_sites site_table 'end:' ; number_of_sites : integer ; site_table : site_table site_definition ; site_definition : site_num ':' identifier '(' signal_list ')' | site_num ':' identifier '(' signal_list ')' '(' variable_list ')' ; site_num : integer ;
signal_list is a list of names of
input and output signals of the OC program. More distribution
specifications can be given by adding to a site definition an optional
variable_list of variable indexes. However, since
OC is an internal format, it is uneasy to relate OC
variables to the source program. Also, there should be no conflicts
signal_list and the
variable_list. In particular, it is forbidden to assign
an input signal to a site and assign the linked variable to another
site. In case of conflict, an error will be raised and ocrep
A few words on
exception signals. They come from Esterel programs and
are used to express special synchronization constraints:
synchronization between parallel modules,
so on. However, in the OC code, all these synchronization
constraints are directly expressed by the control structure of the
exception signals are
translated into state transitions by the Esterel compiler. A
consequence is that there should be no
present actions involving
exception signals. This is why ocrep arbitrary
decides to localize any
signal to site 0. Note that these signals have no name, so a site's
signal_list cannot contain
The communications take place through a fully-connected network of FIFO channels. Two communication primitives are used:
put(s,x)instruction writes the value
xto the queue directed towards process
s; it is non blocking;
x:=get(s)instruction extracts the head value from the queue originating from process
sand assigns it to the variable
x; it blocks if the queue is empty.
Ocrep produces one OC program for each site specified in the distribution specification file. Each OC program contains the necessary communication actions to permit references to non local variables. For instance, the command:
produces two files
foo.2.1.oc if the file
foo.rep specifies a
distribution towards two sites. Each file produced by ocrep can
then be compiled, for instance, by the Esterel compiler.
The following options are available:
|-h||Print the help message.|
|-version||Display the version number of ocrep.|
|-info||Display all informations about ocrep.|
|-sb||Synchronize the OC programs weakly (only those who already communicate).|
|-st||Synchronize the OC programs weakly (all of them).|
|-e||Locally eliminate the redundant
|-E||Globally eliminate the redundant
|-a||Insert the |
|-r||Reduce the branchings for which both branches have equivalent behaviors.|
The ocrep tool is available for Unix architectures:
This distribution of ocrep contains four directories:
bincontains the executable
mancontains the user manual.
srccontains the C files
distinet.cfile contains the procedures for creating the execution environment for distributed OC programs (procedures for establishing the FIFO queues, as well as the put and get procedures for exchanging data through these queues);
trace.hfile is used by
distinet.cfor tracing the connections.
democontains three demos:
The poc tool that pretty-prints OC programs is available here.
This work has been partially supported by the Merlin-Gerin company (now part of the Schneider Electric group), by Inria, and by UC Berkeley.