19/04/2016 What does it mean? « Response-time analysis » « conditional » Response-Time Analysis « DAG tasks » of Conditional DAG Tasks « multiprocessor systems » in Multiprocessor Systems Alessandra Melani 1 2 What does it mean? What does it mean? « Response-time analysis » « Response-time analysis » DAG: Directed Acyclic Graph « conditional » « conditional » « DAG tasks » « DAG tasks » « multiprocessor systems » « multiprocessor systems » If-then-else statements Switch statements 3 4 In other words Parallel task models Many parallel programming models have been proposed to support We will analyze a multiprocessor real-time systems… parallel computation on multiprocessor platforms (e.g., OpenMP, OpenCL, Cilk, Cilk Plus, Intel TBB) … by means of a schedulability test based on response-time analysis … assuming Global Fixed Priority or Global EDF scheduling policies Early real-time scheduling Recently, more expressive models: each recurrent task execution models allow … and assuming a parallel task model (i.e., a task is modelled is completely sequential exploiting task parallelism as a Directed Acyclic Graph - DAG ) 5 6 1
19/04/2016 Fork-join Synchronous-parallel Each task is an alternating sequence of sequential and parallel Generalization of the fork-join model segments Allows consecutive parallel segments Every parallel segment has a degree of parallelism � � (number Allows an arbitrary degree of parallelism of every segment of processors) Synchronization at segment boundaries: a sub-task in the new segment may start only after completion of all sub-tasks in the previous segment � � ���� 7 8 DAG cp-DAG Conditional - parallel DAG (cp-DAG) � � � �� � , � � � Directed acyclic graph (DAG) � � � �� � , � � � � � � � �,� , … , � �,� � ; � � ⊆ � � ⨯ � � Generalization of the previous two models Every node is a sequential sub-task Arcs represent precedence constraints between sub-tasks Two types of nodes Regular : all successors must be executed in parallel Conditional : to model start/end of a conditional construct (e.g., if-then-else statement) Each node has a WCET � �,� In this lecture, we will focus on this task model 9 10 Conditional pairs Why this restriction? �� � , � � � form a conditional pair It does not make sense for � � to wait for � � if � � is executed � � is a starting conditional node � � is the joining point of the conditional branches starting at � � Analogously, � � cannot be connected to � � since only one is executed Restriction : there cannot be any connection between a node belonging to a branch of a conditional statement (e.g., � � ) and Violation of the correctness of conditional constructs and the nodes outside that branch (e.g., � � ), including other branches of semantics of the precedence relation the same statement 11 12 2
19/04/2016 Formal definition (1) Formal definition (2) � ⊆ � � ⊆ � � denote all the Let � � , � � be a pair of conditional nodes in a DAG � � � � � , � � . For each � ∈ 1,2, … , � , let � � and � � � nodes and arcs on paths reachable from � � that do not include The pair �� � , � � � is a conditional pair if the following hold: � � . Suppose there are exactly � outgoing arcs from � � to the nodes � � By definition, � � is the sole source node of the DAG � � � � , � � , … , � � , for some � � 1 . Then there are exactly � incoming � , � � ′� . It must hold that � � is the sole sink node of � � � . �� arcs into � � in � � , from some nodes � � , � � , … , � � � � � �� � , � � ′� � � � � � � … � � � � � � � … � � � � � � � � � � … … … � � � � … … � � � � � � � � … 13 14 Formal definition (3) How is parallel code structured? � ∩ � � � ∅ for all �, �, � � � . It must hold that � # pragma omp parallel num_threads (N) � � 10 T 1 Additionally, with the exception of �� � , � � � , there should be no { 6 arcs in � � into nodes in � � ′ from nodes not in � � ′ , for each if (condition) {…} T 2 # pragma omp master { else {…} � ∈ �1,2, … , �� . 6 # pragma omp task { // T 0 T 3 � ⨯ � � � ��� � , � � �� should hold for all � . That is, � � ∩ � � \� if (condition) { 6 � � T 4 # pragma omp task { // T 1 } � � } else { Which branch # pragma omp task { // T 2 } � � � � … leads to the # pragma omp task { // T 3 } worst-case # pragma omp task { // T 4 } � � … � � � � � � } … response-time? … � � … � � }}} 15 16 Which branch leads to the WCRT? Which branch leads to the WCRT? ≥ 3 processors 1 processor 10 T 1 Upper branch Upper branch 6 if (condition) {…} T 2 10 else {…} 6 Lower branch 10 T 3 T 1 Lower branch 18 6 6 T 4 if (condition) {…} T 2 else {…} 2 processors 6 T 3 10 6 T 4 Upper branch 3 processors + interfering task 10 Lower branch Lower branch Upper branch 10 12 12 17 18 3
19/04/2016 Lesson learnt System model Depending on the number of processors and on the interfering � conditional-parallel tasks (cp-tasks) τ � , expressed as cp-DAGs tasks, it is not obvious to identify the branch leading to the in the form � � � �� � , � � � WCRT platform composed of � identical processors if (condition) {…} It makes sense to account for else {…} the different execution flows by sporadic arrival pattern (minimum inter-arrival time � � between … … enriching the task model jobs of task τ � ) constrained relative deadline � � � � � Why don’t we do it also with if (condition) {…} else {…} sequential tasks? … … Problem Only the longest path matters Conditional branches are already Schedulability analysis for cp-tasks, globally scheduled on m identical incorporated in the notion of processors with any work-conserving algorithm (including G-FP … WCET and G-EDF) 19 20 Quantities of interest 1. Chain (or path) 1. Chain (or path) of a cp-task A chain (or path) of a cp-task τ � is a sequence of nodes λ � �� �,� , … , � �,� � such that � �,� , � �,��� ∈ � � , ∀� ∈ ��, �� . 2. Longest path 3. Volume 4. Worst-case workload 5. Critical chain 21 22 1. Chain (or path) 2. Longest path The longest path � � of a cp-task τ � is any source-sink chain of the A chain (or path) of a cp-task τ � is a sequence of nodes λ � task that achieves the longest length �� �,� , … , � �,� � such that � �,� , � �,��� ∈ � � , ∀� ∈ ��, �� . ������ ���� � � also represents the time required to execute it when the number The length of the chain, denoted by ����λ� , is the sum of the of processing units is infinite (large enough to allow maximum WCETs of all its nodes: parallelism) � ��� λ � � � �,� Necessary condition for feasibility: � � � � � ��� 23 24 4
Recommend
More recommend