• No results found

Example of an execution trace graph

5.2 Execution trace graph

5.2.3 Example of an execution trace graph

The dataflow program described in Section 2.5.4 is used in order to show the main structure of an ETG. The firing set S contains nine action firings s = {s1, s2, . . . , s9} which are summarized

in Table 2.2. The firing set S can be divided in three sub-sets, one for each actor of the network, SP = {s1, s2, s3}, SF = {s4, s5, s6} and SC= {s7, s8, s9}, such that S = SP∪ SF∪ SC and San∩ Sam= ; for each couple of actors am 6= an . Sets SP, SFand SC contain the firings of

Producer,FilterandConsumerrespectively. The dependencies set D contains sixteen dependencies D = {e1, e2, . . . , e16} which are summarized in Table 5.1.

Even though the firing sequence of this program has already been illustrated in Section 2.5.4, it is worth re-describing part of it, and highlighting how the ETG of Figure 5.2 can be obtained. In this context, let’s suppose the mapping configuration m1described in Table 4.1 is used.

This particular mapping configuration defines a single partition configurationσ1= {P, F,C }

(i.e. all the actors are assigned to the same processing element), the scheduler configuration

σ1= {P, P, P, F, F, F,C ,C ,C } (i.e. predefined and static) and the buffer size configuration β11= β2

1= 512. The execution Gantt chart is depicted in Figure 4.3a, where each action firing takes

one (abstract) clock cycle to conclude its execution. At time t = 0, the scheduler imposes to execute the actorProducerwhich fires the actionproduce. This single action firing is denoted with s1. During its execution, s1updates the internal actor variablecounter: the

initial value iscounteri= 0 and the final value iscounterf = 1. Finally, the firing concludes

by writing an output tokenτ1= 1 on the output portO. At time t = 1 the scheduler selects again

the actorProducerwhich fires again the actionproduce. This second firing is denoted with s2. Also s2updates the internal actor variablecounter: the initial value iscounteri= 1

and the final value iscounterf = 2. Finally, the firing concludes by writing an output token

τ1= 2 on the output portO. During the firing s1the internal state variablecounterihas the

value previously written by the firing s1: hence an internal variable dependency between s1

s1 s2 s3 s4 s5 s6 s7 s8 s9 e1 e2 e3 e4 e6 e7 e9 e10 e13 e15 e5 e8 e11 e12 e14 e16

Figure 5.2: Execution trace graph obtained after the execution of the CAL program described in Section 2.5.4. The firing set S is summarized in Table 2.2, and the dependencies set D is summarized in Table 5.2.

dependency direction is write/write. Moreover, both s1 and s2 wrote a token on the same

output port: hence a port variable, with direction write/write, can be defined. This is denoted with e2. The same happens at time t = 2, when the same action is fired for the third time in

a row. This new firing is denoted with s3. Also in this case an internal variable and a token

dependency can de defined with the previous step s2: these are e3and e4respectively. At

time t = 3, the scheduler imposes the execution of the actorFilterwhich fires the action

invert. This action firing is denoted with s4. During the firing, s4consumes the tokenτ1

from its input portIand produces an output tokenτ4on its output portO. As the input token τ1was previously produced by the firing s1, a token dependency between s1and s4can be

defined: this is denoted with e5. At time t = 4, the second execution of the actorFilter,

imposed by the scheduler, again fires the actioninvert. This action firing is denoted with s5.

Also this firing read the tokenτ2from the input portIand wrote the tokenτ5on the output

portO. Asτ2was previously produced by s2, a new token dependency can de defined: this is

denoted with e8. Furthermore, as the firing s5read and wrote tokens from and to the same

ports as the firing s4, two new port dependencies can be defined: these are denoted with e6

and e7which have as direction read/read and write/write respectively. The execution of the

entire program continues till t = 9 and the same considerations can be made in order to build the remaining dependencies of the ETG.

5.2. Execution trace graph

Table 5.2: Dependencies set S of the execution trace graph depicted in Figure 5.2. (si, sj) Source Target Kind Direction Parameter Attribute

e1 s1 s2 Variable Write/Write variable=counter initial=1

final=2

e2 s1 s2 Port Write/Write port=O

e3 s2 s3 Variable Write/Write variable=counter initial=2

final=3

e4 s2 s3 Port Write/Write port=O

e5 s1 s4 Token - count=1

source-Port=I

source-Port=O

value=1

e6 s4 s5 Port Read/Read port=I e7 s4 s5 Port Write/Write port=O

e8 s2 s5 Token - count=1

source-Port=I

source-Port=O

value=2

e9 s5 s6 Port Read/Read

e10 s5 s6 Port Write/Write port=O

e11 s3 s6 Token - count=1 source-Port=I source-Port=O value=3 e12 s4 s7 Token - count=1 source-Port=I source-Port=O value=-1

e13 s7 s8 Port Read/Read port=I

e14 s7 s8 Token - count=1

source-Port=I

source-Port=O

value=-2

e15 s5 s8 Port Read/Read port=I

e16 s8 s9 Token - count=1

source-Port=I

source-Port=O