Mapping Specification
This page describes the specification of a mapping using XML. The mapping defines where and how the components of an application are executed on a distributed hardware platform. Mapping needs to be done in the spatial domain, which is referred to as binding, and in the temporal domain, which is referred to as scheduling. In DAL, the binding specification defined a mapping of processes to processors and software channels to communication paths in a certain scenario. The scheduling specification defines the scheduling policy on each resource and the according parameters, e.g. time division multiple access scheme and the associated slot length, fixed priority scheduling and the associated priorities, or static scheduling and the associated ordering. In the current version of DAL, the scheduling polity cannot be defined, but the framework just executes all processes according to the operating systems scheduling policy.
The mapping specification is therefore composed of
- a set of mappings for each process network,
- the correlation between scenarios of the finite state machine and individual mappings for each process network.
More information can be found in the CASES 2012 publication.
Contents
Mapping Correlation
Elements for Mapping Correlation Specification
mappingcorrelation
The mappingcorrelation
element serves as container for the state
elements. Besides the attributes to specify the namespace, it has a name
attribute that is used to specify an identifier for the mapping correlation.
state
The element state
is used to describe a state in the finite state machine which corresponds to a scenario or a system state with a set of applications running or paused. It has one attribute name
which is a string and it may contain several child elements of type correlation
. The name
attribute has to correspond to a name of a state as defined in the finite state machine specification.
correlation
The correlation
element serves for the definition of correlations. The correlation
element has one attribute, namely name
. The name
attribute is used to specify an identifier for the correlation. Furthermore, the correlation
has two child elements processnetwork
and mapping
, specifying which processnetwork
(as defined by the name
attribute of the process network) is correlated to which mapping
(as defined by the name
attribute of the mapping specification).
Example
<mappingcorrelation name="mappingcorrelation1">
<state name="State_A">
<correlation name="correlation1">
<processnetwork name="pn1" />
<mapping name="mapping1" />
</correlation>
<correlation name="correlation2">
<processnetwork name="pn2" />
<mapping name="mapping1" />
</correlation>
</state>
<state name="State_B">
<correlation name="correlation3">
<processnetwork name="pn2" />
<mapping name="mapping1" />
</correlation>
</state>
<state name="State_C">
<correlation name="correlation4">
<processnetwork name="pn1" />
<mapping name="mapping2" />
</correlation>
</state>
<state name="State_D">
<correlation name="correlation5">
<processnetwork name="pn2" />
<mapping name="mapping2" />
</correlation>
</state>
</mappingcorrelation>
Individual Mapping
The actual mapping of the processes to the available processing units is specified in a separate XML file. This is also used to define some specific properties for a process depending on its mapping.
Elements
The following code snippet shows an example binding for the square process onto a GPU. It is defined to use the OpenCL version of the process, which results into a transformation of the source code into an OpenCL kernel if it is not yet specified as such. There are also two mapping specific attributes given: the number of work-items per work-group and the number of work-groups.
<binding name="square">
<process name="square"/>
<processor name="gpu"/>
<target>
<opencl workitems="256" workgroups="1">
<port name="out" access="strided"/>
</opencl>
</target>
</binding>
-
The
binding
tag specifies a binding withname
. -
The
process
tag selects the process to bind by using itsname
. -
The
processor
tag selects which processor to map onto depending on itsname
. -
The
target
tag is used to select which implementation to use of the specified process. -
The tag within
target
can be eitherposix
, which has no further attributes and is the default, or it can beopencl
, which can specify the number ofworkitems
per work-group and the number ofworkgroups
. -
For
opencl
tags, it is possible to specify the output access method in aport
tag. Thename
attribute identifies the port andaccess
can either beblock
orstrided
.
Example
The following example maps an exemplified application onto a quad-core architecture:
<mapping name="Mapping">
<binding name="generator">
<process name="generator"/>
<processor name="core_2"/>
<target>
<posix/>
</target>
</binding>
<binding name="square">
<process name="square"/>
<processor name="gpu"/>
<target>
<opencl workitems="256" workgroups="1">
<port name="out" access="strided"/>
</opencl>
</target>
</binding>
<binding name="consumer">
<process name="consumer"/>
<processor name="core_2"/>
<target>
<posix/>
</target>
</binding>
</mapping>