CN102929780A - Method and device for debugging parallel programs based on application logical orders - Google Patents

Method and device for debugging parallel programs based on application logical orders Download PDF

Info

Publication number
CN102929780A
CN102929780A CN2012104419918A CN201210441991A CN102929780A CN 102929780 A CN102929780 A CN 102929780A CN 2012104419918 A CN2012104419918 A CN 2012104419918A CN 201210441991 A CN201210441991 A CN 201210441991A CN 102929780 A CN102929780 A CN 102929780A
Authority
CN
China
Prior art keywords
program
data
variable
logic
concurrent
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.)
Granted
Application number
CN2012104419918A
Other languages
Chinese (zh)
Other versions
CN102929780B (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.)
Wuxi Jiangnan Computing Technology Institute
Original Assignee
Wuxi Jiangnan Computing Technology Institute
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 Wuxi Jiangnan Computing Technology Institute filed Critical Wuxi Jiangnan Computing Technology Institute
Priority to CN201210441991.8A priority Critical patent/CN102929780B/en
Publication of CN102929780A publication Critical patent/CN102929780A/en
Application granted granted Critical
Publication of CN102929780B publication Critical patent/CN102929780B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a device for debugging parallel programs based on application logical orders. The method for debugging parallel programs includes defining data chains and abstractly describing semantic logics of complex parallel programs, wherein the data chains comprise application logical orders, logic fragment assembles and a correctness verification algorithm, and the application logical orders are iteration step orders or data flow orders; data of program variables during parallel program operation are tracked according to definitions of the data chains, and the data of the program variables are verified by the correctness verification algorithm and verification results are recorded; and the recorded verification results are reset when the parallel program stops operation or is exited abnormally. The method and the device are based on a reset debugging plan of parallel application system semantic logics, error locating of parallel programs is facilitated, and storage and analysis expenditures are saved.

Description

Concurrent program adjustment method and device based on the applied logic order
Technical field
The present invention relates to field of computer technology, particularly a kind of concurrent program adjustment method and device based on the applied logic order.
Background technology
Current parallel computation has become the important support in a lot of research and production field, become the sign of yield-power development level, but the carrier that parallel computation relies on, namely concurrent program but lacks effective software debugging aids, has had a strong impact on the raising of high-performance computer utilization factor and parallel computation level.Concurrent program is the main adjustment method that adopts serial program at present, be debugging breakpoints, depend on manual operations, efficient is low, requirement has suitable understanding to realization principle and the details of parallel back-up environment, because this adjustment method is the method that the computer programmer proposes at first.The application personnel of Non-computer Majors generally adopt the method that adds printing in program to debug, the defective of this adjustment method is the data that each parallel task can only be printed oneself, can't contact with the system support environmental facies, the result staggers the time when the discovery data, does not know its reason; And for large complicated concurrent program, analyzing the logic of makeing mistakes from the type information of a lot of parallel tasks is the great thing of job amount.
There is a kind of logic order theory (to please refer to K.Mani Chandy and Leslie Lamport.Distributedsnapshots:determining global states of distributed systems.ACM Trans.Comput.Syst., 3 (1): 63-75,1985.) be the implementation of determinacy reproduction concurrent program, dwindling the problem search space provides a kind of thinking.The computing machine personnel are according to this theory, determine the global logic order with the alternative events between the parallel task, but in actual applications, along with communication in the concurrent program and the increase of calculating ratio, program runtime, the quantity of information rapid growth of this logic order causes the track record of logic order, the expense of analyze resetting very large.In the situation of disappearance Program Semantics, this logic order is difficult to analytic induction, is difficult to support location of mistake simultaneously.
EntusTotalview and gnu gdb are more widely debugging acids of two application, except the method that adopts debugging breakpoints, also provide a kind of reverse adjustment method: with the mode executive routine of instruction-level single step, each bar instruction of track record program is to the modification of internal memory and register simultaneously, then can use the reverse implementation of method trace routine of debugging breakpoints, inverted order is recovered register and the internal storage location that each bar instruction is rewritten when reverse the execution.But this method also not necessarily is fit to concurrent program, and major defect is: 1. the parallel task of association is relatively more difficult on the reverse actuating logic; 2. instruction of every execution all suspends once, and program execution time prolongs greatly, if the logic of makeing mistakes is a long process of execution time, debugging so expense can be quite large; 3. still need to take for a long time concurrent computation resource, carry out the manual operations debugging.
Summary of the invention
The technical matters that technical solution of the present invention will solve is how effectively to verify the correctness of the semantic logic of concurrent program.
For solving the problems of the technologies described above, technical solution of the present invention provides a kind of concurrent program adjustment method based on the applied logic order, comprising:
The definition Data-Link x, and y, L, A}, wherein, x is chain number, and y is defined as the applied logic order, and L represents that application system is to the set of the logic behavior of physical quantity, L={L i| i=0,1 ..., n}, i are the natural sequence number that order appears in logic behavior, L i={ d j| j=0,1 ..., m-1}, L iProgram module is to the logic behavior of this physical quantity, d in the expression concurrent program jBe L iThe program variable that corresponding logic behavior relates to, j is the counting of program variable; N is the sum of logic behavior, and m is L iThe quantity of the program variable related with physical quantity in the corresponding logic behavior, A is the verification of correctness algorithm, described applied logic order is iteration step order or data stream order;
The data of described program variable when following the tracks of the operation of described concurrent program according to the definition of described Data-Link are with the data of the described program variable of described verification of correctness proof of algorithm and record the result;
At described concurrent program end of run or after unusually withdrawing from, the result of resetting and recording.
Optionally, described d j={ variable name, data type, length, source program name, line number }, described adjustment method also comprises: when the data that disclose described program variable at the result are invalid data, produce the program point of described invalid data by described source program name and line number location.
Optionally, the playback adjustment method of described concurrent program also comprises: the data of described program variable when recording described concurrent program operation; The data of the described program variable that playback is recorded.
Optionally, described physical quantity and chain are number corresponding one by one.
For solving the problems of the technologies described above, technical solution of the present invention also provides a kind of concurrent program adjustment method based on the applied logic order, comprising:
The definition Data-Link x, and y, L}, wherein, x is chain number, and y is defined as the applied logic order, and L represents that application system is to the set of the logic behavior of physical quantity, L={L i| i=0,1 ..., n}, i are the natural sequence number that order appears in logic behavior, L i={ d j| j=0,1 ..., m-1}, L iProgram module is to the logic behavior of this physical quantity, d in the expression concurrent program jBe L iThe program variable that corresponding logic behavior relates to, j is the counting of program variable; N is the sum of logic behavior, and m is L iThe quantity of the program variable related with physical quantity in the corresponding logic behavior, A is the verification of correctness algorithm, described applied logic order is iteration step order or data stream order;
The data of described program variable when following the tracks of and recording described concurrent program operation according to the definition of described Data-Link;
At described concurrent program end of run or after unusually withdrawing from, the data of the described program variable that playback is recorded.
Optionally, the playback adjustment method of described concurrent program also comprises: after the data of the described program variable that playback is recorded, by the data of the described program variable of verification of correctness proof of algorithm.
Optionally, described d j={ variable name, data type, length, source program name, line number }, described adjustment method also comprises: when the data that disclose described program variable at the result are invalid data, produce the program point of described invalid data by described source program name and line number location.
Optionally, described physical quantity and chain are number corresponding one by one.
Compared with prior art, technique scheme is take the natural order of iteration step or data stream as the logic order, can follow the tracks of real physical with the computation process of simulated time take iteration step as order, can the tracing mode program work in coordination with parallel implementation status take data stream as order, thereby analyze the interaction between the associative mode program.This playback debugging scheme based on application, because application is the most macroscopical aspect of the superiors in the parallel computation, than the existing process of bottom or the logic order information that needs alternately the record flood tide between the thread of being mapped to, logic order information greatly reduces, thus the expense of having saved storage and having analyzed.
Further, because application is the most macroscopical aspect of the superiors in the parallel computation, determining and analyzing of logic order is open, can be in conjunction with Program Semantics and application background definition Data-Link, and according to the logic order information analysis logic order that traces into, therefore be conducive to the location of mistake of program.
Description of drawings
Fig. 1 is the sequential synoptic diagram between regional each module of meteorological system model;
Fig. 2 is the schematic flow sheet of concurrent program;
Fig. 3 is an embodiment schematic flow sheet that the present invention is based on the concurrent program adjustment method of applied logic order;
Fig. 4 is the application example synoptic diagram of concurrent program adjustment method shown in Figure 3;
Fig. 5 is an embodiment schematic flow sheet of playback debugging apparatus that the present invention is based on the concurrent program of applied logic order;
Fig. 6 is another embodiment schematic flow sheet of playback adjustment method that the present invention is based on the concurrent program of applied logic order;
Fig. 7 is the application example synoptic diagram of concurrent program adjustment method shown in Figure 6;
Fig. 8 is another embodiment schematic flow sheet that the present invention is based on the concurrent program debugging apparatus of applied logic order.
Embodiment
Because concurrent program is semantic complicated, the logic that not only comprises task itself, also comprise between the task of executed in parallel even the interaction logic between a plurality of concurrent program, two kinds of logic weave ins, program may continue to carry out a period of time after causing a kind of logical mistake, seem incoherent at one and quote in logic mistake, even run to end, but result of calculation is incorrect.So the correctness of checking concurrent program must be in conjunction with two kinds of logic behaviors of program.
Technical thought of the present invention is based on a kind of abstract model of describing two kinds of logics of concurrent program, set up the related of application system physical quantity and concurrent program variable, in conjunction with the application semantics correct value of proving program variable in an organized way, and then the semantic logic of checking concurrent program.Can not be difficult to like this semanteme in conjunction with application system merely from the computer programming theory to the abstract of concurrent program, and in the alternative events of the parallel back-up environment aspect of computing machine the logic order quantity of information of flood tide be arranged, be unfavorable for storage and analyze.On the other hand, current compiler runs into many double linear problems of difficulty for solvings to the research that the concurrent program semanteme carries out static analysis, can't describe exactly the whole semantic of concurrent program; Existing playback debugging and reverse adjustment method expense are large, the disappearance Program Semantics, and all there is limitation in all these methods, are difficult to the complicated concurrent program of using system is carried out error analysis and location.
The inventor analyzes the existing programming model of using problem, with a typical problem in the earth science research-regional meteorological system model (CCSM, Community Climate System Model) be example, please refer to Fig. 1, learn module (ocean by 4 parallel ground, atmosphere, the road surface, the glacier) on 4 groups of disjoint processor collection, each iteration step (an iteration/circulation) is by a coupling mechanism program exchange data boundary, ocean current for example, the physical quantitys such as air quantity, coupling mechanism is used for data boundary is remapped on the different processor collection, Fig. 1 has exemplarily described one section sequential chart between each module, the exchanges data between the arrow representation module longitudinally wherein, if programming is correct, the correlativity that causes of exchanges data will make the calculating in per step on each processor collection keep harmonious so.This multiple program multiple data (MPMD, Multiple Program Multiple Data) parallel mode is a kind of trend of present Parallel application exploitation, so that each field branch can develop relatively independently.
From the angle of multiple programming, much use problem and can abstractly be such procedural model: repeatedly iteration (circulation is carried out) of one section program is arranged, as shown in Figure 2 on the time shaft; Be mutual that two levels are arranged on the spatial axes, high level mainly is to exchange data boundary between different model program (learn module), and bottom is in independently synchronous communication between the process, carries out synchronous communication between same in-process shared thread.Certainly the iterative process of practical programs is very complicated, and along with the variation of parallel scale, mutual topological structure can change.
In the playback of the logic-based order of existing experiment, the quantity of information of logic order and the information content break away from Program Semantics to user transparent, are supported the track record of logic order by the debugging version in parallel storehouse.For example support the message passing interface (MPI of playback, Message Passing Interface) storehouse debugging version, the information receiving and transmitting event order of inside, track record storehouse when program is moved, but the user is unfamiliar with MPI to realize, also can not be from the inner correctness that realizes the analytical applications problem of MPI.
Based on above-mentioned analysis, the inventor has proposed a kind of playback debugging scheme based on the applied logic order, wherein, the logic order refers to the relative order between the parallel task (concurrent program), the applied logic order is based on the logic order of application layer, order (data stream order) according to the data exchange process of the order (iteration step order) of iteration step or application is followed the tracks of concurrent program and is recorded logic order information, here the applied logic order that proposes: take the natural order of iteration step or data stream as the logic order, can follow the tracks of real physical with the computation process of simulated time take iteration step as order, can the tracing mode program work in coordination with parallel implementation status take data stream as order, thereby analyze the interaction between the associative mode program.This playback debugging scheme based on application, because application is the most macroscopical aspect of the superiors in the parallel computation, with respect to the existing process of bottom or the logic order information that needs alternately the record flood tide between the thread, the expense of having saved storage and having analyzed of being mapped to.Below in conjunction with embodiment technical solution of the present invention is elaborated.
The concurrent program adjustment method based on the applied logic order of present embodiment as shown in Figure 3, at first execution in step S11 defines Data-Link { x, y, L, A}.
The semantic logic of the complicated concurrent program of described Data-Link abstractdesription, wherein, x is chain number, and y is defined as the applied logic order, and L represents application system to the set of the logic behavior of a certain physical quantity, and L is also referred to as logic section set, i.e. L={L i| i=0,1 ..., n}, i are the natural sequence number that order appears in logic behavior; L iBe logic section, program module is to the logic behavior of this physical quantity, i.e. L in the expression concurrent program i={ d j| j=0,1 ..., m-1}, d jBe L iThe program variable that corresponding logic behavior is specifically related to, j is the counting of program variable, d jUnordered; N is the sequence number of last logic behavior, i.e. the sum of logic behavior, and m is L iThe quantity of (related with physical quantity) program variable in the corresponding logic behavior.A is the verification of correctness algorithm, and simple verification of correctness algorithm can be the Rule of judgment to a variable, and complicated verification of correctness algorithm can be another independently program, to one group of d jProcess, export a data visualized graphs.Described applied logic order is iteration step order or data stream order; Many Data-Links of a concurrent program definable, MPMD concurrent program definable is crossed over the Data-Link of a plurality of programs.
During practical application, please in conjunction with reference to figure 4, at first need to determine the logic order: can provide a debugging interface of showing source code for the user, the user selects to describe the program variable of physical quantity by debugging interface definition Data-Link, and determines which kind of applied logic order.For the ease of resetting and verification of correctness, Data-Link of a physical quantity definition has a well-determined chain number, so physical quantity and chain number are corresponding one by one.Article one, Data-Link is divided into some logic sections, i.e. L={L i| i=0,1 ..., n}, L i={ d j| j=0,1 ..., m-1}, L iThe logic section of corresponding program block, d jCorresponding program variable, d j={ variable name, data type, length, source program name, line number }.
For example: take CCSM model shown in Figure 1 as example, the module of each independent operating has physical quantity set separately, need between them to carry out data boundary exchange by coupling mechanism: the information such as temperature, air pressure, wind, albedowave, water vapour, coupling mechanism are finished the physical quantity data transformation between the two-dimentional lattice point net of two kinds of modules.For convenient exchange, module has been arranged a kind of data object bundle when program design, can store (vector) array data of various parallel processings, it contains the name variable of a string representation array, with a pointed data content, the bundle object has also defined the method for merging, decomposition, Diagnosis vector data.We find that swap data has the cycle separately between each module, and for example one week or one day of simulated time, and each iteration exchanges a collection of identical physical quantity, and this has brought convenience for debugging software design.The Data-Link of a thermoflux (heat flux) exchange between definition atmosphere and the ocean be 1, the data stream order, L, A},
Design a debugging interface, wherein show the modular structure of source code or visualization formulation program, to the program block numbering, the numbering that user selection is relevant with physical quantity, the logic behavior of define program piece, i.e. the variables collection of program block effect:
L={L 0, L 1, L 2, L 3, L 0For atmosphere (atm) is finished the data boundary of step during analog computation, L 1For coupling mechanism (cpl) receives atmospheric boundary data, L 2For coupling mechanism is finished conversion, L 3For ocean (ocn) receives the atmospheric boundary data,
L 0={a2c_lwdn,a2c_rainc,a2c_rainl,a2c_snowc,a2c_snowl,a2c_swndr,a2c_swvdr,a2c_swndf,a2c_swvdf,a2c_swnet},
L 1={Con_Xa2c%bundle},
L 2={Con_Xc2o%bundle},
L 3={c2o_ifrac,c2o_press,c2o_duu10,c2o_taux,c2o_tauy,c2o_swnet,c2o_lat,c2o_sen,c2o_lwup,c2o_lwdn,c2o_melth,c2o_salt,c2o_prec,c2o_snow,c2o_rain,c2o_evap,c2o_meltw,c2o_roff}。
Verification of correctness algorithm A can realize according to practical significance and the program input of physical quantity, for example, calculates the variable d of each parallel task jMean square deviation see whether satisfy accuracy requirement, perhaps pass through d jWhether the physical quantity that calculates in effective range, perhaps outputs to another function in the program, carries out Calculation Verification according to algorithm.Debugging software need to be collected data from the independent address space of parallel task, carries out verification of correctness again.
In fact, Data-Link is the abstract model of the semantic logic of concurrent program, each bar data chained list shows that the user of a physical quantity thinks the logic of special checking, and some Data-Links have just consisted of the logic that the user wants to verify the whole concurrent program of its correctness.The iteration step order represents the semantic logic of task self, and the data stream order represents the semantic logic between the task of executed in parallel, only writes the user who transplants concurrent program at present and could clearly describe this model, and compiler can't accurately be analyzed out.The application model that this Data-Link representative has been arranged just can be theoretical in conjunction with the programming model of computing machine, the correctness of further proving program, L iDescription set up some variablees of a program block and contacting of physical quantity, based on L iAnd A, just can develop software these variablees are carried out local preanalysis, because one independently program variable legal value is arranged hardly, at present substantially there is not the software debugging method to set up such model, they emphasize the transparent adjustment method to the application system mostly, and they analyze the event relation of the bottom.It is abstract to the present invention is based on Data-Link, program variable by the physical significance combination the superiors, then theoretical in conjunction with the multiple programming of the bottom, the exploitation debugging acid is collected the data of this group variable from the task space of executed in parallel, this collects the process of data the tracking of Data-Link according to the Data-Link definition.Based on trace information, be combined with the verification algorithm A of physical significance, the logic of verification msg chain, and with the process of trace information and the result playback reset (replay).The realization of debugging acid is relevant with parallel programming model, has the parallel task of independent address space, for each program variable, need to collect and integrate from different address spaces with identical virtual address; For the parallel task in shared address space, then obtain from the main task space, therefore to develop the plug-in unit of collecting data, be integrated in these two kinds of programming libraries.
Please continue with reference to figure 3, then execution in step S12, the data of described program variable when following the tracks of described concurrent program operation according to the definition of described Data-Link are with the data of the described program variable of described verification of correctness proof of algorithm and record the result.
During actual enforcement, please in conjunction with reference to figure 4, for realization is followed the tracks of, debugging software will insert the trace_init function call in the principal function porch of concurrent program automatically, at L iInsert function call trace (x, y, the L of track record behind the corresponding program point (source program name and line number) i, A), during the substitution function, L iIn fact numbering is (such as L 0, L 1, L 2Or L 3), A is a function address, is exactly address blank if there is not verification condition, recompilates linker and generates the debugging version.After producing executable program, analyze the Debugging message such as data type of a variable, address, length, be placed among the Debugging message file F of agreement, Debugging message file F can be stored in the logic order information bank.
Trace_init () is carried out first in the program operation, from file F, read in the variable Debugging message, obtain address, length and the type of program variable dj, in program process, carry out the trace function, described program variable d during the described concurrent program operation of Collection and conservation jData, with verification of correctness algorithm A checking L iLogic, and the record the result.The result can comprise: program variable d jThe data value whether effective, if program variable d jData can be by verification of correctness algorithm A checking, then be valid data, otherwise be invalid data; The result can also comprise and utilizes verification of correctness algorithm A to program variable d jThe result of calculation that calculates of data.The result can be recorded in the logic order information bank, and wherein, logic order information comprises the result.
Further, can not need the each time logical message of iteration of whole logging programs, because all the space expense of record is too large, the user can arrange a threshold value, for example 50, the follow-up mechanism of debugging software will cover the logical message of front automatically like this, only keep logic order information and the result in nearest 50 steps in information bank.
The physical quantity that has can be by verification of correctness algorithm while analysis verification in tracing process, and the physical quantity that has can only be at the relevant Data-Link of playback time multianalysis, whether effectively correctly could verify, therefore in this case, when execution in step S12, the data of described program variable when also recording described concurrent program operation, namely when tracing into the operation of described concurrent program after the data of described program variable, also the data with the program variable that traces into are recorded in the logic order information bank, and logic order information can also comprise the data of the program variable that traces into.
Please continue with reference to figure 3, follow execution in step S13, at described concurrent program end of run or after unusually withdrawing from, the result of resetting and recording.
Specifically, at described concurrent program end of run or after unusually withdrawing from, requirement according to the user, read the logic order information of specifying iteration step from logic order information bank, the result of each section of display data chain logic and corresponding variant content are in order to full out find out iteration step and the program block of logic error.For example show first the Data-Link of the final step (such as the 50th step) of record, find L 0The result logic error is arranged, so the Data-Link logics in reverse displaying the 49th step, 48 steps.
At playback time, can select to show certain or certain iteration step several times wherein, also can select to show wherein certain or a few data segments, or certain or certain several program variables.In addition, if step S12 has recorded the data of program variable simultaneously, step S13 data of the program variable that records of also resetting then.
Further, please refer to Fig. 4, the concurrent program adjustment method of present embodiment can also comprise: location of mistake, when the data that namely disclose described program variable at the result are invalid data (the data value of program variable is invalid in other words), the program point that produces described invalid data by source program name corresponding to described program variable and line number location.For example: finding at last is the 35th step L 2Producing first logic error, is d wherein jData content wrong, then produce L in the 36th step 0Logic wrong because program variable is defined as d j={ variable name, data type, length, source program name, line number } therefore can be according to invalid program variable d jCorresponding source program name and line number navigate to wrong program statement, and the user just can locate the 35th step L soon like this 2The program block at place, thereby a large and complicated logical problem is navigated to concrete fritter program and specific simulated time section, with respect to existing those debugging acids, the user may need each task executive routine code line by line, and our this adjustment method can significantly improve the success ratio of concurrent program debugging.Further debugging can be converted into the 35th and walk out of wrong variable d jRelevant with what data, whether the calculating of these data is correct.Also may the user in conjunction with the specific implementation of program block and relevant speciality data, input data, just can infer the problem reason.Update routine code or adjustment input data, again regression test.The process of resetting is actual be the user with reference to the result, determine invalid data and the process of carrying out location of mistake.
Corresponding concurrent program adjustment method shown in Figure 3, present embodiment based on the concurrent program debugging apparatus of applied logic order as shown in Figure 5, comprising: determining unit A11 is used for defining Data-Link { x, y, L, A}; Follow the tracks of and checking record cell A12, the data of described program variable when being used for following the tracks of described concurrent program operation according to the described Data-Link of described determining unit A11 definition are with the data of the described program variable of described verification of correctness proof of algorithm of described determining unit A11 definition and record the result; Playback unit A13 is used at described concurrent program end of run or after unusually withdrawing from, the result that reset described tracking and checking record cell A12 record.
Optionally, described concurrent program debugging apparatus also comprises: positioning unit and data record unit (not shown), when described positioning unit is used for data that the result in described tracking and checking recording unit records discloses described program variable and is invalid data, the program point that produces described invalid data by source program name corresponding to described program variable and line number location; The data of described program variable when described data record unit is used for recording the described concurrent program operation that described tracking and checking record cell trace into; Described playback unit also be used for the resetting data of the described program variable that described data record unit records.
The implementation of described concurrent program debugging apparatus can in conjunction with the explanation with reference to the concurrent program adjustment method of above-mentioned present embodiment, not repeat them here.
Fig. 6 is the concurrent program adjustment method based on the applied logic order of another embodiment, compares with embodiment shown in Figure 3, and the key distinction is that present embodiment is not carried out verification of correctness in tracing process, the data of a logging program variable, and reset.
Particularly, execution in step S21 at first, the definition Data-Link x, and y, L}, wherein, x is chain number, y is defined as the applied logic order,, L represents that application system is to the set of the logic behavior of physical quantity, L={L i| i=0,1 ..., n}, i are the natural sequence number that order appears in logic behavior, L i={ d j| j=0,1 ..., m-1}, L iProgram module is to the logic behavior of this physical quantity, d in the expression concurrent program jBe L iThe program variable that corresponding logic behavior relates to, j is the counting of program variable, d jUnordered; N is the sum of logic behavior, and m is L iThe quantity of the program variable related with physical quantity in the corresponding logic behavior, A is the verification of correctness algorithm, described applied logic order is iteration step order or data stream order.The difference of step S21 and step S11 is, does not define the verification of correctness algorithm in the definition of Data-Link.
Follow execution in step S22, the data of described program variable when following the tracks of and recording described concurrent program operation according to the definition of described Data-Link.During actual enforcement, insert the trace_init function call in the principal function porch of concurrent program, at L iInsert function call trace (x, y, the L of track record behind the corresponding program point (source program name and line number) i), recompilate connection.In program process, carry out the trace function, the data of described program variable dj and being recorded in the logic order information bank when following the tracks of described concurrent program operation, wherein, logic order information comprises the data of the program variable that traces into.The difference of step S22 and step S12 is, in the program operation process, only records the data of the program variable that traces into, and does not carry out verification of correctness.
Follow execution in step S23, at described concurrent program end of run or after unusually withdrawing from, the data of the described program variable that playback is recorded.The difference of step S23 and step S13 is, the data of the program variable of playback of recorded in logic order information bank.
Further, please refer to Fig. 7, the concurrent program adjustment method of present embodiment can also comprise: analysis logic order, data verification and location of mistake.Specifically, after the data of described program variable of resetting, can be to these data analysis, to carry out location of mistake; The user can be by data verification plug-in unit input verification of correctness algorithm, whether the value of the data by the described program variable of verification of correctness proof of algorithm is effective, disclose the data value of described program variable when invalid at the result, carry out location of mistake by source program name and line number that program variable is corresponding; In addition, also can binding analysis logic order and data verification carry out location of mistake.
Corresponding concurrent program adjustment method shown in Figure 6, present embodiment based on the concurrent program debugging apparatus of applied logic order as shown in Figure 8, comprising: determining unit A21 is used for defining Data-Link; Follow the tracks of and data record unit A22 the data of described program variable when described concurrent program operation is followed the tracks of and recorded to the Data-Link that is used for defining according to described determining unit A21; Playback unit A23 is used at described concurrent program end of run or after unusually withdrawing from the data of the described program variable that reset described tracking and data record unit A22 record.
Optionally, the concurrent program debugging apparatus of present embodiment also comprises: authentication unit and positioning unit, described authentication unit is used for after the data of the described program variable that described playback unit playback is recorded, by the data of the described program variable of verification of correctness proof of algorithm; When described positioning unit is used for data that the result at described authentication unit discloses described program variable and is invalid data, the program point that produces described invalid data by source program name corresponding to described program variable and line number location.
The implementation of described concurrent program debugging apparatus can in conjunction with the explanation with reference to the concurrent program adjustment method of above-mentioned present embodiment, not repeat them here.
It will be appreciated by those skilled in the art that, the all or part of of above-described embodiment is to come the relevant hardware of instruction to finish by program (for example debugged program), described program can be stored in the computer-readable recording medium, and described storage medium can be ROM, RAM, magnetic disc, CD etc.
In sum, technical solution of the present invention has following advantage:
Designed a kind of abstract model that complicated applications problem semanteme is carried out verification of correctness, a kind of concurrent program debugging scheme in conjunction with Program Semantics logic and multiple programming theory is provided, this scheme is decomposed a large verification of correctness problem by the definition Data-Link, make parallel debugging avoid the complicated calculations flow process of using problem self, for the application personnel have shielded the details of computing machine multiple programming, directly the data related with the concurrent program behavior and the location of mistake of robotization are provided for the field personnel.
Determining and analyzing of logic order is open, can be in conjunction with Program Semantics and application background definition Data-Link, and according to the logic of the logic order information analysis concurrent program that traces into, so be conducive to the location of mistake of concurrent program.
The tracking of logic order information and the realization of playback can be independent of each other, also with the version independent in the parallel storehouse of bottom, do not need the hardware support of adding, and be therefore portable good.
The logic order information of trace analysis is convenient to the behavior of user's prehension program all for application, has got rid of the logic order information of computing machine multiple programming aspect, thus the expense of having saved storage and having analyzed.
The user can program is made mistakes carry out initial analysis after, select part physical quantity definition Data-Link, improve the specific aim that location of mistake and problem are searched; Can define from coarse to fine the hop count of Data-Link according to the principle of binary search, progressively follow the trail of the root of makeing mistakes, improve location of mistake.
Can be chosen in the minimum position definition trace routine variable of program impact, reduce thus debugging to the interference of concurrent program actual motion.
Although the present invention with preferred embodiment openly as above; but it is not to limit the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can utilize method and the technology contents of above-mentioned announcement that technical solution of the present invention is made possible change and modification; therefore; every content that does not break away from technical solution of the present invention; to any simple modification, equivalent variations and modification that above embodiment does, all belong to the protection domain of technical solution of the present invention according to technical spirit of the present invention.

Claims (14)

1. the concurrent program adjustment method based on the applied logic order is characterized in that, comprising:
The definition Data-Link x, and y, L, A}, wherein, x is chain number, and y is defined as the applied logic order, and L represents that application system is to the set of the logic behavior of physical quantity, L={L i| i=0,1 ..., n}, i are the natural sequence number that order appears in logic behavior, L i={ d j| j=0,1 ..., m-1}, L iProgram module is to the logic behavior of this physical quantity, d in the expression concurrent program jBe L iThe program variable that corresponding logic behavior relates to, j is the counting of program variable; N is the sum of logic behavior, and m is L iThe quantity of the program variable related with physical quantity in the corresponding logic behavior, A is the verification of correctness algorithm, described applied logic order is iteration step order or data stream order;
The data of described program variable when following the tracks of the operation of described concurrent program according to the definition of described Data-Link are with the data of the described program variable of described verification of correctness proof of algorithm and record the result;
At described concurrent program end of run or after unusually withdrawing from, the result of resetting and recording.
2. concurrent program adjustment method as claimed in claim 1 is characterized in that, described d j={ variable name, data type, length, source program name, line number }, described adjustment method also comprises: when the data that disclose described program variable at the result are invalid data, produce the program point of described invalid data by described source program name and line number location.
3. concurrent program adjustment method as claimed in claim 1 is characterized in that, also comprises: the data of described program variable when recording described concurrent program operation; The data of the described program variable that playback is recorded.
4. concurrent program adjustment method as claimed in claim 1 is characterized in that, described physical quantity and chain are number corresponding one by one.
5. the concurrent program adjustment method based on the applied logic order is characterized in that, comprising:
The definition Data-Link x, and y, L}, wherein, x is chain number, and y is defined as the applied logic order, and L represents that application system is to the set of the logic behavior of physical quantity, L={L i| i=0,1 ..., n}, i are the natural sequence number that order appears in logic behavior, L i={ d j| j=0,1 ..., m-1}, L iProgram module is to the logic behavior of this physical quantity, d in the expression concurrent program jBe L iThe program variable that corresponding logic behavior relates to, j is the counting of program variable; N is the sum of logic behavior, and m is L iThe quantity of the program variable related with physical quantity in the corresponding logic behavior, A is the verification of correctness algorithm, described applied logic order is iteration step order or data stream order;
The data of described program variable when following the tracks of and recording described concurrent program operation according to the definition of described Data-Link;
At described concurrent program end of run or after unusually withdrawing from, the data of the described program variable that playback is recorded.
6. concurrent program adjustment method as claimed in claim 5 is characterized in that, also comprises: after the data of the described program variable that playback is recorded, by the data of the described program variable of verification of correctness proof of algorithm.
7. concurrent program adjustment method as claimed in claim 6 is characterized in that, described d j={ variable name, data type, length, source program name, line number }, described adjustment method also comprises: when the data that disclose described program variable at the result are invalid data, produce the program point of described invalid data by described source program name and line number location.
8. concurrent program adjustment method as claimed in claim 5 is characterized in that, described physical quantity and chain are number corresponding one by one.
9. the concurrent program debugging apparatus based on the applied logic order is characterized in that, comprising:
Determining unit, be used for defining Data-Link x, y, L, A}, wherein, x is chain number, y is defined as the applied logic order, L represents that application system is to the set of the logic behavior of physical quantity, L={L i| i=0,1 ..., n}, i are the natural sequence number that order appears in logic behavior, L i= {Dj|j=0,1 ..., m-1}, L iProgram module is to the logic behavior of this physical quantity, d in the expression concurrent program jBe L iThe program variable that corresponding logic behavior relates to, j is the counting of program variable; N is the sum of logic behavior, and m is L iThe quantity of the program variable related with physical quantity in the corresponding logic behavior, A is the verification of correctness algorithm, described applied logic order is iteration step order or data stream order;
Follow the tracks of and the checking record cell, the data of described program variable when being used for following the tracks of described concurrent program operation according to the definition of described Data-Link are with the data of the described program variable of described verification of correctness proof of algorithm and record the result;
Playback unit is used at described concurrent program end of run or after unusually withdrawing from, the result of resetting and recording.
10. concurrent program debugging apparatus as claimed in claim 9 is characterized in that, described d j={ variable name, data type, length, the source program name, line number }, described playback debugging apparatus also comprises: positioning unit, when being invalid data for the data that disclose described program variable at the result, produce the program point of described invalid data by described source program name and line number location.
11. concurrent program debugging apparatus as claimed in claim 9 is characterized in that, also comprises: data record unit, the data of described program variable when being used for recording described concurrent program operation; The data of the described program variable that described playback unit also records for resetting.
12. the concurrent program debugging apparatus based on the applied logic order is characterized in that, comprising:
Determining unit, be used for defining Data-Link x, y, L}, wherein, x is chain number, y is defined as the applied logic order, L represents that application system is to the set of the logic behavior of physical quantity, L={L i| i=0,1 ..., n}, i are the natural sequence number that order appears in logic behavior, L i={ d j| j=0,1 ..., m-1}, L iProgram module is to the logic behavior of this physical quantity, d in the expression concurrent program jBe L iThe program variable that corresponding logic behavior relates to, j is the counting of program variable; N is the sum of logic behavior, and m is L iThe quantity of the program variable related with physical quantity in the corresponding logic behavior, A is the verification of correctness algorithm, described applied logic order is iteration step order or data stream order;
Follow the tracks of and data record unit the data of described program variable when being used for following the tracks of and record described concurrent program operation according to the definition of described Data-Link;
Playback unit is used at described concurrent program end of run or after unusually withdrawing from, the data of the described program variable that playback is recorded.
13. concurrent program debugging apparatus as claimed in claim 12 is characterized in that, also comprises: authentication unit is used for after the data of the described program variable that playback is recorded, by the data of the described program variable of verification of correctness proof of algorithm.
14. concurrent program debugging apparatus as claimed in claim 13 is characterized in that, described d j={ variable name, data type, length, the source program name, line number }, described playback debugging apparatus also comprises: positioning unit, when being invalid data for the data that disclose described program variable at the result, produce the program point of described invalid data by described source program name and line number location.
CN201210441991.8A 2012-11-06 2012-11-06 Based on the Parallel Program Debugging method and apparatus of applied logic sequence Active CN102929780B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210441991.8A CN102929780B (en) 2012-11-06 2012-11-06 Based on the Parallel Program Debugging method and apparatus of applied logic sequence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210441991.8A CN102929780B (en) 2012-11-06 2012-11-06 Based on the Parallel Program Debugging method and apparatus of applied logic sequence

Publications (2)

Publication Number Publication Date
CN102929780A true CN102929780A (en) 2013-02-13
CN102929780B CN102929780B (en) 2015-11-18

Family

ID=47644584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210441991.8A Active CN102929780B (en) 2012-11-06 2012-11-06 Based on the Parallel Program Debugging method and apparatus of applied logic sequence

Country Status (1)

Country Link
CN (1) CN102929780B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491388A (en) * 2017-07-28 2017-12-19 深圳市元征科技股份有限公司 Bug method and device in a kind of positioning program code
CN110892384A (en) * 2017-07-10 2020-03-17 微软技术许可有限责任公司 Replay time run tracking that is dependent on processor undefined behavior
CN110998541A (en) * 2017-08-03 2020-04-10 微软技术许可有限责任公司 Tentative execution of code in a debugger
CN111868694A (en) * 2018-03-15 2020-10-30 微软技术许可有限责任公司 Protecting sensitive information in time travel trace debugging

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588323A (en) * 2004-09-23 2005-03-02 上海交通大学 Parallel program visuable debugging method
US20070094541A1 (en) * 2005-10-25 2007-04-26 Hua Kang Method and apparatus for generating test execution sequences automatically for a software testing process

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588323A (en) * 2004-09-23 2005-03-02 上海交通大学 Parallel program visuable debugging method
US20070094541A1 (en) * 2005-10-25 2007-04-26 Hua Kang Method and apparatus for generating test execution sequences automatically for a software testing process

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
彭超 等: "一种并行程序性能工具的研究与实现", 《微计算机信息》 *
王敬宇: "并行调试的可扩展性研究", 《计算机工程与科学》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110892384A (en) * 2017-07-10 2020-03-17 微软技术许可有限责任公司 Replay time run tracking that is dependent on processor undefined behavior
CN110892384B (en) * 2017-07-10 2023-11-24 微软技术许可有限责任公司 Playback time-travel tracking for undefined behavior dependencies of a processor
CN107491388A (en) * 2017-07-28 2017-12-19 深圳市元征科技股份有限公司 Bug method and device in a kind of positioning program code
CN110998541A (en) * 2017-08-03 2020-04-10 微软技术许可有限责任公司 Tentative execution of code in a debugger
CN110998541B (en) * 2017-08-03 2023-11-17 微软技术许可有限责任公司 Tentative execution of code in debugger
CN111868694A (en) * 2018-03-15 2020-10-30 微软技术许可有限责任公司 Protecting sensitive information in time travel trace debugging

Also Published As

Publication number Publication date
CN102929780B (en) 2015-11-18

Similar Documents

Publication Publication Date Title
US9323652B2 (en) Iterative bottleneck detector for executing applications
CN107111544A (en) History controlling stream visualization in production diagnosis
GB2617003A (en) Proactive anomaly detection
CN102929780B (en) Based on the Parallel Program Debugging method and apparatus of applied logic sequence
CN102567200A (en) Parallelization security hole detecting method based on function call graph
Chen et al. Mc-checker: Detecting memory consistency errors in mpi one-sided applications
JP6342129B2 (en) Source code error position detection apparatus and method for mixed mode program
CN108885579B (en) Method and apparatus for data mining from kernel tracing
Li et al. SmartInjector: Exploiting intelligent fault injection for SDC rate analysis
CN103714000A (en) Sensitive area-oriented embedded software test case generating method
CN105468517A (en) Statistical error positioning method based on reduction of black-box test case
Li et al. Fine-grained characterization of faults causing long latency crashes in programs
CN105005072A (en) PML boundary three-dimensional seismic wave propagation simulation method utilizing CUDA
US20080184150A1 (en) Electronic circuit design analysis tool for multi-processor environments
Janjusic et al. Gleipnir: A memory profiling and tracing tool
O'neal et al. GPU performance estimation using software rasterization and machine learning
Wang et al. Toward Ultrahigh-Resolution E3SM Land Modeling on Exascale Computers
CN110457208B (en) Symbol execution guiding method, device, equipment and computer readable storage medium
Xiong et al. SZTS: A novel big data transportation system benchmark suite
CN102521011B (en) Simulator generation method and simulator generation device
CN111581306B (en) Driving track simulation method and device
Liu et al. Parallelization of a distributed ecohydrological model
Zhao et al. Host-compiled reliability modeling for fast estimation of architectural vulnerabilities
Wolf et al. Automatic analysis of inefficiency patterns in parallel applications
Lakner et al. IBM System Blue Gene Solution: Performance Analysis Tools

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant