|
The JavaPorts Configuration Language
We list here the configuration
language commands for describing the concurrent components of a distributed
application. The bold part of each command is required by the compiler.
The user fills the part depicted in italics. Optional keywords are in parentheses.
- BEGIN/END CONFIGURATION/DEFINITIONS/ALLOCATIONS/CONNECTIONS
The whole file is the CONFIGURATION section. In the DEFINITIONS
section, the application name, the machines to be used and the names
of the tasks are specified. Tasks are allocated to machines in the
ALLOCATIONS section, and pairs of peer Ports are connected in the
CONNECTIONS section.
- DEFINE APPLICATION <Application Name>
Defines the application name. JavaPorts will store all files associated
with this application in a directory with the same name.
- DEFINE MACHINE <Machine_Var>=
<Machine DNS Name or IP Address> [MASTER]
With this command the user defines the nodes (machines) of the cluster.
The MASTER keyword is set only for the machine that will be
used to launch the distributed application.
- DEFINE TASK <Task_Var>= [<Path/>]
<Template Name> NUMOFPORTS=<Number Of Ports>
[(REUSE)] [(MATLAB)]
Defines
a task of the application. The keyword REUSE will flag the task
as an existing component and the code residing in the named
template will be reused. If omitted, the template will be erased
and recreated.
A path may
be specified to place the task in a subdirectory within the application
directory. The MATLAB keyword is used to specify a Matlab task (tasks
are specified as Java by default).
- IMPORT COMPONENT <Task_Var>=
[<Application/>][<Path/>]<Template Name>
NUMOFPORTS=<Number Of Ports> [(MATLAB)] [(COMPOUND)][(LIB)]
Tells
the JPACT to import an existing component from the specified Application
and Path (or from a Library if the LIB keyword is used). The COMPOUND keyword tells JPACT to copy associated helper classes along with the main class. The other parameters are the same as for DEFINE TASK. The NUMOFPORTS parameter may be increased to add ports to the existing component.
- ALLOCATE <Task_Var> <Machine_Var>
Allocates a Task to a Machine.
- CONNECT <Task_Var>.P[<Port Index>]
<Task_Var>.P[<Port Index>]
Two
ports are connected by using this command. For Java tasks the Port Index
is zero-based. Matlab tasks number their ports starting at 1.
The same index will be used in the task
templates to write and read from the specific port.
Sample Configuration File
BEGIN CONFIGURATION
BEGIN DEFINITIONS
DEFINE APPLICATION "Mandelbrot"
DEFINE MACHINE M1="oak" MASTER
DEFINE MACHINE M2="pine"
DEFINE MACHINE M3="elm"
DEFINE MACHINE M4="maple"
DEFINE TASK T1="Display" NUMOFPORTS=1
DEFINE TASK T2="DynamicManager" NUMOFPORTS=4
DEFINE TASK T3="MandelbrotWorker" NUMOFPORTS=1
DEFINE TASK T4="MandelbrotWorker" NUMOFPORTS=1
IMPORT COMPONENT T5="UserApp2/MMWorker" NUMOFPORTS=1 MATLAB
END DEFINITIONS
BEGIN ALLOCATIONS
ALLOCATE T1 M1
ALLOCATE T2 M2
ALLOCATE T3 M3
ALLOCATE T4 M3
ALLOCATE T5 M4
END ALLOCATIONS
BEGIN CONNECTIONS
CONNECT T1.P[0] T2.P[0]
CONNECT T2.P[1] T3.P[0]
CONNECT T2.P[2] T4.P[0]
CONNECT T2.P[3] T5.P[1]
END CONNECTIONS
END CONFIGURATION
|