CN113961439A - DAG task WCRT calculation method based on SMT method - Google Patents

DAG task WCRT calculation method based on SMT method Download PDF

Info

Publication number
CN113961439A
CN113961439A CN202111245020.1A CN202111245020A CN113961439A CN 113961439 A CN113961439 A CN 113961439A CN 202111245020 A CN202111245020 A CN 202111245020A CN 113961439 A CN113961439 A CN 113961439A
Authority
CN
China
Prior art keywords
node
establishing
dag
wcrt
constraint
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111245020.1A
Other languages
Chinese (zh)
Inventor
史荣晓
李西盛
李峰
胡治宇
孙景昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Northeastern University Qinhuangdao Branch
Original Assignee
Northeastern University Qinhuangdao Branch
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Northeastern University Qinhuangdao Branch filed Critical Northeastern University Qinhuangdao Branch
Priority to CN202111245020.1A priority Critical patent/CN113961439A/en
Publication of CN113961439A publication Critical patent/CN113961439A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3447Performance evaluation by modeling

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention belongs to the field of embedded real-time systems, and particularly relates to a DAG task WCRT calculation method based on an SMT method. The method comprises the steps of firstly generating a DAG task; then establishing a DAG model; establishing an objective function; establishing conditional constraints of the nodes; to ensure that a node must begin execution after its predecessors have completed execution, a constraint node is not preemptible at execution. Establishing load retention constraints; at any moment, the execution condition is met at the node, and no idle core exists; and finally establishing a source point and starting to execute time constraint. By establishing the constraint for realizing the continuous working characteristics, the method ensures that for any node and critical predecessors thereof, if the length of a time interval is greater than 0, the executed load is equal to the computing resources which can be provided in the time interval, and finally realizes the conversion from the response time analysis problem to the optimization problem.

Description

DAG task WCRT calculation method based on SMT method
Technical Field
The invention belongs to the field of embedded real-time systems, and particularly relates to a DAG task WCRT calculation method based on an SMT method.
Background
Multi-core processors are gradually replacing traditional single-core processors and become the hardware basis for most computer systems. With the development of multi-core real-time systems, the demand for computing power is increasing. To fully utilize the computational resources of a multi-core processor and meet the rapidly growing demands for high performance computing and low power consumption, real-time software must support parallelism. The real-time system is widely applied to safety-critical systems such as automobiles and airplanes, and the fields have extremely high requirements on safety, so that the real-time system is very important for modeling and analyzing. The key to ensure the safety of the real-time system is to ensure that tasks in the system strictly meet real-time constraints, and the Worst Case Response Time (WCRT) analysis of the real-time tasks is an important method for ensuring the safety of the real-time system. The model of the real-time task is usually an abstract and simple model, so the analysis of the model is often efficient and low in complexity, but the model cannot be used for describing a complex real-time system, so the more the model of the real-time system can be described, the higher the difficulty of the analysis of the model is.
Directed Acyclic Graph (DAG) is a very expressive model in the field of real-time systems, and is a common model for modeling parallel programs. For the single task model, each node in the graph represents a code segment to be executed sequentially, and the edges between the nodes represent the dependency relationship of the nodes. In the real-time field, the famous scholars Graham proposes a classic computation method of WCRT boundaries for a general DAG model, and the general DAG model means that a graph does not contain a special structure. All studies in this respect are based on the Graham world since then. However, the Graham boundary is an inaccurate upper time boundary, and with the development of information technology, the requirement for the accuracy of the task response time boundary in a real-time system is higher and higher, so that the research based on the Graham boundary has certain limitations. The invention can be used to compute general DAG model-accurate WCRT.
Disclosure of Invention
The invention provides a method for systematically calculating general DAG accurate WCRT by utilizing Satisfiability Model Theory (SMT) in the field of operational research. The method solves the limitation problem that the time upper bound of the Graham bound is inaccurate in the prior art. The invention provides a computing method of a DAG task WCRT based on an SMT method, which comprises the following steps:
the method comprises the following steps: generating a DAG task;
step two: establishing a DAG model;
step three: establishing an objective function;
step four: establishing conditional constraints of the nodes;
step five: establishing load retention constraints;
step six: establishing a source point starting execution time constraint;
step seven: and solving the objective function.
Further, the objective function formula in step three is as follows:
max(fsk-ssc) (2)
further, the conditional constraints in step four include: the execution time constraint of the nodes, the priority constraint of the nodes and the non-preemptive constraint of the nodes ensure that a feasible solution exists in the target function;
further, the execution time constraint formula of the node is as follows:
Figure BDA0003320652200000021
further, the priority constraint formula of the node is as follows:
Figure BDA0003320652200000022
further, the node non-preemptive constraint formula is as follows:
Figure BDA0003320652200000023
further, in the load holding constraint in the fifth step, in order to satisfy the execution condition, there is no idle core, which is defined as follows:
for any node ubAnd critical point thereofPrecursor uaLogical expression Π in equation (6)1Representing a time interval fa,sb]Is strictly greater than 0.
Figure BDA0003320652200000031
For any node ubAnd its critical precursor uaIf the following condition is satisfied, it is called node ux∈Par(ua) Is contained in the edge (u)a,ub) Relevant time interval [ fa,sb]Of (1), i.e. node uxIs the interval [ fa,sb]Is provided with HabRepresents a time interval [ fa,sb]A set of all the included nodes within.
Π2:sx<sb∧fx>fa (7)
For any edge (u)a,ub) E and any node ux∈Par(ub) B is a Boolean variableabxThe definition of (A) is as follows,
Figure BDA0003320652200000032
further, the arbitrary side (u)a,ub) E-containing node set HabDefinition of HabTwo types of subsets of (a):
left subset HL: h satisfying the following conditionsabNode u inxBelonging to the left subset HL
Π3:sx<fa (12)
Right subset HR: h satisfying the following conditionsabNode u inxBelong to the right subset HR
Π4:fx>sb (13)
For any edge (u)a,ub) E and any node ux∈Par(ub) Define a Boolean variable Labx(Rabx) To represent uxWhether or not it is contained in HL(HR) In (1), the definition is as follows,
Figure BDA0003320652200000033
Figure BDA0003320652200000034
further, the arbitrary side (u)a,ub) E and any node ux∈Par(ub) Establishing constraints for implementing the continuous operating characteristics:
Figure BDA0003320652200000041
the invention ensures that the node can be executed only after the precursor of the node is executed by establishing the DAG model, the objective function and the conditional constraint of the node, and the constraint node can not be preempted during the execution; establishing load holding constraint, and meeting execution conditions at a node at any time without idle cores; and establishing a constraint for realizing continuous working characteristics, ensuring that for any node and critical predecessor thereof, if the length of a time interval is greater than 0, the executed load is equal to the computing resource which can be provided in the time interval, and finally realizing the conversion from a response time analysis problem to an optimization problem.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a graph comparing experimental data according to the present invention.
Detailed Description
The constants and variables used in the SMT model were defined before implementing the invention:
-m: the number of cores included in the multi-core platform C;
-U: a set of nodes in graph G;
-E: set of edges in graph G;
-Wa: node uaE, the worst case execution time of U;
-Pre(ua): node uaE is the set of all the predecessors of U;
-Suc(ua): node uaBelonging to the set of all successors of U;
-Par(ua): node uaBelonging to the set of all parallel nodes of U;
-sa: representing a node uaE, starting execution time of U;
-fa: representing a node uaE, completing the execution time of U;
-ea: representing a node uaE is the execution time of U;
-Babx: boolean type variable, edge (u)a,ub) E and node ux∈Par(ua) Is used to index the variable.
-Labx: a Boolean type variable represented by [ f [ ]a,sb]Whether the start execution time of the inner node is less than fa
-Rabx: a Boolean type variable represented by [ f [ ]a,sb]Whether the completion execution time of the inner node is greater than sb
The invention discloses a real-time DAG task WCRT (worst case response time calculation) method based on SMT (surface mount technology), which aims to obtain the worst case response time of a general DAG task and provides a calculation method based on Satisfiability Model Theory (SMT), wherein the method can calculate the accurate worst case response time of the general DAG task; and expressing the dependency relationship between the nodes in the DAG model by using an inequality or an equality, and realizing the conversion from a response time analysis problem to an optimization problem by restricting the time behavior of the nodes. The method comprises the following specific steps:
the method comprises the following steps: a DAG task is generated. The user can set parameters of the DAG task and generate an information text of the DAG task.
Step two: and establishing a DAG model. In the task model, a real-time task is represented by DAGG ═ (U, E), where U represents a set of nodes of a Directed Acyclic Graph (DAG), and E is a set of edges connecting the nodes. Each node U in UaRepresenting a continuous piece of executable code, and each node corresponding to an execution time eaRepresenting the time required to execute the segment of code, each node has an execution time constraint called worst case execution time defined as eaWill not exceed its worst case execution time WaI.e. ea≤Wa. Each side (u) in Ea,ub) Representing node uaAnd ubConstraint relationship between, at the edge (u)a,ub) In China, call uaIs ubOne precursor of (a), (b), (c), (d)bIs uaThe existence of the predecessor successor relation limits the execution sequence of the nodes, namely the node ubMust be at uaExecution can only be started after execution is completed, defining Pre(ua) Represents uaSet of all predecessors, Suc(ua) Represents uaAll subsequent sets. Furthermore, if uaIs ubIs a precursor of or ubThe precursor of the precursor is called uaIs ubAncestor of ubIs uaDefine the symbol Anc(ua) Represents uaSet of all ancestors, Des(ua) Represents uaSet of all offspring, Par(ua) Represents a sum of uaThe set of all nodes executed in parallel, namely:
Par(ua)=U-Anc(ua)-Dec(ua)-{ua} (1)
in addition, a node without an ancestor is defined as a source, and a node without a descendant is defined as an endpoint. To avoid loss of generality, the invention assumes that the DAG task G has only one source point uscAnd an end point uskThe method is also suitable for multi-source and multi-destination tasks, where there are multiple sources and destinations in task GIn this case, it is necessary to add one virtual source point and one virtual destination point having an execution time of 0, and establish edges pointing from the virtual source point to all the source points and edges pointing from all the destination points to the virtual destination points.
Step three: and establishing an objective function, namely formula (2), wherein the objective function value is the worst-case response time (WCRT) of the model.
max(fsk-ssc) (2)
Step four: establishing conditional constraints of the nodes;
and establishing the execution time constraint of the node. For any node uaIt executes time eaAnd cannot be greater than its worst case execution time. The constraint is as in equation (3),
Figure BDA0003320652200000061
a priority constraint for the node is established. For any edge (u) in Ea,ub) Constructing the priority relationship between the nodes with the constraint of formula (4) to ensure the node ubMust be in its predecessor uaThe execution can only be started after the execution is completed,
Figure BDA0003320652200000062
and establishing node non-preemptive constraints. For any node U in UaThe constraint represented by equation (5) is node uaAre not preemptible at the time of execution,
Figure BDA0003320652200000063
step five: load retention constraints are established. Load maintenance is an important property of DAG tasks, i.e., at any time, if a node ubIf the execution condition is satisfied, then there will be no idle core in C. First, some definitions and notations are given.
For any node ubAnd its critical precursor uaLogical expression Π in equation (6)1Representing a time interval fa,sb]Is strictly greater than 0.
Figure BDA0003320652200000071
Wherein, Pre(ua) Represented node uaThe set of predecessors of.
For any node ubAnd its critical precursor uaIf the following condition is satisfied, it is called node ux∈Par(ua) Is contained in the edge (u)a,ub) Relevant time interval [ fa,sb]Of (1), i.e. node uxIs the interval [ fa,sb]Is provided with HabRepresents a time interval [ fa,sb]A set of all the included nodes within.
Π2:sx<sb∧fx>fa (7)
For any edge (u)a,ub) E and any node ux∈Par(ub) B is a Boolean variableabxThe definition of (A) is as follows,
Figure BDA0003320652200000072
the formulas (9) to (11) ensure the Boolean variable BabxThe condition of equation (8) is followed.
Figure BDA0003320652200000073
Figure BDA0003320652200000074
Figure BDA0003320652200000075
For any edge (u)a,ub) E-containing node set HabFurther define HabAre used to select the two types of subsets of,
left subset HL: h satisfying the following conditionsabNode u inxBelonging to the left subset HL
Π3:sx<fa (12)
Right subset HR: h satisfying the following conditionsabNode u inxBelong to the right subset HR
Π4:fx>sb (13)
For any edge (u)a,ub) E and any node ux∈Par(ub) Define a Boolean variable Labx(Rabx) To represent uxWhether or not it is contained in HL(HR) In (1), the definition is as follows,
Figure BDA0003320652200000076
Figure BDA0003320652200000081
to implement equations (14) and (15) in an SMT program, the following inequalities are defined. For any edge (u)a,ub) E and any node ux∈Par(ub),
Figure BDA0003320652200000084
Figure BDA0003320652200000085
Equation (16) ensures that for interval [ fa,sb]Arbitrary contained node u ofx(i.e. B)abx1) if uxBelonging to the left subset HL31), then LabxEqual to 1. Similarly, formula (17) ensures that if uxBelong to the right subset HRThen RabxEqual to 1.
For any node ubAnd its critical precursor uaTime interval [ fa,sb]Internal execution load WabThe way of calculating (a) is as follows,
Figure BDA0003320652200000082
establishing constraints for achieving sustained operating characteristics: for edge (u)a,ub) E and any node ux∈Par(ub),
Figure BDA0003320652200000083
Equation (19) ensures that u is arbitrarybAnd its critical precursor uaIf the time interval [ fa,sb]Is greater than 0 (i.e. pi)11) then in the interval fa,sb]The load internally performed is equal to the load at fa,sb]Within which computing resources may be provided.
Step six: and establishing a source point starting execution time constraint. Source point uscExecuting on a certain kernel of C, constraints like equation (20),
ssc=0 (20)
step seven: and solving the objective function.
Experimental results prove that the SMT method can calculate the accurate worst-case response time of the DAG task.
In the first step, the parameters of the task are specified when the task is generated, and the meaning of the parameters is as follows, wherein n represents the number of nodes contained in the task, m represents the number of kernels, d represents the output degree of the nodes, and e represents the execution time of the nodes. For example, the experimental data obtained in fig. 2(a) is generated according to the parameter settings in which the number of kernels m is fixed to 6, the degree of departure d of the node is fixed to 3, the execution time e of each node is 10, and the variable is the number of nodes n, i.e., the horizontal axis in fig. 2 (a).
For each generated task, the solving time t of the SMT model is calculated, and in addition, the Graham boundary is calculated by using a classical method and is used for a comparison experiment. Defining a boundary difference DIF to compare Graham boundaries RGAnd the precise time boundary R obtained by the SMT modelE
Figure BDA0003320652200000091
The left vertical coordinate of each sub-graph in fig. 2 is the average bound difference of each experiment, and the right vertical coordinate is the average computation time t of the SMT model of each experiment. As can be seen from the figure, the average accuracy of the SMT model is about 10% in the average case, and the solution efficiency is ideal in most cases.
It is to be understood that the present invention has been described with reference to certain embodiments, and that various changes in the features and embodiments, or equivalent substitutions may be made therein by those skilled in the art without departing from the spirit and scope of the invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the invention without departing from the essential scope thereof. Therefore, it is intended that the invention not be limited to the particular embodiment disclosed, but that the invention will include all embodiments falling within the scope of the appended claims.

Claims (9)

1. A DAG task WCRT calculation method based on an SMT method is characterized by comprising the following specific steps:
the method comprises the following steps: generating a DAG task;
step two: establishing a DAG model;
step three: establishing an objective function;
step four: establishing conditional constraints of the nodes;
step five: establishing load retention constraints;
step six: establishing a source point starting execution time constraint;
step seven: and solving the objective function.
2. An SMT method based WCRT calculation method for DAG tasks according to claim 1, wherein: the objective function formula in the third step is as follows:
max(fsk-ssc) (2)
3. an SMT method based WCRT calculation method for DAG tasks according to claim 1, wherein: the conditional constraints in the fourth step include: the execution time constraint of the nodes, the priority constraint of the nodes and the non-preemptive constraint of the nodes ensure that a feasible solution exists in the objective function.
4. An SMT method based WCRT calculation method for DAG tasks according to claim 3, wherein: the execution time constraint formula of the node is as follows:
Figure FDA0003320652190000011
5. an SMT method based WCRT calculation method for DAG tasks according to claim 3, wherein: the priority constraint formula of the node is as follows:
Figure FDA0003320652190000012
6. an SMT method based WCRT calculation method for DAG tasks according to claim 3, wherein: the node non-preemptive constraint formula is as follows:
Figure FDA0003320652190000013
7. an SMT method based WCRT calculation method for DAG tasks according to claim 1, wherein: in the load holding constraint in the step five, in order to satisfy the execution condition, no idle core exists, which is defined as follows:
for any node ubAnd its critical precursor uaLogical expression Π in equation (6)1Representing a time interval fa,sb]Whether the length of (a) is strictly greater than 0;
Figure FDA0003320652190000021
for any node ubAnd its critical precursor uaIf the following condition is satisfied, it is called node ux∈Par(ua) Is contained in the edge (u)a,ub) Relevant time interval [ fa,sb]Of (1), i.e. node uxIs the interval [ fa,sb]Is provided with HabRepresents a time interval [ fa,sb]A set of all the included nodes within;
Π2:sx<sb∧fx>fa (7)
for any edge (u)a,ub) E and any node ux∈Par(ub) B is a Boolean variableabxThe definition of (A) is as follows,
Figure FDA0003320652190000022
8. an SMT method based WCRT calculation method for DAG tasks according to claim 7, wherein: said arbitrary side (u)a,ub) E-containing node set HabDefinition of HabTwo types of subsets of (a):
left subset HL: h satisfying the following conditionsabNode u inxBelonging to the left subset HL
Π3:sx<fa (12)
Right subset HR: h satisfying the following conditionsabNode u inxBelong to the right subset HR
Π4:fx>sb (13)
For any edge (u)a,ub) E and any node ux∈Par(ub) Define a Boolean variable Labx(Rabx) To represent uxWhether or not it is contained in HL(HR) In (1), the definition is as follows,
Figure FDA0003320652190000023
Figure FDA0003320652190000024
9. an SMT method based WCRT calculation method for DAG tasks according to claim 8, wherein: said arbitrary side (u)a,ub) E and any node ux∈Par(ub) Establishing constraints for implementing the continuous operating characteristics:
Figure FDA0003320652190000031
CN202111245020.1A 2021-10-26 2021-10-26 DAG task WCRT calculation method based on SMT method Pending CN113961439A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111245020.1A CN113961439A (en) 2021-10-26 2021-10-26 DAG task WCRT calculation method based on SMT method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111245020.1A CN113961439A (en) 2021-10-26 2021-10-26 DAG task WCRT calculation method based on SMT method

Publications (1)

Publication Number Publication Date
CN113961439A true CN113961439A (en) 2022-01-21

Family

ID=79466922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111245020.1A Pending CN113961439A (en) 2021-10-26 2021-10-26 DAG task WCRT calculation method based on SMT method

Country Status (1)

Country Link
CN (1) CN113961439A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114880083A (en) * 2022-03-24 2022-08-09 哈尔滨工业大学(深圳) Optimization method of logic complexity of DAG task execution and storage medium
CN117130748A (en) * 2023-08-29 2023-11-28 哈尔滨工业大学 Analysis and scheduling method based on typed DAG tasks on heterogeneous multi-core platform

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114880083A (en) * 2022-03-24 2022-08-09 哈尔滨工业大学(深圳) Optimization method of logic complexity of DAG task execution and storage medium
CN117130748A (en) * 2023-08-29 2023-11-28 哈尔滨工业大学 Analysis and scheduling method based on typed DAG tasks on heterogeneous multi-core platform

Similar Documents

Publication Publication Date Title
CN105117286B (en) The dispatching method of task and streamlined perform method in MapReduce
CN113961439A (en) DAG task WCRT calculation method based on SMT method
CN105022670A (en) Heterogeneous distributed task processing system and processing method in cloud computing platform
Kodase et al. Improving scalability of task allocation and scheduling in large distributed real-time systems using shared buffers
Breß et al. A framework for cost based optimization of hybrid CPU/GPU query plans in database systems
Nasr et al. A new duplication task scheduling algorithm in heterogeneous distributed computing systems
CN114741204A (en) Method for task decomposition and parallel solution of simulation model
Chang et al. Computing exact WCRT for typed DAG tasks on heterogeneous multi-core processors
Lee et al. On resource efficiency of workflow schedules
Huang et al. Communication-aware task scheduling algorithm for heterogeneous computing
CN111274667B (en) Cross-scale material computing software integrated computing system and method
Fan et al. Model aggregation method for data parallelism in distributed real-time machine learning of smart sensing equipment
CN114168314B (en) Multithreading concurrent data index batch processing method and device and storage medium
Zhou et al. Response time analysis for tasks with fixed preemption points under global scheduling
Zou et al. Real-time multiprocessor scheduling algorithm based on information theory principles
Peng et al. Response time analysis of typed DAG tasks for G-FP scheduling
Wang et al. An improved smt-based scheduling for overloaded real-time systems
CN113961347B (en) Method for improving reliability of mobile computing platform
CN115904705B (en) Optimal scheduling method for multiprocessor restricted preemption
Su et al. Learning-augmented energy-aware scheduling of precedence-constrained tasks
CN117435308B (en) Modelica model simulation method and system based on parallel computing algorithm
Zheng et al. Uniform parallel-machine scheduling to minimize the number of tardy jobs in the MapReduce system
Weihua et al. Analysis of information management and scheduling technology in Hadoop
Ma et al. The Execution Efficiency of the Response Time Analysis under Different Task Sequencing Strategies
Lin et al. A Parallel Optimization Method for Robustness Verification of Deep Neural Networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination