CN110554925B - Deadlock check-oriented non-blocking MPI program symbol execution method, system and medium - Google Patents

Deadlock check-oriented non-blocking MPI program symbol execution method, system and medium Download PDF

Info

Publication number
CN110554925B
CN110554925B CN201910838017.7A CN201910838017A CN110554925B CN 110554925 B CN110554925 B CN 110554925B CN 201910838017 A CN201910838017 A CN 201910838017A CN 110554925 B CN110554925 B CN 110554925B
Authority
CN
China
Prior art keywords
state
blocking
matching
global
program
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.)
Active
Application number
CN201910838017.7A
Other languages
Chinese (zh)
Other versions
CN110554925A (en
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.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201910838017.7A priority Critical patent/CN110554925B/en
Publication of CN110554925A publication Critical patent/CN110554925A/en
Application granted granted Critical
Publication of CN110554925B publication Critical patent/CN110554925B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/524Deadlock detection or avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the field of reliability guarantee of high-performance computing of a computer, and discloses a deadlock check-oriented non-blocking MPI program symbol execution method, a deadlock check-oriented non-blocking MPI program symbol execution system and a deadlock check-oriented non-blocking MPI program symbol execution medium. For the asynchrony and non-determinism of non-blocking MPI programs, the present invention ensures that symbolic execution can systematically traverse the path space of the MPI program by creating different to-be-explored states for different message matching cases and different overlapping execution cases of communication operations. The statement symbol execution method in the framework of the invention can accurately depict symbolic state transition corresponding to execution of different types of statements, and the blocking driving matching strategy can effectively obtain all possible matching conditions of communication behaviors in the symbol execution process. The invention systematically traverses the path space of the non-blocking MPI program based on symbolic execution, automatically detects whether the path is deadlocked or not when the path is executed by the exploration program until the program path space is explored, the deadlocked is found or the time is overtime.

Description

Deadlock check-oriented non-blocking MPI program symbol execution method, system and medium
Technical Field
The invention relates to the field of reliability guarantee of high-performance computing of a computer, in particular to a deadlock check-oriented non-blocking MPI program symbol execution method, a deadlock check-oriented non-blocking MPI program symbol execution system and a deadlock check-oriented non-blocking MPI program symbol execution medium.
Background
At this stage, high performance computing is widely used to solve large scale computing problems, such as nuclear simulation and climate simulation. Message Passing Interface (MPI) has become a standard paradigm for parallel programming in the field of high performance computing by virtue of excellent computing performance, good extensibility and portability. Strictly speaking MPI is a library, not a language, and its parallel language can be implemented based on C, Fortran and so on.
Fig. 1 gives a definition of the MPI basic communication operation Comm. For simplicity of description, the definition omits parameters such as messages and communication domains in operation. In fig. 1, the value of expression e is integer, which is used to identify the target process number of the operation, and the symbol r is the handle of the non-blocking operation. The MPI basic communication operation Comm includes: ssend (e) sending the message to the process with number e, and blocking the sending process until the message is received; send (e) sends the message to the process of number e, send the process to block until the message is copied to the system buffer; recv (e) receiving the message for process e, the receiving process blocking until the message is received; recv (, receiving messages from any process, the receiving process blocking until a message is received; barrier is a Barrier synchronization operation that blocks progress until all processes invoke Barrier operations; wait (r) blocks the process until the non-blocking operation identified by handle r is complete; ISend (e, r) sends a message to the process of number e, and the operation does not need to wait for the completion of message sending and returns immediately; IRecv (e, r) receives the message of the e number process, and the operation does not need to wait for the completion of message reception and returns immediately; IRecv (, r) receives messages from any process, and this operation does not need to return immediately after the message reception is completed.
And the method can support complex communication operations such as aggregation communication operations MPI _ Scatter, MPI _ Gather and the like in an extensible mode based on the defined basic communication operations. For simplicity of description, send (dst) is used herein to represent various types of sending operations for sending messages to dst processes, recv (src) is used to represent various types of receiving operations for receiving messages from src processes, and when src is, any source receiving operation is represented. MPI non-blocking communication operation does not need to wait for communication completion, and can continue to execute subsequent operation, so that communication operation is completed out of order; different runs of an arbitrary source receive operation may receive messages from different processes, making program execution highly uncertain. The asynchronous and non-deterministic nature of MPI programs makes the programs error prone, and deadlock is a representative error in MPI programs.
The MPI C program shown in fig. 2 runs four MPI processes. In FIG. 2, Process P0、P2And P3All send a message to P1And then terminates (the standard Send returns immediately in infinite system buffer mode). If the input x is not equal to 'a', process P1Blocking reception Process P0Otherwise, non-blocking receiving the message sent by any process, and finally blocking receiving the message from the process P3The message of (2). Obviously, when input x is not equal to 'a', process P1Will receive the message from the process P successively0And P3The message is smoothly terminated without deadlock. When input x equals 'a' and any source receive operation IRecv (, req) matches from process P3When the message is received, process P1The block receive operation of Recv (3) has no message match, while other processes have terminated normally, and a deadlock has occurred. The occurrence of MPI program deadlocks therefore depends on both the input to the program and the scheduling policy of the process execution.
The deadlock checking method of the current MPI program is mainly divided into a static checking method, a dynamic checking method and a symbolization checking method. The static checking method is used for analyzing whether the abstract model of the MPI program is deadlocked or not and is limited by the problems of low automation degree, high false alarm rate and the like. Dynamic checking method for checking whether program has deadlock based on runtime information of programThe input space of the program cannot be effectively covered. Symbolic execution runs a program using symbolic values, effectively covering the input space of the program. The symbolic execution state of the traditional serial program is a triple (M, Stat, PC), wherein M is the mapping relation from a variable to an actual value or a symbolic expression; stat is a statement to be executed next in the state; the PC is a path condition, i.e., a set of constraints resulting from the execution of a program entry to the current state symbolizing a variable. Initially, M maps the symbolic variable and the normal variable to the unconstrained symbolic value and the actual value, respectively, Stat is the first statement of the program, and PC is true. When symbolic execution encounters a branch statement c of a symbolized variable, two states S are created for the current statetAnd SfCorresponding to true and false branches, respectively. For StThe symbolic execution calls a constraint solver to determine if PC ^ c can be satisfied, and if so, StThe path condition of (A) is updated to PC ^ c, otherwise S is terminatedt. According to
Figure GDA0003338808560000021
Satisfiability of, symbol execution pair SfA similar operation is used. Fig. 3 shows an example program and a corresponding symbolic execution tree, where for the two paths (x ═ 100 and x ≠ 100) included in the left example program, the right execution tree shows 2 corresponding test cases x ═ 100 and x ≠ 1.
Symbolic execution of an actual MPI program faces two major challenges: (1) how to systematically traverse the path space of an MPI program containing non-blocking and non-deterministic communication operations; (2) how to improve the scalability of the symbolic execution analysis MPI program. In addition to branch instructions, the number of paths of the MPI program increases exponentially with the number of MPI processes running and the number of operations received by any source. The existing MPI program symbol execution methods, namely MPISE and TASS, can check whether a program is deadlocked or not in the process of traversing a program path space by a system, but do not support non-blocking communication operation widely existing in an actual MPI program. How to implement the deadlock check-oriented non-blocking MPI program symbolic execution becomes a key technical problem to be solved urgently.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: in view of the above problems in the prior art, a deadlock check-oriented non-blocking MPI program symbol execution method, system, and medium are provided. The present invention automatically detects whether there is a deadlock in an actual MPI program that includes non-blocking and non-deterministic communication operations based on symbolic execution techniques. The MPI statement symbol execution provided by the invention can accurately depict symbolic state transition corresponding to different types of statement execution, and the blocking driving message matching strategy can effectively acquire all possible matching conditions of messages in the MPI program symbol execution process. Based on a statement execution method and a blocking drive matching strategy, an MPI program symbol execution method facing deadlock check is provided, and deadlock errors in an actual MPI program can be automatically detected.
In order to solve the technical problems, the invention adopts the technical scheme that:
a deadlock check-oriented non-blocking MPI program symbol execution method comprises the following implementation steps:
1) inputting an MPI program, the number N of running processes and a symbolic variable set Sym;
2) initializing a state set Worklist to be explored into a global initialization state init, wherein the global initialization state init is a combination of initial states of all processes;
3) selecting an unprocessed global state from a state set Worklist to be explored as a current global state S according to a state space search strategyc
4) Selecting a state S to be explored according to a polling scheduling strategycThe active process i of (1) is executed, wherein the symbolized state of the process i comprises the variable mapping relation M of the processiNext execution statement StatiAnd path condition PCiAnd a process run state F;
5) based on the global state ScStat to execute statement Stat to Process iiExecuting statement symbol, updating the symbol execution state of the process i according to the statement symbol execution method, and judging ScIf all the process running states are blocked or terminated, if yes, jumping to step 6), and if notContinuing to execute the step 4);
6) matching communication behaviors in a global blocking state, creating states to be explored for different message matching conditions and different overlapping execution conditions of communication operation, and adding the states to the Worklist; updating the running state of the process according to the matching condition of the communication operation and performing deadlock check;
7) and judging whether deadlock, overtime or a state set to be explored Worklist is empty, if yes, terminating analysis, and otherwise, skipping to execute the step 3).
Optionally, the next execution statement Stat of the symbolic execution active process i in step 5)iThe detailed steps comprise:
5.1) judging the next execution statement StatiType of (1), if StatiStep 5.2) is executed for the non-blocking communication operation; if StatiSkipping to execute step 5.3) for the communication blocking operation; otherwise, skipping to execute the step 5.4);
5.2) by sequence SeqiRecording a communication operation sequence flowing out by a process i, wherein the recording method is to splice the newly flowing out communication operation at the tail of the previously flowing out operation sequence and keep the running state of the process i still active;
5.3) by sequence SeqiRecording a communication operation sequence flowing out by a process i, wherein the recording method is to splice the newly flowing out communication operation at the tail part of the previously flowing out operation sequence; updating the running state of the process i to be blocking;
5.4) executing the statement according to the traditional symbolic execution method, and keeping the running state of the process i still active.
Optionally, in step 6) in a global blocking state ScThe following steps of message matching and deadlock checking are performed, and the detailed steps comprise:
6.1) initializing a set PS for recording any source receive operation matchesWIs empty;
6.2) matching to obtain the global blocking state ScMatching pair for next pair of non-arbitrary source operationsn
6.3) if match pairnIs not null, a message matching pair is performednAnd creates a new state Sc', wherein the new state Sc' corresponds to based on ScPerforming message matching pairnThe resulting state change, update Sc' middle matching pairnThe running state of the process containing the blocking communication action is active, and a new state S is setc' add to Worklist and return); otherwise, executing step 6.4);
6.4) for Global State ScMatching any source receiving operation, adding the matching result into the set PSW(ii) a If PS is setWIf not, based on global state ScAs a set PSWEach of the arbitrary source operations of (1) matching pairwCreating a corresponding new state Sc', wherein Sc' represents State ScPerforming message matching pairwThe migrated state adds a new state Sc' go to the state set to be explored Worklist and return; otherwise, executing step 6.5);
6.5) checking whether there are still un-terminated processes in the global blocking state, if so, reporting that deadlock is generated, otherwise, returning.
Optionally, step 6.2) matching and obtaining the global blocking state ScMatching pair for next pair of non-arbitrary source operationsnThe detailed steps comprise: judging the communication sequence Seq of each process iiIf yes, returning to the Barrier synchronization operation Barrier matching; otherwise, scanning the communication sequence Seq according to the ascending order of the process number iiFirst, the communication sequence Seq is judgediIf the waiting operation wait (r) exists in the sequence and the non-blocking communication operation corresponding to the handle r is finished, returning to the blocking waiting operation wait (r) for matching if the waiting operation wait (r) is finished, otherwise, continuously judging the communication sequence SeqiWhether there is a message sending operation send (j) that can be matched and the communication sequence SeqjIf yes, returning to the message sending operation send (j) and the message receiving operation recv (i) which are matched; otherwise, an empty match is returned.
Optionally, step 6.4) obtains the givenAll the matching steps of any source receiving operation recv in the process i are to scan communication operations which flow out and can be matched in all other processes, check whether the communication action is send (i), and if so, add the matching pair to the PSwIn (1).
Furthermore, the present invention also provides a deadlock check-oriented non-blocking MPI program symbol execution system, comprising a computer device programmed or configured to execute the steps of the deadlock check-oriented non-blocking MPI program symbol execution method.
In addition, the invention also provides a deadlock check-oriented non-blocking MPI program symbol execution system, which comprises a computer device, wherein a storage medium of the computer device is stored with a computer program which is programmed or configured to execute the deadlock check-oriented non-blocking MPI program symbol execution method.
Furthermore, the present invention also provides a computer readable storage medium having stored thereon a computer program programmed or configured to perform the deadlock check oriented non-blocking MPI program symbol execution method.
In addition, the invention also provides a deadlock check-oriented non-blocking MPI program symbol execution system, which comprises:
the input program unit is used for inputting an MPI program, the number N of running processes and a symbolic variable set Sym;
a state initialization program unit, configured to initialize a to-be-explored state set Worklist to a global initialization state init, where the global initialization state init is a combination of initial states of all processes;
a traversal state selection program unit for selecting an unprocessed global state S from the state set Worklist to be explored according to a given search strategy (default depth-first strategy)cTo explore;
a process scheduling program unit for selecting the state S to be explored according to the polling scheduling strategycThe state of the active process i comprises a variable mapping relation MiNext execution statement StatiProcess path condition PCiAnd the process is carried outLine state F;
statement symbol execution program unit for executing a program in a global state ScStatement to be executed Stat of Process iiExecuting the symbol and updating the symbolization state of the process;
and the message matching and deadlock checking program unit is used for matching the communication behaviors in the global blocking state, updating the set Worklist of the state to be explored and checking whether the exploration path is deadlocked or not.
The invention automatically detects whether the actual MPI program containing non-blocking and non-determinacy communication operation has deadlock based on the symbolic execution technology, the symbolic execution of the MPI statement can accurately depict symbolic state migration corresponding to different types of statement execution, and the blocking driving message matching strategy can effectively acquire all possible message matching conditions in the symbolic execution process of the MPI program. Based on a statement execution method and a blocking drive matching strategy, an MPI program symbol execution mode oriented to deadlock check is provided, and deadlock errors in an actual MPI program can be automatically detected.
Compared with the prior art, the invention has the following advantages: the invention relates to a symbol execution method which is oriented to a non-blocking MPI program and can cover both program input and a process scheduling strategy, and whether a program is deadlocked or not can be effectively checked. For the asynchrony and non-determinism of non-blocking MPI programs, the present invention ensures that symbolic execution can systematically traverse the path space of MPI programs by creating different states to be explored for different message matching cases and different overlapping execution cases of communication operations. The statement symbol execution method in the framework of the invention can accurately depict symbolic state transition corresponding to execution of different types of statements, and the blocking driving matching strategy can effectively obtain all possible matching conditions of communication behaviors in the symbol execution process.
Drawings
Fig. 1 is a schematic diagram of basic communication operation of MPI.
Fig. 2 is an MPI example program.
FIG. 3 is an example C program and its symbolic execution tree.
FIG. 4 is a schematic diagram of a basic flow of a method according to an embodiment of the present invention.
FIG. 5 is a flow chart illustrating the execution of the sentence symbols according to the embodiment of the present invention.
Fig. 6 is a flow chart illustrating blocking driving matching according to an embodiment of the present invention.
FIG. 7 is a tool prototype in an embodiment of the invention.
Detailed Description
As shown in fig. 4, the implementation steps of the deadlock checking-oriented non-blocking MPI program symbol execution method of the embodiment include:
1) inputting an MPI program (represented by MP in the embodiment), the number N of running processes and a symbolic variable set Sym;
2) initializing a to-be-explored state set Worklist to be a global initialization state init, wherein the global initialization state init is a combination of initial states of all processes, path conditions of all the processes in the global initialization state init are true, statements to be executed are initial statements, variables are mapped to unconstrained symbolic variables or actual values, and can be represented as: worklist ← { init };
3) selecting an unprocessed global state from a state set Worklist to be explored as a current global state S according to a state space search strategy (default is a depth priority strategy)cIt can be expressed as: scOid, select (workbench), where the current global state S is selectedcThe method can adopt various different state space search strategies according to the needs, such as depth-first search DFS or breadth-first search BFS and the like;
4) selecting a state S to be explored according to a polling scheduling strategycThe active process i of (1) is executed, wherein the symbolized state of the process i comprises the variable mapping relation M of the processi(describing variable value-taking condition) and next execution statement StatiAnd path condition PCi(describing the constraint set generated by symbolizing the input variables from the program entry execution to the current state) and the process running state F (including three cases of termination, blocking and activity), can be represented as (M)i,Stati,PCi,F)←Scheduler(Sc);
5) Based on the global state ScStat to execute statement Stat to Process iiPerforming statement symbolic execution, which can be expressed as Execute (S)c,Stati,PCiSym), updating the symbolic execution state of the process i according to the statement symbolic execution method, and judging ScIf all the process running states are blocked or terminated, if so, continuing to execute the step 6), otherwise, continuing to execute the step 4);
6) in a global blocking state ScMatching of communication behavior (denoted as Matching (S)c) Creating states to be explored for different message matching situations and different overlapping execution situations of communication operation, and adding the states to be explored into Worklist; updating the running state of the process according to the matching condition of the communication operation and performing deadlock check;
7) and judging whether deadlock, overtime or a state set to be explored Worklist is empty, if yes, terminating analysis, and otherwise, skipping to execute the step 3).
Since MPI processes have independent memory space, the execution order of local computation statements among different processes has no influence on deadlock. In order to reduce the path space to be explored for symbol execution, the polling process scheduling strategy provided by the invention selects a global state S to be exploredcThe active process with the minimum middle process number is executed, the process is executed until being blocked, and then the active process with the minimum middle process number is switched to execute until ScAll processes in the set are blocked or terminated and then message matching is performed.
When executing MPI program symbols running N processes, one symbol executes the global state ScLocal state s by respective parallel MPI processesiIs formed of, i.e. Sc=<s0,s1,...si,...>(0≤i<N). For process number i, its state siIs a quadruple (M)i,Stati,PCiF) in which MiIndicates the current variable value mapping relation, Stat, of the processiIndicating the next statement to be executed by the process, PCiF represents the running state of the process (F. epsilon. { active, blocked, terminated }) for the current path condition of the process,indicating active, blocking and terminating states, respectively). In addition, each process is provided with a memory sequence Seq in order to be able to obtain all possible cases of message matchingi(i is the process number) to record the sequence of communication operations that the process flows out of. A statement that executes any one process on a symbolic execution updates the global state.
The execution method in the step 5) gives that the symbolic execution is in the global state ScLower execution No. i active Process ProciStatement Stat ofiThe resulting symbolized state transitions. According to the statement StatiSymbol execution takes different actions to update the state s of process # ii. The detailed steps comprise:
5.1) judging the next execution statement StatiIf the next execution statement StatiStep 5.2) is executed for non-blocking communication operation (ISend, IRecv or Send in the infinite system cache mode); if the next execution statement StatiSkipping to execute step 5.3 for the blocking communication operation (Barrier, Wait, Ssend or Recv); otherwise, the next execution statement StatiStep 5.4) is executed by skipping for the non-communication statement;
5.2) by communication sequence SeqiTo record the communication sequence of the process flow, and to splice the newly-flowed communication operation at the tail of the previously-flowed operation sequence, it can be expressed as: seqi←Seqi·<Stati>(ii) a Returning to continue executing subsequent statements and keeping the process ProciIs still active;
5.3) by communication sequence SeqiTo record the outgoing communication sequence of the process and to splice the newly outgoing communication operation at the end of the previously outgoing operation sequence, can be expressed as: seqi←Seqi·<Stati>(ii) a Updating Process ProciThe operating state of (A) is blocked and can be represented as siα ← blocked; when all processes are blocked or terminated, such that a global blocked state is reached, in global state ScThen, the process of matching the communication operation execution message is carried out, the running state of the process corresponding to the communication operation is updated, and deadlock check is carried out;
5.4) execute the statement according to the conventional symbolic execution method and keep the process ProciIs still active.
Step 5.4) actually involves processing non-communicating statements, i.e. executing statements of this type according to the conventional symbolic execution method. For branch statement c, a constraint solver is called to judge the current path condition PCiWhether true and false branches are feasible, i.e. PCiΛ c and
Figure GDA0003338808560000071
if yes, then establishing a new symbol execution state for the feasible branch, and updating the path condition of the state to be the sum of the original path condition and the branch condition; for non-branching statements, the statement computation is converted into a correlation operation on the symbolic expression, i.e. the mapping relation M is updatedi
In order to ensure the reliability of the MPI program symbol execution method, the present embodiment proposes a block-driven matching method to obtain all possible matching cases of communication behaviors. The main idea of this approach is to match any source receive operation as late as possible under the MPI semantic rules. The pairing of messages may be done out of order due to the presence of non-blocking communication operations. Thus, preferentially matching non-arbitrary source operations under MPI semantics can help find possible matching send operations for arbitrary source receive operations.
Based on the dependency relationship of communication operation completion given by MPI standard, ready (alpha, s)i) Symbolizing the state s of operation a in process iiThe following conditions can be matched:
when alpha is wait (r), s is requirediOutgoing communication operation sequence SeqiThe non-blocking communication operation corresponding to the middle handle r is matched and executed;
when α is send (k), Seq is requirediThe send (k) operation preceding alpha has been matched.
When α is recv (k), Seq is requirediRecv (k) and recv (×) preceding α in (a) have been matched.
When α is recv (, on the one hand, it is requiredSeqiRecv (, c) preceding α has been matched; on the other hand, if there is an unmatched IRecv (k, r) that was streamed before α, recv (, x) is required to be unable to match the message from process k.
Given a process state siAnd operation α, by scanning SeqiThe matching state of the operations in the sequence, it can be determined whether the operation α can be matched, i.e. ready (α, s)i) Whether or not it is satisfied.
Step 6) in the present embodiment in the global blocking state ScAnd then carrying out communication operation matching, matching pair execution and deadlock check. Fig. 6 shows a flow chart of the process, the detailed steps including:
6.1) initializing a set PS for recording any source receive operation matchesWIs empty and can be expressed as PSw←φ;
6.2) matching to obtain the global blocking state ScMatching pair for next pair of non-arbitrary source operationsnCan be expressed as pairn←matchN(Sc);
6.3) if match pairnIs not null, a message matching pair is performednAnd creates a new state Sc', wherein the new state Sc' corresponds to based on ScPerforming message matching pairnThe resulting state change, update Sc' middle matching pairnThe running state of the process containing the blocking communication action is active, and a new state S is setc' add to Worklist and return; otherwise, executing step 6.4);
6.4) for Global State ScMatching any source receiving operation, adding the matching result into the set PSWCan be expressed as PSw←matchw(Sc) (ii) a If PS is setWIf not, it is the set PSWEach of the arbitrary source operations of (1) matching pairwBased on the global state ScCreating a corresponding new state Sc', wherein Sc' represents State ScPerforming message matching pairwThe migrated state adds a new state Sc' into the State set to be explored Worklist, it can be expressed as Sc′←fork(Sc,pairw) Insert (S) and workbenchc') and back; otherwise, executing step 6.5);
6.5) checking whether there are still un-terminated processes in the global blocking state, if so, reporting that deadlock is generated, otherwise, returning.
In this embodiment, step 6.2) matches and obtains the global state ScMatching pair for next pair of non-arbitrary source operationsnThe function adopted is matchnThe detailed steps of matching for each process i include: determining a communication sequence SeqiIn which Barrier synchronization operation Barrier is present and does not match (
Figure GDA0003338808560000081
And Barrier is not matched), if yes, returning Barrier synchronization operation Barrier as matching; otherwise, the communication sequence Seq is scanned in ascending orderiFirst, the communication sequence Seq is judgediWhether there is a wait operation wait (r) and the non-blocking communication operation corresponding to the handle r is completed (r)
Figure GDA0003338808560000082
Ready (wait (r), s)i) If yes, returning to the wait operation wait (r) matching, otherwise, continuing to judge the communication sequence SeqiWhether there is a message sending operation send (j) capable of matching
Figure GDA0003338808560000083
Figure GDA0003338808560000084
And communication sequence SeqjThere is a message receiving operation recv (i) capable of matching
Figure GDA0003338808560000085
Figure GDA0003338808560000086
If true, returning to message sending operation send (j), message receivingOperating recv (i) to match; otherwise, an empty match is returned. In this embodiment, step 6.4) is performed for the set PSWEach pair of (1) matching a matching pair of arbitrary source operationswSpecifically adopting function matchwThe implementation specifically means that recv (, recv) is received for any source of the process i, and send (i) which flows out of all other processes and can be matched is acquired. Function matchwReturning to the matching condition of any source receiving operation in the current state, and recv () for any source receiving operation of the process i, and performing function matchwThe basic idea of the method is to obtain the outgoing and matching send (i) in all other processes, and the function matchwThe calculation formula of the matching set is
Figure GDA0003338808560000087
b∈Seqj,ready(a,si)∧ready(b,sj) Λ match (a, b) ^ b ═ recv (}, where ready (a, s)i)∧ready(b,sj) Representing outgoing messaging and communication operations that can be matched pair under MPI semanticsw. To ensure that possible process scheduling policies are not missed by symbolic execution, for function matchwReturned matching set PSwFor each match, a corresponding state (fork) is created for it by a state creation operation fork (S)c,pairw) And adds it to the set of states to be explored for symbol execution worklist (S)c')). When S iscWhere there are multiple arbitrary source receive operations that can be matched, symbol execution creates a state for each matching order between them. Finally, considering that message Matching occurs in a global blocking state, when the Matching method cannot acquire any Matching condition (pair)nAnd PSwBoth empty) indicating that a deadlock has occurred, at which point the symbolic analysis will terminate and report the deadlock.
In this embodiment, the deadlock examination-oriented non-blocking MPI program symbol execution method is implemented based on the symbol execution platform Cloud9, and the tool prototype implemented by the present invention is shown in fig. 7; the MPI C program obtains LLVM byte codes through a compiler Clang, then inputs the LLVM byte codes into a symbolic execution engine by combining an MPI library Azequia and a process number N to execute the deadlock check-oriented non-blocking MPI program symbolic execution method, and finally outputs a deadlock analysis result. Cloud9 is a parallel open source symbolic execution engine that can support a POSIX environment and multithreading programs. In order to effectively utilize the support of Cloud9 for the multithread program, the symbolic execution engine implemented by the invention adopts the multithread MPI library Azequia as an external MPI environment model for symbolic execution (provides a simulation implementation of a communication API called in the MPI program), and realizes the support of thread global variables. The symbolic execution engine systematically traverses the path space of the program, terminating the path space exploration when a deadlock is detected, and generating a test case that can trigger the deadlock. The test case comprises the input of the program and the scheduling policy executed by the MPI process. We have applied the implemented tool prototype to deadlock check analysis of real MPI C programs, and are currently able to support automated deadlock check of ten parallel processes running ten thousand rows of MPI C programs.
In addition, the present embodiment also provides a deadlock check-oriented non-blocking MPI program symbol execution system, which includes a computer device programmed or configured to execute the steps of the deadlock check-oriented non-blocking MPI program symbol execution method according to the present embodiment.
In addition, the present embodiment further provides a deadlock check-oriented non-blocking MPI program symbol execution system, which includes a computer device, where a storage medium of the computer device stores a computer program that is programmed or configured to execute the foregoing deadlock check-oriented non-blocking MPI program symbol execution method according to the present embodiment.
Furthermore, the present embodiment also provides a computer-readable storage medium, which stores thereon a computer program programmed or configured to execute the aforementioned deadlock examination-oriented non-blocking MPI program symbol execution method of the present embodiment.
In addition, the present embodiment further provides a deadlock check-oriented non-blocking MPI program symbol execution system, including:
the input program unit is used for inputting an MPI program, the number N of running processes and a symbolic variable set Sym;
a state initialization program unit, configured to initialize a to-be-explored state set Worklist to a global initialization state init, where the global initialization state init is a combination of initial states of all processes;
a traversal state selection program unit for selecting an unprocessed global state S from the state set Worklist to be explored according to a given search strategy (default depth-first strategy)cTo explore;
a process scheduling program unit for selecting the state S to be explored according to the polling scheduling strategycThe state of the active process i comprises a variable mapping relation MiNext execution statement StatiProcess path condition PCiAnd process running state Fi
Statement symbol execution program unit for executing a program in a global state ScStatement to be executed Stat of Process iiExecuting the symbol and updating the symbolization state of the process;
and the message matching and deadlock checking program unit is used for matching the communication behaviors in the global blocking state, updating the set Worklist of the state to be explored and checking whether the exploration path is deadlocked or not.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may occur to those skilled in the art without departing from the principle of the invention, and are considered to be within the scope of the invention.

Claims (8)

1. A deadlock check-oriented non-blocking MPI program symbol execution method is characterized by comprising the following implementation steps:
1) inputting an MPI program, the number N of running processes and a symbolic variable set Sym;
2) initializing a state set Worklist to be explored into a global initialization state init, wherein the global initialization state init is a combination of initial states of all processes;
3) selecting an unprocessed global state from a state set Worklist to be explored as a current global state S according to a state space search strategyc
4) Selecting a state S to be explored according to a polling scheduling strategycThe active process i of (1) is executed, wherein the symbolized state of the process i comprises the variable mapping relation M of the processiStat to execute statement StatiAnd path constraint condition PCiAnd a process run state F;
5) based on the global state ScStat to execute statement Stat to Process iiExecuting statement symbol, updating the symbol execution state of the process i according to the statement symbol execution method, and judging whether to enter a global blocking state, namely ScIf all the process running states are blocked or terminated, jumping to the step 6) if the process running states are blocked or terminated, otherwise, continuing to execute the step 4);
6) matching communication behaviors in a global blocking state, creating states to be explored for different message matching conditions and different overlapping execution conditions of communication operation, and adding the states to the Worklist; updating the running state of the process according to the matching condition of the communication operation and performing deadlock check;
7) judging whether deadlock, overtime or a state set to be explored Worklist is empty, if yes, terminating analysis, and otherwise, skipping to execute the step 3);
in step 6) in a global blocking state ScThe following steps of message matching and deadlock checking are performed, and the detailed steps comprise:
6.1) initializing a set PS for recording any source receive operation matchesWIs empty;
6.2) matching to obtain the global blocking state ScMatching pair for next pair of non-arbitrary source operationsn
6.3) if match pairnIs not null, a message matching pair is performednAnd creates a new state Sc', wherein the new state Sc' corresponds to based on ScPerforming message matching pairnThe resulting state change, update Sc' middle matching pairnThe running state of the process containing the blocking communication action is active, and a new state S is setc' add to Worklist and return; otherwise, executing step 6.4);
6.4) for Global State ScMatching any source receiving operation, adding the matching result into the set PSW(ii) a If PS is setWIf not, based on global state ScAs a set PSWEach of the arbitrary source operations of (1) matching pairwCreating a corresponding new state Sc', wherein Sc' represents State ScPerforming message matching pairwThe migrated state adds a new state Sc' go to the state set to be explored Worklist and return; otherwise, executing step 6.5);
6.5) checking whether there are still un-terminated processes in the global blocking state, if so, reporting that deadlock is generated, otherwise, returning.
2. The deadlock check-oriented non-blocking MPI program symbol execution method according to claim 1, characterized in that in step 5) the to-be-executed statement Stat of symbol execution active process iiThe detailed steps comprise:
5.1) judging the Stat of the statement to be executediType of (1), if StatiStep 5.2) is executed for the non-blocking communication operation; if StatiSkipping to execute step 5.3) for the communication blocking operation; otherwise, skipping to execute the step 5.4);
5.2) by sequence SeqiRecording a communication operation sequence flowing out by a process i, wherein the recording method is to splice the newly flowing out communication operation at the tail of the previously flowing out operation sequence and keep the running state of the process i still active;
5.3) by sequence SeqiRecording a communication operation sequence flowing out by a process i, wherein the recording method is to splice the newly flowing out communication operation at the tail part of the previously flowing out operation sequence; updating the running state of the process i to be blocking;
5.4) executing the statement according to the traditional symbolic execution method, and keeping the running state of the process i still active.
3. The deadlock check-oriented non-blocking MPI program symbol execution method according to claim 1, characterized in that step 6.2) matches the global blocking state ScMatching pair for next pair of non-arbitrary source operationsnThe detailed steps comprise: judging the communication sequence Seq of each process iiIf yes, returning the Barrier synchronization operation Barrier as matching; otherwise, scanning the communication sequence Seq according to the ascending order of the process number iiFirst, the communication sequence Seq is judgediIf the waiting operation wait (r) exists in the sequence and the non-blocking communication operation corresponding to the handle r is finished, returning the blocking waiting operation wait (r) as a match if the non-blocking communication operation wait (r) is finished, otherwise, continuously judging the communication sequence SeqiWhether there is a message sending operation send (j) that can be matched and the communication sequence SeqjIf yes, returning a message sending operation send (j) and a message receiving operation recv (i) as matching; otherwise, an empty match is returned.
4. The deadlock check-oriented non-blocking MPI program symbol execution method according to claim 1, characterized in that the matching in step 6.4) obtains the global blocking state ScFor a given arbitrary source receiving operation, scanning communication sequences flowing out of all other processes to obtain sending operations which can be matched with the given arbitrary source receiving operation under the MPI semantic, and when the global blocking state S is adoptedcWhen there are multiple arbitrary source receive operations that can be matched, the symbol execution creates a state to be explored for each matching order between them.
5. A deadlock check-oriented non-blocking MPI program symbol execution system comprising a computer device, characterized in that the computer device is programmed or configured to execute the steps of the deadlock check-oriented non-blocking MPI program symbol execution method according to any one of claims 1 to 4.
6. A deadlock check-oriented non-blocking MPI program symbol execution system comprising a computer device, characterized in that a storage medium of the computer device has stored thereon a computer program programmed or configured to perform a deadlock check-oriented non-blocking MPI program symbol execution method according to any one of claims 1 to 4.
7. A computer-readable storage medium having stored thereon a computer program programmed or configured to perform the deadlock check oriented non-blocking MPI program symbol execution method of any one of claims 1 to 4.
8. A deadlock check-oriented non-blocking MPI program symbol execution system, comprising:
the input program unit is used for inputting an MPI program, the number N of running processes and a symbolic variable set Sym;
a state initialization program unit, configured to initialize a to-be-explored state set Worklist to a global initialization state init, where the global initialization state init is a combination of initial states of all processes;
a traversal state selection program unit used for selecting an unprocessed global state S from the state set Worklist to be explored according to a given search strategycTo explore;
a process scheduling program unit for selecting the state S to be explored according to the polling scheduling strategycThe state of the active process i comprises a variable mapping relation MiNext execution statement StatiProcess path condition PCiAnd process running state Fi
Statement symbol execution program unit for executing a program in a global state ScStatement to be executed Stat of Process iiExecuting the symbol and updating the symbolization state of the process;
the message matching and deadlock checking program unit is used for matching communication behaviors in a global blocking state, updating a set Worklist of a state to be explored and checking whether the exploration path is deadlocked or not;
statement symbol executive unit in global block state ScThe following detailed steps for message matching and deadlock checking include:
6.1) initializing a set PS for recording any source receive operation matchesWIs empty;
6.2) matching to obtain the global blocking state ScMatching pair for next pair of non-arbitrary source operationsn
6.3) if match pairnIs not null, a message matching pair is performednAnd creates a new state Sc', wherein the new state Sc' corresponds to based on ScPerforming message matching pairnThe resulting state change, update Sc' middle matching pairnThe running state of the process containing the blocking communication action is active, and a new state S is setc' add to Worklist and return; otherwise, executing step 6.4);
6.4) for Global State ScMatching any source receiving operation, adding the matching result into the set PSW(ii) a If PS is setWIf not, based on global state ScAs a set PSWEach of the arbitrary source operations of (1) matching pairwCreating a corresponding new state Sc', wherein Sc' represents State ScPerforming message matching pairwThe migrated state adds a new state Sc' go to the state set to be explored Worklist and return; otherwise, executing step 6.5);
6.5) checking whether there are still un-terminated processes in the global blocking state, if so, reporting that deadlock is generated, otherwise, returning.
CN201910838017.7A 2019-09-05 2019-09-05 Deadlock check-oriented non-blocking MPI program symbol execution method, system and medium Active CN110554925B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910838017.7A CN110554925B (en) 2019-09-05 2019-09-05 Deadlock check-oriented non-blocking MPI program symbol execution method, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910838017.7A CN110554925B (en) 2019-09-05 2019-09-05 Deadlock check-oriented non-blocking MPI program symbol execution method, system and medium

Publications (2)

Publication Number Publication Date
CN110554925A CN110554925A (en) 2019-12-10
CN110554925B true CN110554925B (en) 2022-02-08

Family

ID=68739208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910838017.7A Active CN110554925B (en) 2019-09-05 2019-09-05 Deadlock check-oriented non-blocking MPI program symbol execution method, system and medium

Country Status (1)

Country Link
CN (1) CN110554925B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115617533B (en) * 2022-12-14 2023-03-10 上海登临科技有限公司 Process switching management method in heterogeneous computing and computing device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8966453B1 (en) * 2010-11-24 2015-02-24 ECOLE POLYTECHNIQUE FéDéRALE DE LAUSANNE Automatic generation of program execution that reaches a given failure point
CN104536877A (en) * 2014-11-28 2015-04-22 江苏苏测软件检测技术有限公司 Mixed strategy based test data generation method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8966453B1 (en) * 2010-11-24 2015-02-24 ECOLE POLYTECHNIQUE FéDéRALE DE LAUSANNE Automatic generation of program execution that reaches a given failure point
CN104536877A (en) * 2014-11-28 2015-04-22 江苏苏测软件检测技术有限公司 Mixed strategy based test data generation method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Combining Symbolic Execution and Model Checking to Verify MPI Programs;Hengbiao Yu;《2018 ACM/IEEE 40th International Conference on Software Engineering:Companion Proceedings》;20180830;全文 *
Symbolic Verification of Regular Properties;Hengbiao Yu,Zhenbang Chen,Ji Wang,Zhendong Su,Wei Dong;《2018 ACM/IEEE 40th International Conference on Software Engineering》;20180903;全文 *
基于符号执行的MPI程序分析与验证技术研究;傅先进;《中国博士学位论文全文数据库》;20171215(第12期);正文第2-3章 *

Also Published As

Publication number Publication date
CN110554925A (en) 2019-12-10

Similar Documents

Publication Publication Date Title
CN109426723B (en) Detection method, system, equipment and storage medium using released memory
EP2420931B1 (en) Solving hybrid constraints to generate test cases for validating a software module
EP2407887B1 (en) Solving hybrid constraints to validate specification requirements of a software module
EP2420932B1 (en) Solving hybrid constraints to validate a security software module for detecting injection attacks
US8516443B2 (en) Context-sensitive analysis framework using value flows
EP2128769B1 (en) Method, apparatus, and system for automatic test generation from statecharts
Zheng et al. Z3str2: an efficient solver for strings, regular expressions, and length constraints
De Leoni et al. A holistic approach for soundness verification of decision-aware process models
Deligiannis et al. Asynchronous programming, analysis and testing with state machines
US8380483B2 (en) Inter-procedural dataflow analysis of parameterized concurrent software
Holzmann Explicit-state model checking
Lopez et al. Multiverse debugging: Non-deterministic debugging for non-deterministic programs
CN110554925B (en) Deadlock check-oriented non-blocking MPI program symbol execution method, system and medium
CN110543353B (en) MPI program verification method, system and medium combining symbolic execution and path model verification
US11934835B2 (en) Computer system and method for validation of parallelized computer programs
Křena et al. Automated formal analysis and verification: an overview
Weng et al. Argus: Debugging performance issues in modern desktop applications with annotated causal tracing
US20220335135A1 (en) Vulnerability analysis and reporting for embedded systems
US11321218B1 (en) Automated generation of source code models from machine code for code analysis
Derevenetc Robustness against relaxed memory models
Deniz et al. Verification and coverage of message passing multicore applications
US8572594B2 (en) Invasion analysis to identify open types
Torres Lopez et al. Multiverse Debugging: Non-deterministic Debugging for Non-deterministic Programs
Mohamed et al. A control flow representation for component-based software reliability analysis
Albert et al. A CLP heap solver for test case generation

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
GR01 Patent grant
GR01 Patent grant