• No results found

Performance Optimizing Priority Assignment in Embedded Soft Real-time Applications

N/A
N/A
Protected

Academic year: 2021

Share "Performance Optimizing Priority Assignment in Embedded Soft Real-time Applications"

Copied!
87
0
0

Loading.... (view fulltext now)

Full text

(1)

Linköpings universitet SE–581 83 Linköping

Linköping University | Department of Computer and Information Science

Master’s thesis, 30 ECTS | Computer Engineering

2018 | LIU-IDA/LITH-EX-A--18/006--SE

Performance Op mizing Priority

Assignment in Embedded So

Real- me Applica ons

Prestandaop merande prioritets lldelning i inbyggda

applika-oner med mjuka real dskrav

Fredrik Bergstrand

Tobias Edqvist

Supervisor : Adrian Lifa Examiner : Petru Eles

(2)

Upphovsrä

De a dokument hålls llgängligt på Internet – eller dess fram da ersä are – under 25 år från pub-liceringsdatum under förutsä ning a inga extraordinära omständigheter uppstår. Tillgång ll doku-mentet innebär llstånd för var och en a läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och a använda det oförändrat för ickekommersiell forskning och för undervisning. Överföring av upphovsrä en vid en senare dpunkt kan inte upphäva de a llstånd. All annan användning av doku-mentet kräver upphovsmannens medgivande. För a garantera äktheten, säkerheten och llgäng-ligheten finns lösningar av teknisk och administra v art. Upphovsmannens ideella rä innefa ar rä a bli nämnd som upphovsman i den omfa ning som god sed kräver vid användning av dokumentet på ovan beskrivna sä samt skydd mot a dokumentet ändras eller presenteras i sådan form eller i så-dant sammanhang som är kränkande för upphovsmannens li erära eller konstnärliga anseende eller egenart. För y erligare informa on om Linköping University Electronic Press se förlagets hemsida h p://www.ep.liu.se/.

Copyright

The publishers will keep this document online on the Internet – or its possible replacement – for a period of 25 years star ng from the date of publica on barring excep onal circumstances. The online availability of the document implies permanent permission for anyone to read, to download, or to print out single copies for his/hers own use and to use it unchanged for non-commercial research and educa onal purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are condi onal upon the consent of the copyright owner. The publisher has taken technical and administra ve measures to assure authen city, security and accessibility. According to intellectual property law the author has the right to be men oned when his/her work is accessed as described above and to be protected against infringement. For addi onal informa on about the Linköping University Electronic Press and its procedures for publica on and for assurance of document integrity, please refer to its www home page: h p://www.ep.liu.se/.

©Fredrik Bergstrand Tobias Edqvist

(3)

Abstract

Optimizing task priority assignments is a well-researched area in the context of hard real-time systems, where the goal in the majority of cases is to produce a priority as-signment that results in a schedulable task set. The problem has also been considered, albeit not to the same extent, in the soft real-time context where quality of service met-rics determine the overall performance of systems. Previous research on the problem in the soft real-time context often resorts to some analytical approach, with the drawback of having to put relatively strict constraints on the system models to avoid excessively complex analysis computations. As a consequence, many attributes of a real system have to be omitted, and features such as multi-processor hardware platforms might make the analytical approach unfeasible due to complexity issues. In this thesis we took a different approach to the problem and used discrete event simulation to drive the priority assign-ment optimization process, which enabled more complex system models at the cost of increased objective function evaluation times. A latency-related quality of service metric was used as the objective function in a tabu search based optimization heuristic. Improve-ments were observed in both simulation and in the real system that was modeled. The results show that the model successfully captured key attributes of the modeled system, and that the discrete event simulation approach is a viable option when the goal is to improve or determine the quality of service of a soft real-time application.

(4)

Acknowledgments

We would like to extend our most sincere gratitude to our supervisor Adrian Lifa for his commitment and assistance during this thesis project. Further, we would also like to thank our examiner Petru Eles for his advice and feedback. Finally, we would like to thank all the people at Autoliv/Veoneer who helped us with practical issues, made us feel welcome, provided valuable input regarding theoretical problems and answered all our product related questions.

(5)

Contents

Abstract iii

Acknowledgments iv

Contents v

List of Figures vii

List of Tables viii

List of Abbreviations ix 1 Introduction 1 1.1 Motivation . . . 1 1.2 Aim . . . 2 1.3 Research Questions . . . 2 1.4 Delimitations . . . 2 1.5 Thesis Outline . . . 3 2 Background 5 2.1 Industry Context . . . 5 2.2 Assignment Context . . . 5 3 Related Work 7 3.1 Models of Computation . . . 7

3.2 Soft Real-time Models . . . 9

3.3 Soft Real-time Metrics . . . 10

3.4 Priority Assignment Algorithms . . . 11

3.5 Metaheuristics . . . 13

3.6 Discrete-event Simulators . . . 15

4 System Model and Problem Formulation 18 4.1 Platform Model . . . 18

4.2 Application Model . . . 18

4.3 Environment Model . . . 19

4.4 System Model . . . 19

4.5 General Model Definitions and Semantics . . . 19

4.6 Mapping, Scheduling and Execution Times . . . 20

4.7 Soft Real-time Requirements . . . 21

4.8 Problem Formulation . . . 22

4.9 Example System . . . 22

(6)

6 Simulator 28

6.1 Programming Language and Packages . . . 28

6.2 Input Data and Pre-processing . . . 28

6.3 Output Data . . . 30

6.4 Implementation . . . 30

7 Model Tuning and Evaluation 31 7.1 Model Tuning . . . 31

7.2 Model Evaluation . . . 32

8 Priority Assignment Strategy 37 8.1 Strategy . . . 37

8.2 Strategy Evaluation . . . 39

9 Results 44 9.1 Model Evaluation and Tuning . . . 44

9.2 Priority Assignment Strategy . . . 49

10 Discussion 60 10.1 Results . . . 60

10.2 Method . . . 63

10.3 The Work in a Wider Context . . . 66

11 Conclusion 67 11.1 Future Work . . . 68

Bibliography 69 A Full Model Evaluation Results 72 A.1 Initial . . . 72

A.2 Fixed Communication Costs . . . 73

A.3 Variable Communication Costs . . . 75

(7)

List of Figures

3.1 An example task graph. . . 7

3.2 A synchronous data flow graph. . . 8

4.1 An example application modeled as a DG. . . 23

4.2 The example application DG augmented with the source-side tasks. . . 24

4.3 The example application DG augmented with all necessary tasks. . . 24

4.4 An example platform. . . 25

4.5 The augmented application model with data sets and annotations. . . 26

6.1 A conceptual block diagram of the simulator showing input and output. . . 29

7.1 A flowchart of the model evaluation process. . . 34

8.1 A visualization of the utilized gain functions. . . 43

9.1 A visualization of the errors for the initial model. . . 45

9.2 A visualization of the errors for the fixed communication cost model. . . 46

9.3 A visualization of the errors for the variable communication cost model. . . 47

9.4 A visualization of the errors for the final model with distributed overhead. . . 48

9.5 The average RCM over all evaluation scenarios per application load setting. . . 49

9.6 The RCM for the short data set sequences used during priority optimization per application load setting. . . 50

9.7 The average age improvement for each exit task at application load LA= 0.45. . . . 51

9.8 The average age improvement for each exit task at application load LA= 0.55. . . . 52

9.9 The average age improvement for each exit task at application load LA= 0.65. . . . 53

9.10 The average age improvement for each exit task at application load LA= 0.75. . . . 54

9.11 The average age improvement for each exit task at application load LA= 0.80. . . . 55

9.12 The RCM per iteration when optimizing the priority assignment at application load LA= 0.45. . . 56

9.13 The RCM per iteration when optimizing the priority assignment at application load LA= 0.55. . . 56

9.14 The RCM per iteration when optimizing the priority assignment at application load LA= 0.65. . . 57

9.15 The RCM per iteration when optimizing the priority assignment at application load LA= 0.75. . . 57

9.16 The RCM per iteration when optimizing the priority assignment at application load LA= 0.80. . . 58

9.17 The predicted average age improvement for exit tasks on the real system when using the optimized priority assignment. . . 58

9.18 The actual average age improvement for exit tasks observed when using the opti-mized priority assignment. . . 59

(8)

List of Tables

7.1 The selected tags for finding different scenarios of evaluation data. . . 35 7.2 The 22 available scenarios in selected test files. . . 36 8.1 The application load settings used to evaluate the priority assignment strategy. . . 40 8.2 The priority assignment optimizer runs. . . 41 8.3 The simulator runs to evaluate the produced priority assignments. . . 42 9.1 The evaluation results for the initial version of the model. Only exit tasks are

presented. . . 45 9.2 The evaluation results for the fixed communication cost model. Only exit tasks are

presented. The fixed communication cost was set to 1 ms. . . 46 9.3 The evaluation results for the variable communication cost model. Only exit tasks

are presented. . . 47 9.4 The results for the final model with distributed overhead. Only exit tasks are

presented. . . 48 9.5 The average RCM improvements over all evaluation scenarios per load setting. . . . 49 9.6 The RCM improvements for the short data set sequences used during priority

op-timization. . . 50 9.7 The results for the priority assignment evaluation on scenarios at application load

LA= 0.45. . . 51 9.8 The results for the priority assignment evaluation on scenarios at application load

LA= 0.55. . . 52 9.9 The results for the priority assignment evaluation on scenarios at application load

LA= 0.65. . . 53 9.10 The results for the priority assignment evaluation on scenarios at application load

LA= 0.75. . . 54 9.11 The results for the priority assignment evaluation on scenarios at application load

LA= 0.80. . . 55 A.1 The complete evaluation results for the initial version of the model. . . 72 A.2 The complete evaluation results for the fixed communication cost model. The fixed

communication cost was set to 1 ms. . . 73 A.3 The complete evaluation results for the variable communication cost model. . . 75 A.4 The complete evaluation results for the final model with distributed overhead. . . . 76

(9)

List of Abbreviations

ADAS advanced driver assistance system

CPU central processing unit

DAG directed acyclic graph

DES discrete-event simulation

DG directed graph

DMR deadline miss ratio

DPNPS dynamic priority non-preemptive scheduling

EDF earliest deadline first

ETPDF execution time probability density function

FIFO first in, first out

FPPS fixed priority preemptive scheduling

GUI graphical user interface

HPC high performance computing

IC integrated circuit

JPMF joint probability mass function

KPN Kahn process network

LST least slack time

OPA optimal priority assignment

OPA-MLD optimal priority assignment minimizing lexico-graphical distance

PADA priority assignment with deadline adjustment

PE processing element

PG processing group

(10)

RCM requirement compliance metric

RMS rate-monotonic scheduling

RPA robust priority assignment

RTOS real-time operating system

SDFG synchronous data flow graph

UAV unmanned aerial vehicle

(11)

1

Introduction

This chapter introduces the thesis topic, the motivation for the topic and what the reader can expect from the thesis in the form of aim, research questions and delimitations.

1.1 Motivation

During recent years within the automotive industry, the number of vehicle functions realized by software has seen a dramatic increase. Nearly everything from automatic breaking to climate control is implemented as systems composed of both software and hardware components. This trend will likely continue at an even faster rate in the future, due to the continuous introduction of new advanced driver assistance systems (ADASs) and the industry’s strive towards autonomous vehicles.

Automotive software applications are safety critical pieces of software, and thus the relia-bility, correctness and quality of the software is highly important. Simultaneously, the need for computational power constantly increases as features are added to vehicles. Due to the stagnation of single-core processor performance during the previous decade, multi-core archi-tectures, possibly heterogeneous, have become popular in many application areas including the automotive industry.

Modeling applications as directed graphs (DGs), in this context referred to as task graphs, is a well-known concept within different areas such as high performance computing (HPC) and embedded systems design. In these task graphs, nodes represent tasks performing computation on input data and producing output data, and edges represent data dependencies between different tasks. In both HPC and embedded systems design the model is used to parallelize and pipeline computation on large sets of data. In addition, in embedded systems design the model is also suitable when modeling systems that process a continuous stream of input data and produce output in response to the input data stream.

It has been shown that the task graph model is useful for reducing the complexity of mul-tithreaded software [1]. Due to the increased need for computational power and the extensive demands put on safety critical software, the task graph model has been adopted in many automotive applications.

Many of the automotive applications have a level of criticality that demands a hard real-time implementation, where strict requirements are put not only on the functional correctness of the application, but also on the temporal correctness. A consequence of this is that special

(12)

1.2. Aim

approaches to task scheduling, task execution time measurement and system analysis are required. A fair amount of research has been conducted in the field of real-time scheduling of task graphs [2, 3, 4, 5, 6, 7, 8]. An unfortunate consequence of enforcing hard real-time requirements is that the utilization of the available resources must be kept relatively low to be able to guarantee temporal correctness [9]. This leads to increased production costs due to the need for more powerful execution platforms.

Even though many of the applications are of a nature that requires hard real-time proper-ties, there exist applications that can be implemented under less strict requirements. In this context, soft real-time properties could be enough, i.e. temporal incorrectness can be toler-ated to some extent, but will result in a degradation of the quality of service (QoS). Further, when hard real-time properties are no longer required, higher levels of resource utilization are possible. Maximizing the utilization of the available resources while still meeting the real-time requirements is obviously a desirable goal in the soft real-time context as well.

Since current automotive applications are rather complex, some kind of real-time operat-ing system (RTOS) is often used to provide services of various kinds to the application. In these RTOSs, a fixed priority scheduler is used in many cases. In addition, the automotive standard AUTOSAR1 mandates the use of a fixed priority scheduler. This means that the

application developer has limited control over the scheduling algorithm if the RTOS scheduler is used. However, the priorities of tasks are free to be assigned by the developer. It is easy to imagine that different assignments of priorities to an application’s constituent tasks affect the performance of the application.

This thesis investigates methods for automated priority assignment within applications modeled as task graphs, subject to soft real-time requirements, running on a heterogeneous multi-core hardware platform.

1.2 Aim

The main aim of this thesis is to identify or develop an automated strategy for assigning priorities to tasks in applications that can be mapped to the model described in chapter 4. The priority assignment strategy should succeed in optimizing a performance metric of the application. To accomplish this, a simulator will be developed to aid the development and evaluation of priority assignment strategy candidates. In addition to providing benefits during evaluation and development of the priority assignment strategy, the aim is that the simulator will provide additional value to the company (see chapter 2) in other contexts as well.

1.3 Research Questions

The following research questions form the foundation of the work described in this thesis: 1. How does automated priority assignment to tasks in an application modeled as a directed

graph (DG) with soft real-time requirements affect system performance with regards to some soft real-time requirement compliance metric?

2. How can such an automated priority assignment strategy be designed?

3. Can discrete-event simulation (DES) be used to accurately simulate and evaluate the effects that different priority assignments have on the application?

1.4 Delimitations

Simulations and associated evaluations will only be carried out on example graphs related to applications at the company. An evaluation of different simulation models will not be

(13)

1.5. Thesis Outline

conducted. Instead, one model will be chosen that fits the company applications. Any im-plementation evaluations will only be made on a platform provided by the company. When considering research question one, a single soft real-time requirement compliance metric will be investigated.

1.5 Thesis Outline

This section introduces the rest of the thesis, giving a brief overview of how the thesis is structured and a short introduction to each chapter.

Background

This chapter introduces relevant background and the context of the thesis with regards to industry.

Related Work

This chapter presents related work that can be found in the literature, and some concepts that will be beneficial for the reader to be familiar with when reading this thesis.

System Model and Problem Formulation

This chapter introduces the model used to describe the systems and applications considered in the thesis. An example system is presented to help the reader gain an intuitive understanding of the model. In addition, the problem formulation is presented in detail.

Method

This chapter briefly introduces the methods used to obtain the results and answer the research questions of this thesis.

Simulator

This chapter presents the methods used when developing the simulator for the system model.

Model Tuning and Evaluation

This chapter describes the refinements made to the system model instance to improve its accuracy, and the methods used to evaluate the accuracy.

Priority Assignment Strategy

The chapter presents the proposed priority assignment strategy, and the methods used to evaluate it.

Results

This chapter presents the obtained evaluation results.

Discussion

This chapter contains the discussion about the employed method, the obtained results and the implication of the results.

(14)

1.5. Thesis Outline

Conclusion

(15)

2

Background

This chapter presents a background for the thesis, including an introduction to the industry context.

2.1 Industry Context

The assignment and work described in this thesis has been carried out at Autoliv Sverige AB in Linköping, Sweden. Autoliv is an international company that produces safety systems for the automotive vehicle industry, including many of the major car manufacturers around the world.

Autoliv consists of two main business segments, Passive Safety and Electronics. The Pas-sive Safety division at Autoliv provides safety system solutions such as seat belts and airbags. Electronics primarily develops and works with various active safety solutions. These include radar systems and day/night vision systems, delivered stand-alone or integrated in ADAS systems. The applications provided range from high-level applications like autonomous emer-gency braking, lane departure prevention, cross walk alert etc. to more fundamental functions like object detection, traffic sign recognition and lane detection. Many of the active safety systems Autoliv develops are based on image processing and the usage of different camera based sensors.

At the site in Linköping, approximately 400 employees work and Autoliv’s vision plat-forms are developed. The vision platplat-forms consist of the camera system and different image processing algorithms that together provide the various safety related vehicle functions.

Around halfway through the thesis an organizational restructuring was publicly revealed. Autoliv’s Electronics business segment was to spin-off as a separate company called Veoneer. Veoneer was planned to become an independent, publicly traded company during the third quarter of 2018. However, the internal restructure began already when the thesis was still in progress which lead to the thesis starting at Autoliv, but being completed at Veoneer.

2.2 Assignment Context

The topic of the thesis has been studied within the context of Veoneer’s vision platforms. These platforms are developed as soft real-time systems running on heterogeneous platforms. System

(16)

2.2. Assignment Context

functions are assigned different requirements, with constraints being put on for example end-to-end deadlines. The functionality is implemented in the systems as multiple tasks that are assigned to different processing devices. There are data dependencies among the tasks, and tasks receive their input required from other tasks via message queues.

Together, the tasks and the message queues form an application task graph. The different processing devices use their own schedulers, provided by the operating systems, to determine which of the ready tasks should run. To make these decisions, the scheduler uses priorities assigned to tasks, where the priorities express the relative importance of the tasks. The assign-ment of priorities affects the performance of the application, especially when data dependencies exist among the tasks. In small, trivial example task graphs, it may be possible to manually assign the priorities such that optimal performance is achieved. However, when the applica-tions and, thus, the task graphs grow, it is not certain that the intuitive way to assign the priorities is optimal. Further, when the task graphs grow the number of task data dependen-cies increases, and the effects of these when considering different priority assignments may be difficult to grasp in a manual process. The main goal of this thesis was to produce an auto-mated process that assigns priorities to tasks, while optimizing the application’s compliance with its soft real-time requirements.

(17)

3

Related Work

In this chapter, work found in the literature related to the topic of the thesis is presented.

3.1 Models of Computation

In this section, various common models of computation are presented that are somehow related to the model used in this thesis.

3.1.1 Task Graphs

Much of the content will refer to the concept of task graphs. Formally, a simple task graph can be modeled as a directed acyclic graph (DAG). A task graph G is described as G= (V, E) where V is the set of tasks in the graph and E is the set of dependencies between tasks. The dependencies in E can be expressed as ordered pairs of nodes from V . [10]

Figure 3.1: An example task graph.

In figure 3.1, an example task graph is presented. This graph would have

V = {τ1, τ2, τ3, τ4, τ5, τ6, τ7, τ8}

E= {(τ1, τ2), (τ1, τ3), (τ1, τ4), (τ2, τ5), (τ2, τ6), (τ3, τ5), (τ4, τ7), (τ5, τ8)}.

The exact semantics of the task graph vary between different models that are based on the graph concept. See the remainder of this section for examples of popular models.

(18)

3.1. Models of Computation

3.1.2 Kahn Process Networks

A Kahn process network (KPN) is a data flow model introduced by Kahn [11]. In a KPN a set of deterministic processes run, and transfer data tokens between each other through directed unbounded first in, first out (FIFO) channels. Write operations to these FIFO channels are non-blocking, while read operations are blocking. A KPN can be described as a directed graph (DG), where nodes represent processes and edges represent FIFO channels. KPNs exhibit deterministic behavior, meaning that the output is uniquely determined by the input and the initial token state of the KPN. Thus, communication delays and process execution times do not affect the output.

It is not possible to use static scheduling to schedule the processes in a KPN, as this may result in deadlock situations. Hence, dynamic scheduling is the only viable option. Further, the maximum needed size of the FIFO channels in a given KPN is impossible to determine in the general case [12]. Since memory is finite in reality, some method is needed to handle the FIFO capacity issue. Parks presented a dynamic scheduling algorithm for KPNs that guarantees bounded FIFO capacities whenever possible [13].

3.1.3 Synchronous Data Flow Graphs

A synchronous data flow graph (SDFG) is a special case of a KPN introduced by Lee and Messerschmitt [14]. The semantics of the model requires that each task, on completion, pro-duces a fixed number of messages on all its outputs. Similarly, each task must consume a fixed number of messages from all its inputs on each invocation. These restrictions have several implications. To begin with, it becomes possible to determine the maximum size required for each message queue on the edges in the SDFG for all possible SDFGs. Further, the buffer sizes needed on the edges is guaranteed to be finite for a sound SDFG. It is also possible to perform static scheduling of SDFGs.

A SDFG can be characterized by a topology matrix Γ, where each task is given a corre-sponding column, and each dependency is given a correcorre-sponding row. An example SDFG is presented in figure 3.2. Each number on the edges correspond to the number of messages the adjacent task produces or consumes on that edge per invocation.

τ

2

τ

4 2

τ

1

τ

3

τ

5 2 1 2 3 3 1 2 1 1

Figure 3.2: A synchronous data flow graph. The SDFG in figure 3.2 is characterized by the topology matrix

Γ= ⎡⎢ ⎢⎢ ⎢⎢ ⎢⎢ ⎢⎢ ⎢⎣ 2 −1 0 0 0 2 0 0 −2 0 0 3 −3 0 0 0 0 1 0 −2 0 0 0 1 −1 ⎤⎥ ⎥⎥ ⎥⎥ ⎥⎥ ⎥⎥ ⎥⎦ .

In the topology matrix Γ, column one is corresponding to task τ1, column two to task τ2

and so on. Row one corresponds to the edge1, τ2), row two to edge (τ1, τ4), row three to

edge2, τ3), row four to edge (τ3, τ5) and row five to edge (τ4, τ5). The interpretation of the

elements γi,j in the topology matrix is that task τi, on each invocation, produces/consumes

γi,j messages on the edge corresponding to row j. Negative γi,j means the task in question is consuming messages, while positive means producing messages.

(19)

3.2. Soft Real-time Models

The topology matrix can be used to determine if there are any rate inconsistencies within the SDFG. For a sound SDFG there will exist no rate inconsistencies, and a sequence of task firings will exist for which the SDFG is returned to its initial state. To say that there are no rate inconsistencies is equivalent to saying that the balance equation of the SDFG has non-trivial solutions. The balance equation is

Γq= 0

where q, called the firing vector, is defined as

q= ⎡⎢ ⎢⎢ ⎢⎢ ⎢⎢ ⎢⎢ ⎢⎣ q1 q2 q3 q4 q5 ⎤⎥ ⎥⎥ ⎥⎥ ⎥⎥ ⎥⎥ ⎥⎦ .

The goal is to find the smallest non-trivial solution q. In the case of an existing non-trivial solution, qidenotes the number of invocations of task τithat should occur during one cycle of the static schedule that can be produced for the SDFG characterized by Γ. For the example SDFG presented in figure 3.2, the smallest solution q is

q= ⎡⎢ ⎢⎢ ⎢⎢ ⎢⎢ ⎢⎢ ⎢⎣ 1 2 2 1 1 ⎤⎥ ⎥⎥ ⎥⎥ ⎥⎥ ⎥⎥ ⎥⎦ .

Both KPNs and SDFGs are well-known models, but they have some limitations which make them hard to apply to the problem considered in this thesis. However, the model used in this thesis that is described in chapter 4 has been inspired by these models.

3.2 Soft Real-time Models

In 2010 Liu and Anderson published their work on analysis of real-time systems that have soft requirements on deadlines while being modeled as different graph models [15]. In their work they primarily focus on systems that are modeled as DAGs and in the paper they show how a limit for missed deadlines can be ensured for these systems, without any utilization loss. Systems modeled as different graphs is a well-studied topic, especially when all deadlines are considered hard. However, if some deadline misses are allowed the systems get harder to model in a way that is usable to prove and guarantee different requirements. Through the work in the paper the authors show how DAG modeled systems can be supported in any scheduler, that allows bounded tardiness, in a way that allows for no utilization loss if the system can ensure the same for sporadic tasks. The authors give examples of how it is possible to transform a DAG to a sporadic task system if these conditions hold. The work presented by Liu and Anderson in the paper “Supporting Soft Real-Time DAG-Based Systems on Multiprocessors with No Utilization Loss” has a lot of important findings and tackles issues that are relevant to the situation and model considered in this thesis. However, the models used in the paper enforce limitations that make the work not directly applicable to the system used in the thesis. For example, multiple data sets are not allowed simultaneously in the graph and data sets should be possible to release early if a situation occurs where the current data is processed well before when the next data set originally was planned to be released.

In the paper “Task Mapping and Priority Assignment for Soft Real-time Applications Under Deadline Miss Ratio Constraints”, Manolache, Eles, and Peng present a novel analysis method for soft real-time systems modeled as task graphs [16]. The analysis is based on stochastic

(20)

3.3. Soft Real-time Metrics

task execution times in contrast to the vast majority of the literature, where the worst case execution times often are considered. The motivation is that the worst case analysis approach results in systems that meet all deadlines, but at the price of low hardware utilization and consequently a higher product cost. For a large class of systems, occasional deadline misses are acceptable, and this allows for a more efficient utilization of available resources. Thus, cheaper hardware may be used, leading to reduced product costs.

The hardware platform is modeled by a set of processors. A processor can be either a pro-cessing element (PE), which corresponds to any sort of processor, or a bus connecting some of the PEs. An application consists of processing tasks and communication tasks. The processing tasks and communication tasks are generally referred to as tasks, and are treated equally. Re-strictions are imposed on which processors a task can be mapped to, i.e. communication tasks are mapped to buses while processing tasks are mapped to processing elements. Instantiations of tasks are called jobs. Tasks are partitioned into groups, effectively allowing an application to consist of multiple task graphs. Each task has an activation period that is a common mul-tiple of the periods of all its predecessor tasks. Each task graph in the application also has a period, which is the least common multiple of its tasks’ periods. The execution times of tasks are modeled as generalized execution time probability density functions (ETPDFs). In addition, multiple simultaneous instantiations of a task graph are allowed. The numbers of allowed simultaneous instantiations of each task graph are input parameters to the analysis method. The assumption is that if the maximum number of instantiations already exist at the time of a new instantiation of a particular graph, the instance with the earliest arrival time is discarded. Alternatively, the instantiation that currently arrives can be discarded. However, the authors explicitly state that no circular dependencies are allowed in the task graphs. Thus, even though the proposed analysis method is very closely related to the problem considered in this thesis, it cannot be directly applied.

3.3 Soft Real-time Metrics

The soft real-time requirements on the application considered by Manolache, Eles, and Peng are stated in terms of deadlines [16]. The application consists of multiple task graphs. Both individual tasks and task graphs have associated deadlines. If a task is instantiated at time

t, and has not finished executing at t+ d, where d denotes the task’s deadline, the job has

missed its deadline. Similarly, if a task graph is instantiated at time t, and there exists at least one unfinished job originating from that task graph instantiation at time t+ d, the task graph has missed its deadline. The deadline miss ratio (DMR) metric is defined for tasks and task graphs as

DMRτ= lim t→∞

Dτ(t)

Aτ(t)

where τ is a task or task graph, Dτ(t) is the number of task/task graph deadline misses up to time t and Aτ(t) is the number of task/task graph instantiations up to t.

In another paper published by Manolache, Eles, and Peng, they present another analysis method [17]. Multiple task graphs per application are allowed, where periods are assigned to tasks and task graphs. The DMR metric is defined similarly, and the output of the analysis consists of expected DMRs for each task and task graph.

Hua and Qu consider dependent tasks that can have hard or soft deadlines and may be dropped or completed. If a task completes, it does so either missing or meeting its deadline. The authors claim that simply measuring the ratio of completed tasks does not accurately reflect the QoS of the system, as it does not differentiate between tasks with hard and soft deadlines. Further, dropping a task affects other tasks depending on the dropped one, and should be penalized as well. They propose an extension of the completion ratio QoS metric, where the hardness or softness of tasks is considered and dropped tasks are further penalized. Weights are used to express the relative importance between hard and soft deadline tasks, and

(21)

3.4. Priority Assignment Algorithms

the magnitude of the deadline miss for soft deadline tasks affect the total QoS. They define their metric as Q(S) =αsKs+ αhKh Nβ Nδi di− aiγ N ∑ lii

where a scheduler S completes Kssoft deadline tasks, Khhard deadline tasks out of a total of

N tasks. The parameters αsand αhare weights for soft and hard deadline tasks respectively,

β is the penalization factor for soft deadline misses and γ is the penalization factor for task

drops. The difference between a task’s deadline and its completion time is denoted by δi, and the difference di− ai is the lifetime of the task, i.e. the length of the time interval between its activation and its deadline. The number of tasks that are affected by dropping a particular task is denoted by ∆i and li is equal to one if the task is dropped, and zero otherwise. The first sum is calculated over all soft deadline tasks that missed their deadline. The second sum is calculated for all tasks. It is worth noting that the completion ratio metric is a special case of Q(s) if αs= αh= 1 and β = γ = 0. [18]

3.4 Priority Assignment Algorithms

Assigning priorities to tasks that should be scheduled using a scheduling algorithm can be done in different ways. The two main approaches used for priority assignment are fixed and dynamic priorities. Using fixed priorities means that priorities are assigned to tasks at design time and remain the same for all instantiations, jobs, of that task during the entire runtime of the system. An example of a scheduling algorithm that requires fixed priorities is rate-monotonic scheduling (RMS) [19]. Dynamic priority assignment means that priorities are calculated and assigned during runtime. This allows for individual jobs of a task to have different priorities compared to another job of the same task. Examples of scheduling algorithms that use dynamic priorities for scheduling is earliest deadline first (EDF) and least slack time (LST). [20]

In a paper published in 2016, titled “A review of priority assignment in real-time systems”, Davis, Cucu-Grosjean, Bertogna, and Burns conduct a review of different priority assignment strategies usable in real-time systems [20]. In the paper, the authors describe different strate-gies and present an assessment of the strengths and weaknesses of each strategy. Through using different scenarios when describing different strategies the authors show the impor-tance of good priority assignment, and the role it plays in order to achieve good scheduling in real-time system environments. The strategies covered primarily focus on hard real-time scheduling using fixed priority assignment and include systems that are either preemptive or non-preemptive in environments with both one and multiple processors. For each of the re-viewed techniques, the authors present a categorization that in the end is used to describe the different strategies in terms of the type of system, requirements and scenario in which the strategy is suitable. In addition to the review of different priority assignment strategies, the authors also present multiple pitfalls that need to be taken into consideration when selecting or designing a strategy for how to assign priorities.

The review contains both early and recent work on priority assignment, structured in a way such that the reader is introduced to how the work has evolved over time. One of the selected and reviewed priority assignment strategies in the paper is the optimal priority assignment (OPA) algorithm. OPA was developed in 1991 by Audsley [21] and is today known for being applicable in multiple scenarios and situations. Audsley developed the algorithm in order to address a couple of the primary issues with current priority assignment strategies at the time, namely how to assign priorities in non-preemptive systems, systems with arbitrary deadlines, and systems with offset task release times. Situations where the state of the art strategies at the time were not optimal to use. The algorithm requires a schedulability test to be used when trying to find a priority assignment, and if there exists a schedulable priority assignment, the algorithm guarantees to find one. One of the major disadvantages the authors, and others, have identified with OPA is the random selection of which task that is assigned a certain priority. This type of randomised selection can cause a system to be very sensitive to changes,

(22)

3.4. Priority Assignment Algorithms

even minor ones can make the priority assignment invalid and cause the system to not meet its requirements. This issue was addressed by Davis and Burns by introducing the robust priority assignment (RPA) algorithm [22]. RPA addresses the issue of OPA not considering the introduction of changes later on in the lifetime of the system. The RPA algorithm is based on OPA but in addition to taking schedulability into consideration, it also considers robustness when assigning priorities to tasks.

In addition to the presentation and review of the priority assignment strategies developed in other papers, the authors also present some of their own customizations to some of the reviewed strategies. One of the strategies that the authors developed through customizing an already existing strategy is the optimal priority assignment minimizing lexicographical distance (OPA-MLD). OPA-MLD is a customization of the OPA algorithm. OPA-MLD can be used to minimize the lexicographical distance between a desired priority order and the obtained priority order which results in a schedulable task set. In other words, it tries to make the resulting priority order follow the desired priority order as closely as possible. OPA-MLD works by trying, for each priority level, to assign the task with the highest desired priority among the unassigned tasks to its desired priority level. If the task is schedulable according to the OPA algorithm at its desired priority with all other unassigned tasks at a higher priority then the task is assigned this priority. The OPA-MLD algorithm then continues this optimization of priority assignments for every unassigned task until it either finds a solution or determines that the tasks are unschedulable. If all tasks are schedulable with OPA-MLD the algorithm will find a solution. However, since OPA-MLD is based on the OPA algorithm, a schedulability test is required. In addition, the OPA algorithm is designed for independent tasks. Thus, the OPA-MLD algorithm is not directly applicable in the context of this thesis.

Lee, Chwa, Lee, and Shin present a priority assignment strategy for systems composed of a set of DAG tasks [23]. In this context, this means that each task consists of multiple threads, and the threads have data dependencies among them. Each task is modeled as a DAG, where nodes correspond to threads and edges are data dependencies between the threads of the tasks. The priority assignment is based on the OPA [21] algorithm proposed by Audsley. The OPA algorithm has mostly been used for task-level priority assignment to independent tasks under some given schedulability test. Lee, Chwa, Lee, and Shin explore the possibility to apply the OPA algorithm to these DAG tasks. As the authors explain, this is not trivial since the threads of a task depend on each other, and the OPA algorithm is designed for independent tasks. The problem is addressed by using task decomposition, where each thread is considered as an individual entity with a relative offset and a deadline. By assigning the offsets and deadlines appropriately, the threads can be considered independent while obeying their specified precedence constraints within their respective task. This is achieved by the authors by turning each task into a set of sequential threads, where each thread is given a relative offset such that the thread’s release is no earlier than the deadlines of all the threads it depends on.

After this process, a task can be viewed as a set of independent threads. From this, the authors present a schedulability analysis that is compatible with the OPA algorithm. A novel priority assignment strategy is introduced, which is based on the OPA algorithm. The strategy is called priority assignment with deadline adjustment (PADA), and is able to adjust the deadlines and relative offsets of the threads. The PADA algorithm is shown to perform very well under evaluation. However, within the context of this thesis, task execution times are not modeled as worst case execution times (WCETs) in a hard real-time fashion and thus the PADA algorithm is not directly applicable.

The contribution of the 2008 paper by Manolache, Eles, and Peng is an algorithm for producing a task mapping and priority assignment given the application model, the tolerated DMRs, the hardware model etc. such that the sum of the DMRs for each task and task graph is minimized [16]. Two problems are identified by the authors, namely to find an efficient design space exploration heuristic, and to design a sufficiently fast and precise solution evaluation strategy. The authors approached the latter of the two problems in an earlier

(23)

3.5. Metaheuristics

article under similar circumstances, and achieved an accurate but time-consuming strategy [24]. The authors employ the tabu search metaheuristic proposed by Glover [25] for design space exploration. To analyze solution qualities the authors base their proposed polynomial time algorithm on their previously presented Markovian analysis algorithm [24]. In order to improve the time complexity without introducing excessive errors, the authors identify weak dependencies between random events to simplify the analysis. Satisfactory results are obtained, and the efficiency of the approach is shown to be good. There are, however, some limitations in the method presented in this paper that make it unsuitable for the case considered in this thesis. Whenever a new task graph is instantiated, any remaining jobs of tasks in the previous task graph are discarded, i.e. they are removed from the system, releasing any resources the jobs used. This means that multiple task graph instances are unable to execute simultaneously. Further, fixed priority non-preemptive scheduling is assumed, and the task graphs are required to be acyclic. None of these assumptions hold under the conditions considered in this thesis.

3.5 Metaheuristics

In a metaheuristic review paper in the context of deterministic combinatorial optimization problems, Bianchi, Dorigo, Gambardella, and Gutjahr provide the following definition of a deterministic combinatorial optimization problem: Given a finite set S of feasible solutions x, and a real valued cost function G(x), find minx∈SG(x) [26]. The corresponding maximization problem can of course also be considered. Many of these optimization problems belong to the class of NP-hard problems [27], and thus the algorithms for obtaining optimal solutions often require an infeasible amount of time for problem sizes that are larger than trivial examples. During the 1980s and 1990s, a new approach to these problems emerged. The new algorithms were combinations of basic heuristic approaches, and the goal was to produce framework algorithms that could be adapted to specific optimization problems. These methods are known today as metaheuristics. One of the most important properties of the metaheuristics is that they are designed to allow for efficient navigation through the space of feasible solutions. The purpose of this is to find an optimal or near optimal solution while evaluating as few feasible solutions as possible. Further, the metaheuristics may use knowledge specific to the domain of the considered problem to improve their performance. [28]

Blum and Roli introduce several ways of classifying metaheuristics, for example population based versus single point search. Algorithms that work with a single solution at all times differ from algorithms that work with a population of solutions that are evolved into other solutions [28]. Examples of single point algorithms include tabu search, iterated local search and variable neighborhood search. Examples of population based algorithms include genetic algorithms and ant colony optimization.

3.5.1 Tabu Search

The tabu search metaheuristic was introduced by Glover [25]. It is a single point search meta heuristic. Tabu search is a form of local neighborhood search, with some extensions. An initial solution is the starting point of the algorithm. This solution has a neighborhood that is defined in terms of eligible moves from the current solution. A move is a modification of the current solution that results in a new solution. The neighborhood of the current solution is the set of all solutions that can be achieved by applying all eligible moves to the current solution. In one iteration of tabu search the neighborhood of the current solution is identified, all neighbors are evaluated and the best neighbor is set to the current solution given that it is compliant with the tabu search specific extensions. If the new current solution is better than the best solution found, this is recorded as well.

Tabu search is designed around the use of dynamic memory structures that are used to intensify and diversify the exploration of the solution space. There are in general three types of memory: short, intermediate and long term memory. The purpose of the short term memory

(24)

3.5. Metaheuristics

is to avoid cycling in the search space, to enable the escape of local optimum solutions and to prevent the reversal of recent moves that proved beneficial. The short term memory consists of a number of tabu moves that are not allowed to be applied to the current solution. When a new current solution is selected, the inverse of the move that lead to this solution is placed in the tabu list. This accomplishes the goal of avoiding to reverse recent beneficial moves. The tabu moves in the short term memory have a tenure, stating for how long the moves are to stay tabu. Successful tenures have been investigated and somewhere between five and 12 iterations seem to consistently perform well. In many cases, the short term memory is sufficient for producing high quality solutions, but in the context of hard problems, intermediate and long term memory may be needed to produce the highest quality results. The primary purpose of the intermediate and long term memories are to intensify the search in the form of aspiration criteria, and diversify the search through diversification strategies. Aspiration criteria can override the tabu status of moves in the short term memory, given some condition. Long term diversification strategies are used to explore new areas of the search space, for example by trying to generate solutions that differ as much as possible from previously evaluated ones. [29]

Tabu search has been applied in a wide range of areas from solving well-known combinato-rial optimization problems [30] and finding mapping and scheduling solutions [16] to routing fleets of combat unmanned aerial vehicles (UAVs) [31].

3.5.2 Simulated Annealing

Another well-known metaheuristic that can be used to approximate the optimum, globally, for a certain function is simulated annealing. Simulated annealing was introduced by Kirkpatrick, Gelatt, and Vecchi in 1983 [32]. The method is very similar to the mathematical optimization technique hill climbing but instead of only selecting a solution that is better than the currently found one it selects a random state in the valid neighborhood. The main reason behind this difference is that the approximated function might contain multiple local optimums, in which case the global optimum is more desirable to approximate than assuming that the found local optimum is the best available. An arbitrary solution is the starting point of the algorithm. For each step it then selects a new solution, evaluates the quality of the new solution and then makes a decision if it should move to the new solution or if it should keep the current one. The algorithm then continues this process until a good enough approximation for the selected scenario is found or if a certain execution time is exceeded. The term annealing refers to the fact that a slow decrease in the probability of selecting solutions that are worse than the current solution is used in the process. This way the algorithm, over time, decreases the chance of selecting worse solutions and focuses more on finding a better solution in the current solution neighborhood. This enables wide exploration in the beginning of the process in order to avoid getting stuck in a local optimum, but then later on to focus more on a specific neighborhood. The idea is that the neighborhood that is explored at the end of the annealing process hopefully is a neighborhood close to the global optimum due to the wide search in the beginning.

The applicability of simulated annealing has been proven in the context of both real world applications and situations purely focused on research purposes. Rutenbar for example inves-tigates and presents how simulated annealing can be used in integrated circuit (IC) design [33]. The usage of simulated annealing has also been evaluated in the field of scheduling and priority assignment, for example by Saksena and Wang. In their paper “Scalable real-time system design using preemption thresholds” they evaluate different approaches to improve schedulability and find that simulated annealing can be a suitable method in certain scenarios in order to gain significant improvements and in most scenarios in order to gain at least a small improvement when compared to a naive approach [34].

(25)

3.6. Discrete-event Simulators

3.5.3 Genetic Algorithms

The genetic algorithm metaheuristic takes inspiration from the natural selection process found in nature and throughout evolution. To produce different solutions a set of operators commonly found in biological evolution is used, which include selection, crossover and mutation. As with other optimization techniques, genetic algorithms utilize sets of candidates and evaluate these based on their fitness with regards to a specified objective function. In the case of genetic algorithms, it is common to start with a randomly selected set of candidates and use an iterative process, with iterations commonly called generations, that optimizes the solutions by selecting new candidates through mutation. In a book titled An Introduction to Genetic

Algorithms, Mitchell presents a summary and overview of the field [35]. In the book the author

presents genetic algorithms with comparisons to other search space exploration and candidate selection methods.

As with other metaheuristics, the concept of utilizing genetic algorithms in the field of task scheduling and priority assignment strategies is well explored by multiple researchers. Omara and Arafa presented work where they researched how genetic algorithms can be used to tackle the task scheduling problem. In their paper they showed how a standard genetic algorithm can be implemented in order to solve the problem of scheduling tasks as well as how one can improve the standard algorithm approach to achieve better performance. In order to get improved performance they utilized the knowledge of critical paths in the DG of the application and added the concept of evaluating load balance between processors and idle time on these processors. [36]

3.6 Discrete-event Simulators

Discrete-event simulation (DES) can be used to model changes in a system over time. By using discrete events it is possible to represent all the time points where the system changes its state. Through these events the system evolution is modeled as an ordered series of discrete events, where events occur at certain time points. The time between one event until the next event is reached is considered to be of no interest and has no impact on the system state. Thus, the simulation may jump to the next discrete event directly without having to take the time span between events into consideration. Together with the system behavior for how to handle different events, DES requires some sort of system state that contains the variables of interest as well as a system clock. The system clock is used to keep track of where in the simulation the system currently is. [37]

The topic of developing tools for evaluating different aspects of real-time systems is a well researched area. One example of these useful tools, that have been documented extensively and studied in many different papers, is simulators. For real-time systems that evolve dynamically over time or systems with soft real-time requirements, it is hard to perform different types of static analysis. One way to evaluate models of this kind of dynamically changing systems is through the usage of event-driven simulators, most often implemented as discrete-event simulation (DES).

Decotigny and Puaut documented their results from developing their simulator called AR-TISST in the paper “ARAR-TISST: an extensible and modular simulation tool for real-time sys-tems” [38]. In the paper they introduce their end-product together with the limitations and possibilities of the simulator as well as multiple important aspects that make the simulator suitable for evaluating different metrics. ARTISST is a simulator that uses events to simulate real-time systems. The main goal of ARTISST is to enable the user to simulate and evalu-ate the performance of different computations in the modeled system, with regards to both correctness and time requirements when using different schedulers.

One of the most important aspects that Decotigny and Puaut found during their work was that the usage of simulators to evaluate a real system is only a valid method if the simulator is realistic. To actually meet this requirement of a realistic simulator, the authors state that both

(26)

3.6. Discrete-event Simulators

the system as a whole and the encapsulating environment is required to be modeled in the simulator, as closely as possible to the real implementation. Achieving this includes making the simulator account for things like the operating system, context switching and overhead which is not necessarily a part of the system, but rather a part of the environment where the system is running.

A lot of the work presented by Decotigny and Puaut in their paper is closely related to the aim of this thesis. However, limitations that are present in their simulator make it hard to directly utilize given the problem aimed to be solved in this thesis. For example AR-TISST does not support pipelining of streaming input data, and the task model requires that a WCET is specified for each task. In addition, the focus of ARTISST is directed towards dif-ferent scheduling policies rather than priority assignment and how the assignment of priorities impacts the performance.

Diaz, Batista, and Castro have also published work on real-time system simulators. In 2007 they published a paper in which they present the real-time scheduling simulator called Realtss [39]. The main goal when developing Realtss was to enable users to evaluate different real-time scheduling algorithms without actually having to implement them in a real system within a complete RTOS. When using Realtss it is possible to evaluate the performance of different scheduling policies that one is interested in, and easily compare the results in the graphical user interface (GUI) of the simulator. In addition to providing some results in the GUI, the simulator also produces a trace log that is compatible with Kiwi1, in order to provide the user with a better way of visualizing the result produced by the implemented scheduling algorithm. Thanks to the modular design of Realtss, it is possible to write different scheduling algorithms in C, C++ or even TCL. To evaluate the performance of different scheduling policies Realtss utilizes schedulability tests, either defined by the user or some of the built-in tests. Due to the fact that schedulability tests are used to evaluate different situations, the simulator is not a suitable tool to use in this thesis. Another limitation of the simulator is that it does not support pipelined behavior.

Even though Realtss is not directly applicable given the aim of this thesis, a couple of interesting approaches and ideas from the paper can be used when developing a more suitable simulator for the problem context considered in this thesis. First of all, the approach of producing output such as traces in a format that can easily be visualized and used with already existing software allows the simulator to solely handle its core task of simulation. More time can be spent on modeling the environment and system accurately rather than also providing a complete analytics tool to the user. By offloading the visualization to already existing tools we can focus more on the unresearched areas of the thesis problem. Secondly, the modular design shows a lot of the benefits of how a simulator can be extended to a broader context of interest and not only the context considered in the thesis.

Simgrid is another simulator for real-time scheduling, but with emphasis on applications in grid environments. Simgrid was developed by Casanova and the work was published in the paper “Simgrid: a toolkit for the simulation of application scheduling” [40]. Simgrid is a simulator focused on evaluation and studying of scheduling policies in distributed systems, more specifically computational grids. The paper presents the software developed and the methods used for validation and evaluation. Similar to earlier presented simulators, Simgrid is an event-driven simulator. Based on the simulation, the software produces output in the form of traces that can be used to compare different simulator runs against each other. This allows the user to easily tweak parameters and see how changes affect the end-result. One important aspect the author introduced in the simulator, to allow for a more realistic implementation, is the possibility to utilize traces for resources such as central processing units (CPUs) and communication, which in the case of computational grids mimics the network links. Of course, since Simgrid focuses on computational grids the simulator cannot be applied to the topic of

1A GUI based application that can display execution trace logs. http://www.gti-ia.upv.es/sma/tools/

(27)

3.6. Discrete-event Simulators

this thesis. However, the decisions and design choices made during the simulator develop-ment provide useful insight and knowledge that should be considered when developing a new simulator.

(28)

4

System Model and Problem

Formulation

This chapter introduces the model used to describe and discuss various aspects of the problems, systems and applications considered in this thesis.

4.1 Platform Model

The platform is modeled as a set of p processing elements (PEs), PE= {PE1, PE2, . . . , PEp}. The PEs are partitioned into g processing groups (PGs), such thatg

i=1PGi= PE and PGi

PGj= ∅, ∀ i ≠ j. The set of all processing groups (PGs) is denoted by PG. The PEs in P E are allowed to be heterogeneous, but each PG in PG must be composed of homogeneous PEs1. In addition to the regular PGs, we augment the platform with a virtual PG, denoted by PG0,

consisting of an arbitrary number of PEs. The use of PG0 is explained in section 4.6.

The communication between PGs is modeled by interconnects characterized by their

good-put. Goodput refers to the effective throughput of application data that can be sustained over

the interconnect2. The connectivity matrix C of dimensions(g + 1) × (g + 1) specifies available

interconnects and their characteristics. Element ci,j in C corresponds to the goodput of the interconnect between PGs PGi and PGj. A goodput ci,j of 0 implies that PGi can not send data to PGj. Note, however, that data transfer in the reverse direction might still be possible depending on cj,i. A goodput ci,icorresponds to the goodput between PEs within a PG. It is assumed that all PEs within a PG have direct access to the interconnects to other PGs.

4.2 Application Model

The application is modeled as a directed graph (DG), where nodes represent single-threaded computational tasks, and edges represent data dependencies between tasks. The DG consists of nA tasks τi, 1≤ i ≤ nA. We denote the set of all application tasks by VA. The application data dependencies are represented by the set EA= {(τi, τj) ∶ the output of τi is input to τj}. The complete application DG is denoted by ΓA= (VA, EA).

1Typically, a PG might refer to a multi-core processor. In this case, a PE would correspond to a core. 2The goodput depends on a number of factors such as the link type, link bandwidth and the communication

(29)

4.3. Environment Model

If the output of task τi is an input to task τj, then τi is called a predecessor of τj, and τj is called a successor of τi. The set of all predecessors of a task τ is denoted pred(τ), and the set of all successors of τ is denoted succ(τ).

Some of the tasks in VA receive input data from components external to the application DG. These tasks are called entry tasks. The set of entry tasks is denoted by Ventry where

Ventry ⊆ VA. Similarly, some of the tasks in VA deliver output data to external components. These tasks are called exit tasks, and the set of exit tasks is denoted by Vexitwhere Vexit⊆ VA.

4.3 Environment Model

The application is modeled as a DG ΓA introduced in section 4.2. There it is stated that the application interacts with various components external to the application DG. In order to simulate, evaluate and reason about the application it is necessary to also model the en-vironment in which the application resides. The two aspects that need to be considered are the delivery of input data to the application DG, and the reception of output data from the application DG. To accomplish this, the application DG is augmented with additional tasks and dependencies that model these external components.

It is assumed that the input data originates from a single source that releases data sets with a period Tin. This source of input data is called the source task and is denoted by τsource. The source task is the single predecessor of a number of service tasks. The set of service tasks is denoted by Vservice. The service tasks model preprocessing performed by the environment on the data sets released from the source task. As different kinds of preprocessing take different amounts of time, in practice the preprocessed versions of a data set are made available to the application at different time offsets relative to the release time of the source data set. This is captured by the execution time of the service tasks.

Each entry task is connected as a successor to all service tasks it depends on. We define the set of all source-side dependency edges as Esource= {(τsource, τs) ∶ τs∈ Vservice} ∪ {(τa, τb) ∶

τa ∈ Vservice∧ τb∈ Ventry∪ Vservice∧ uses(τa, τb)}, where uses(τa, τb) means that task τb uses the output of service task τa.

The reception of output data from the application DG is handled by another special task, called the sink task, denoted by τsink. The sink task samples the output data on the application exit tasks’ outputs with a period Tout. Thus, the sink task is a successor of every application exit task. Worth noting is that there are no constraints on the relation between Toutand Tin. We define the set of all sink-side dependency edges as Esink= {(τe, τsink) ∶ τe∈ Vexit}.

The environment model is then defined as ΓE = (VE, EE), where VE = Vservice{τsource, τsink} and EE= Esource∪ Esink.

4.4 System Model

The system model is obtained by merging the application model ΓA with the environment model ΓE. This yields the system model Γ= (VA∪ VE, EA∪ EE) = (V, E). In order to make use of the connectivity matrix introduced in the platform model in section 4.1, the sizes of the messages sent between tasks need to be provided. It is assumed that a function size∶ E → N0

from the system data dependencies to the set of non-negative integers is given. Further, dependencies have a depth. The semantics of these depths is discussed in section 4.5, and the depths themselves are provided by a function depth∶ E → N0.

4.5 General Model Definitions and Semantics

An instance of a task, i.e. a task execution, is called a job. For a job to be able to start execution, data must be available on all its input edges. Data is segmented into messages. Messages are queued on the dependency edges between tasks, with no possibility of message

References

Related documents

I förledne Onsdags hadhe then Venetianiske Embassadeuren sin Entrée, och war iagh uthi stoor dubitation om iagh skulle låta min wagn gå medh honom eller eij, men

Minga myrar i vlistra Angermanland, inklusive Priistflon, 2ir ocksi starkt kalkp6verkade, vilket gdr floran mycket artrik och intressant (Mascher 1990).. Till strirsta

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i

Detta projekt utvecklar policymixen för strategin Smart industri (Näringsdepartementet, 2016a). En av anledningarna till en stark avgränsning är att analysen bygger på djupa

Tommie Lundqvist, Historieämnets historia: Recension av Sven Liljas Historia i tiden, Studentlitteraur, Lund 1989, Kronos : historia i skola och samhälle, 1989, Nr.2, s..

Industrial Emissions Directive, supplemented by horizontal legislation (e.g., Framework Directives on Waste and Water, Emissions Trading System, etc) and guidance on operating