CN101452379A - Internal memory space analyzing method and device and check point reserving method and device - Google Patents

Internal memory space analyzing method and device and check point reserving method and device Download PDF

Info

Publication number
CN101452379A
CN101452379A CNA2007100943301A CN200710094330A CN101452379A CN 101452379 A CN101452379 A CN 101452379A CN A2007100943301 A CNA2007100943301 A CN A2007100943301A CN 200710094330 A CN200710094330 A CN 200710094330A CN 101452379 A CN101452379 A CN 101452379A
Authority
CN
China
Prior art keywords
memory headroom
need
keeps
checkpoint
attribute
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
CNA2007100943301A
Other languages
Chinese (zh)
Other versions
CN101452379B (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 CN 200710094330 priority Critical patent/CN101452379B/en
Publication of CN101452379A publication Critical patent/CN101452379A/en
Application granted granted Critical
Publication of CN101452379B publication Critical patent/CN101452379B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a device for analyzing memory space, and a method and a device for maintaining a check point. The method for analyzing the memory space comprises the following steps: setting a potential check point indicating the analysis of the memory space in a program; analyzing whether the memory space which does not need maintaining exists within the action range of the potential check point; and identifying the scope of the attribute which does not need maintaining in the memory space if the memory space which does not need maintaining exists. The method for analyzing the memory space and the method for maintaining the check point can reduce the maintaining amount of a transparent check point and shorten the maintaining recovery time.

Description

The reservation method of the analytical approach of memory headroom and device, checkpoint and device
Technical field
The present invention relates to computer system, particularly relate to the reservation method and the device of a kind of analytical approach of memory headroom and device, checkpoint.
Background technology
The research and the application of many science aspect usually need a large amount of and complex calculations, and the high-effect parallel computer of multiprocessor is one of best selection naturally.It is basic demand to computing that program is carried out correctly and smoothly, but in this time-consuming calculating process, system broke down when the greateset risk that faces was carried out exactly, especially under the increasing situation of present system scale, the fault odds also increases thereupon, when fault takes place, no matter be the system failure or some irresistible reason, cause the computing achievement before must abandoning.Therefore in parallel environment, must have that some failure handling mechanisms is carried out fault-avoidance, fault removes or fault shifts, just can avoid causing unnecessary the repeating and the wasting of resources of program, improve the reliability of parallel computation.The checkpoint technology is exactly a kind of effective fault-tolerant technique that is widely adopted.
The checkpoint technology is in the operational process of program retention point to be set, the process status in this moment is kept, when system breaks down, then utilize the last process status that keeps to recover, process status is returned to the state that keeps that time continue operation.
The checkpoint technology is from use angle, can be divided into two classes: a kind of is Embedded checkpoint technology, and this method needs the user to choose retention point at the program correct position, and this method need be revised user program, retention point need set in advance, can't carry out instant reservation.Another is transparent checkpoint technology, and this technology does not need to revise user program, can keep in real time in any moment that program is carried out.
The reservation of process status or recovery relate to mass data on disk storage or read, especially in massively parallel computer system, usually the operation of program is made up of thousands of process, so numerous processes is carried out the reservation or the recovery of state simultaneously, need take a large amount of retaining spaces and keep release time, its expense is an acid test for computer system.Therefore, be necessary the checkpoint technology is optimized, to adapt to the application under extensive environment.
Existing a kind of be the reservation content that is conceived to the checkpoint, reduce the reservation amount of checkpoint by analyzing the internal storage location do not need to keep, thereby reduce its expense.For example, people such as Gerry Kingsley have proposed auxiliary checkpoint technology (the Compiler-Assisted Checkpoint OptimizationUsing SUIF of a kind of compiler, Gerry Kingsley, Micah Beck, James S.Plank, 1995/11/15), use static data-flow analysis to optimize the performance of checkpoint, use the internal memory mutual exclusion to illustrate which partial data space of processor can not be kept in the checkpoint, thereby can reduce the reservation amount size of checkpoint and the time that reservation recovers.This method utilizes compiler do not need in the routine analyzer to come the data that keep, can analyze does not need the memory headroom that keeps and recover, but, this method needs the effective routine analyzer of user, and in the suitable position insertion retention point of user program, initiate the reservation of checkpoint by the retention point in the program, just a kind of optimisation technique of embedded checkpoint can't be carried out the optimization of diaphany point.In addition, this method is not considered the analysis to global pointer information and common mathematical function information.
Summary of the invention
The problem that the present invention solves is, the reservation method and the device of a kind of analytical approach of memory headroom and device, checkpoint is provided, with the reservation amount that reduces diaphany point with shorten reservation release time.
For addressing the above problem, the invention provides a kind of spacial analytical method of internal memory, comprise the steps: in program, to be provided with potential checkpoint, described potential checkpoint is for analyzing the indication of memory headroom; Whether in the reach of described potential checkpoint, analyzing to have does not need the memory headroom that keeps; Do not need the memory headroom that keeps if having, then identify the action scope that described memory headroom does not need the attribute that keeps.
Optionally, before described potential checkpoint is positioned at the loop body of loop statement.
Optionally, described memory headroom comprises the overall array and/or the dynamic space of application.
Optionally, the described memory headroom that does not need to keep comprises the read-only memory headroom and/or the memory headroom of write-then-read.
Optionally, whether described analysis has the memory headroom that does not need to keep further to comprise: structure definite value-quote chain and function calling relationship; Structure common mathematical function read-write behavioural information; In conjunction with definite value-quote chain, function calling relationship and common mathematical function read-write behavioural information, carry out the global pointer alias analysis, structure global pointer another name information; According to definite value-quote chain, function calling relationship, global pointer another name information and common mathematical function read-write behavioural information, whether the program block of analyzing described indication place has does not need the memory headroom that keeps.
Optionally, described structure definite value-quote chain and function calling relationship comprise utilizes data-flow analysis technical construction definite value-quote chain, utilizes interprocedural analysis technical construction function calling relationship.
Optionally, described structure common mathematical function read-write behavioural information comprises the latent structure common mathematical function read-write behavioural information table that utilizes java standard library, parallel storehouse and various common mathematical functions storehouse.
Optionally, identifying described memory headroom does not need the action scope of the attribute that keeps to comprise: do not need the starting position of the action scope of the attribute that keeps to insert the function call that the sign action scope begins at described memory headroom, do not need the end position of the action scope of the attribute that keeps to insert the function call that the sign action scope finishes at described memory headroom.
For addressing the above problem, the present invention also provides a kind of analytical equipment of memory headroom, comprising: the unit is set, is used in program potential checkpoint being set, described potential checkpoint is for analyzing the indication of memory headroom; Analytic unit is used for describedly in the reach of potential checkpoint, and whether analyze to have does not need the memory headroom that keeps; Identify unit is used for when the memory headroom that described analytic unit analysis not needing to obtain keeping, and identifies the action scope that described memory headroom does not need the attribute that keeps.
For addressing the above problem, the present invention also provides a kind of reservation method of checkpoint, comprise the steps: according to the memory headroom action scope sign of the attribute that keeps of needs not, in memory headroom does not need the action scope of the attribute that keeps, write down the information of described memory headroom; What whether record was arranged in the position of checkpoint place inquiry present procedure operation does not need the memory headroom that keeps; If what there was a record position of present procedure operation does not need the memory headroom that keeps, what then do not keep described record does not need the memory headroom that keeps, keeps Unrecorded memory headroom.
Optionally, it is described in memory headroom does not need the action scope of the attribute that keeps, the information that writes down described memory headroom comprises: do not need the starting position of the action scope of the attribute that keeps to write down the start address and the length of described memory headroom at described memory headroom, do not need the start address and the length of memory headroom of end position cancellation record of the action scope of the attribute that keeps at described memory headroom.
Optionally, described checkpoint is the diaphany point.
Optionally, described checkpoint is embedded checkpoint.
For addressing the above problem, the present invention also provides a kind of retaining device of checkpoint, comprising: record cell is used for according to the memory headroom action scope sign of the attribute that keeps of needs not, in memory headroom does not need the action scope of the attribute that keeps, write down the information of described memory headroom; Query unit, what whether record was arranged in the position of checkpoint place inquiry present procedure operation does not need the memory headroom that keeps; Stick unit, when being used for having in the position of present procedure operation the memory headroom that does not need to keep of record, what do not keep described record does not need the memory headroom that keeps, keeps Unrecorded memory headroom.
Compared with prior art, technique scheme is by the compile-time analysis memory headroom, the sign memory headroom does not need the action scope of the attribute that keeps, when carrying out the checkpoint reservation in the program operation process, whether the position of inquiry present procedure operation is to be positioned at the action scope that memory headroom does not need the attribute that keeps, just can obtain locating in the checkpoint not needing the information of the memory headroom that keeps.Therefore, technique scheme can reduce the reservation amount of checkpoint effectively, has also shortened retention time simultaneously; And because the reservation amount of checkpoint reduces, when needs carried out the recovery of checkpoint, also shortened corresponding release time.The minimizing of the reservation amount of checkpoint and keep the shortening of release time and improved the efficient of program run has also promoted the fault freedom of Large Scale Computer System simultaneously.
In addition, use static data-flow analysis compared to existing technology, the flow analysis of technique scheme binding data, interprocedural analysis, global pointer alias analysis and common mathematical function behavioural analysis, can analyze does not need the memory headroom that keeps, dynamically identify simultaneously memory headroom and do not need the action scope of the attribute that keeps, therefore whether, carry out the reservation of checkpoint in any moment of program run, can dynamically inquire about to have does not need the memory headroom that keeps.
Description of drawings
Fig. 1 is the basic flow sheet of the analytical approach of embodiment of the invention memory headroom;
Fig. 2 is the detail flowchart of the analytical approach step S12 of memory headroom shown in Figure 1;
Fig. 3 is the process flow diagram of the reservation method of embodiment of the invention checkpoint;
Fig. 4 is the synoptic diagram of the analytical equipment of embodiment of the invention memory headroom;
Fig. 5 is the synoptic diagram of embodiment of the invention checkpoint retaining device.
Embodiment
The embodiment of the invention is the action scope by the attribute that does not need at program compiler time sign memory headroom to keep, and does not need the memory headroom that keeps so that program does not keep when moving to the checkpoint.Promptly in conjunction with the accompanying drawings and embodiments the specific embodiment of the present invention is described in detail below.
Please refer to Fig. 1, it shows the basic procedure of analytical approach of the memory headroom of the embodiment of the invention, and the analytical approach of the memory headroom of present embodiment is finished by compiler.
Step S11 is provided with potential checkpoint in program, promptly insert the indication that needs to analyze memory headroom in program.#pragma ANALYSE_HERE is indicated in the compiling whether compiler inserts the analysis memory headroom in program need to keep, the position of its insertion is considered to a potential checkpoint, not necessarily real checkpoint, described potential checkpoint, can carry out real checkpoint reservation or recovery in this position, also can be as just the mark of an analyzed area.For the difficulty that reduces analysis, the accuracy that improves analysis, the insertion position of potential checkpoint should meet the following procedure pattern:
……
For (i=a; I<b; I=i+c) // also can be circulations such as while_do, do_while
{
If ((i-a) %x==0) // be used to indicate the iteration how many times to do a checkpoint
// this conditional statement is not essential according to circumstances
{
#pragma ANALYSE_HERE // be used to the indicate compiling of potential checkpoint location
Indication
}
// loop body
// also be the zone, checkpoint, promptly above the reach of potential checkpoint
}
……
In the said procedure, before potential checkpoint is inserted in the loop body of loop statement; (be loop body in) in the zone, checkpoint, comprise in the function of this intra-domain call and all can not occur the checkpoint once more that otherwise checkpoint that should the zone can not be as potential checkpoint; The statement that goto, continue, break etc. change the circulation execution sequence can not appear in the zone, checkpoint.The round-robin continue of internal layer, break statement use without limits, and the goto statement can not occur, and goto, continue occur in the function of the recursive call at place, checkpoint zone, break all allows.
Step S12, whether in the reach of described potential checkpoint, analyzing to have does not need the memory headroom that keeps.If then carry out step S13, then carry out step S14 if not.Compiling in compiler recognizer indication #pragma ANALYSE_HERE, i.e. the position of potential checkpoint, whether analyze to have in its reach does not need the memory headroom that keeps.In general, can analyze at all memory headrooms, in the present embodiment, for easier operation is analyzed in the optimization that makes the checkpoint, only analyze bigger memory headroom, just can reduce the reservation amount of checkpoint effectively because reduce the reservation amount of big memory headroom; And little memory headroom can't take checkpoint a lot of reservation amount and retention time, also there is no need spended time analysis at this.Big memory headroom comprises: the overall array and the dynamic space of application, so in the present embodiment all analysis all with these two kinds of memory headrooms as analytic target.Certainly, in other embodiments, analytic target also can be overall array, or the space of just dynamically applying for.
The memory headroom that does not need to keep at the place, checkpoint has two kinds of situations, a kind of is read-only, and this memory headroom is owing to be read-only, and its data can not change, therefore only need once to get final product, not be used in place, each checkpoint and all keep by other means reservations; Another kind is a write-then-read, just in the code after the place, checkpoint, visit to this memory headroom is to write for the first time, owing to resume operation from the checkpoint, program brings into operation after the reservation of checkpoint, and this memory headroom was write before this, the data content that keeps this memory headroom like this is exactly nonsensical, so this class memory headroom also can keep.In the present embodiment, the memory headroom that does not need to keep comprises the read-only memory headroom and the memory headroom of write-then-read.Certainly, in other embodiments, the memory headroom that does not need to keep also can be read-only memory headroom, or the memory headroom of write-then-read.
Drawing certain or some memory headrooms does not by analysis need to keep in certain section interval that program is carried out, then claim the attribute of described memory headroom in this section interval not need to keep, this section interval also just is called the action scope that described memory headroom does not need the attribute that keeps.
Step S13 does not need the memory headroom that keeps if having, and then identifies the action scope that described memory headroom does not need the attribute that keeps.Analysis result according to step S12, do not need the memory headroom that keeps if in the reach of potential checkpoint, have, compiler does not need the starting position of the action scope of the attribute that keeps to insert the function call ckpt_nosave () that the sign action scope begins at described memory headroom, do not need the end position of the action scope of the attribute that keeps to insert the function call ckpt_nosave_end () that the sign action scope finishes at described memory headroom.
The function call ckpt_nosave_end () that function call ckpt_nosave () that the sign action scope begins and sign action scope finish is when program run, and dynamically which memory headroom the current run location of logging program has do not need to keep.Wherein, function call the ckpt_nosave () record that begins of sign action scope does not need the start address and the length thereof of the memory headroom that keeps; Function call the ckpt_nosave_end () cancellation that the sign action scope finishes does not need the record of the memory headroom that keeps.
Step S14, if do not need the memory headroom that keeps in the reach of potential checkpoint, then compiler does not deal with program.
Please continue with reference to figure 2, it shows the detailed process of above-mentioned steps S12.
Step S121, the structure definite value-(DU is Def-Use) with the constructed fuction call relation to quote chain.In the present embodiment, be to utilize data-flow analysis technical construction DU chain, utilize interprocedural analysis technical construction function calling relationship figure, data-flow analysis technology and interprocedural analysis technology are technology well known to those skilled in the art, promptly will not launch explanation at this.
Step S122, structure common mathematical function read-write behavioural information, just the read-write situation of Chang Yong built-in function and other functions memory headroom that its parameter is related to.In the present embodiment, structure common mathematical function read-write behavioural information is to utilize the latent structure common mathematical function read-write behavioural information table in java standard library, parallel storehouse and various common mathematical functions storehouse.For instance, and function m emset (A, 0, SIZE) only can be to being that one section region of memory of SIZE is write from the initial length of A, then memset has the behavior of writing to first parameter, and latter two parameter then is read-only.
Step S123 in conjunction with DU chain, function calling relationship and common mathematical function read-write behavioural information, carries out the global pointer alias analysis.Specifically, with global pointer p is example, its method is to be starting point with main function node among the function calling relationship figure, travel through the node on all and the aisled function calling relationship figure of main function, scan the syntax tree of each node,, determine the another name that global pointer p is possible in conjunction with DU chain information and common mathematical function read-write behavioural information, just pointer p the memory headroom that might point to, thereby structure global pointer another name information.
Step S124, according to DU chain, function calling relationship, global pointer another name information and common mathematical function read-write behavior, whether the program block of analyzing the indication place of inserting has does not need the memory headroom that keeps.
Specifically, each node among the traversal function calling relationship figure, scan its syntax tree, search zone to be analyzed, just determine the position of compiling indication #pragma ANALYSE_HERE, each syntax tree node (also can be understood as statement) analyzed one by one in the syntax tree of the program block at scanning compiling indication #pragma ANALYSE_HERE place then, handles respectively according to the syntax tree node types:
(1) if write statement, then at first determine the object that quilt is write, method is which section memory headroom what to determine the object correspondence write according to DU chain and global pointer another name information may be, the program of corresponding to is exactly which overall array or dynamic space of applying in the program, after the object of determining to write, according to the length of write operation and write the read-write state of object before this statement and determine that quilt write the final attribute of object, be write earlier or read earlier.If before current write operation, this object is not being carried out any read-write operation, then should to as if write-then-read, be not need the memory headroom that keeps.
(2) if reading statement is the same with (1), at first determine the object of being read, the read-write state of noting this object is for reading earlier, if after analysis in not to the writing of this object, then this object is read-only, if the write operation to it is arranged, then be to need to keep.
(3) if function call then has following three kinds of situations
This function is the function that defines in the user program, then finds the function body syntax tree of this function according to function calling relationship figure, scans this syntax tree, handles by (1) or (2) same mode;
This function is the built-in function of using always, and then according to common mathematical function read-write behavioural information table, the parameter information that associative function calls, DU chain and global pointer another name information are determined the memory headroom that this function read-write is influenced;
The function that defines in the user program, the function that neither use always think that then what all may take place in this function, promptly do not analyze.
(4) for branch statement, such as if () { ... }, its lower floor's statement block then, the statement in the branch statement just, operation in the anolytic sentence piece all can't determine whether and can carry out, also need to carry out different processing for wherein reading and writing operation, for read operation wherein, be considered as being certain to take place, and for wherein write operation, then think and to take place, think that when analyzing the read-only memory space this write operation is to take place, and think that in the analysis of write-then-read memory headroom this write operation is impossible.Adopt a kind of so conservative processing means, can guarantee the correctness of analysis result.
(5) in the The whole analytical process, the memory headroom of not write is read-only memory headroom.
For making above-mentioned explanation be easier to understand, lift 3 analysis example below again and describe.
Example 1
Int A[1<<24]; // 64MB data space
main()
{
int *p;
int?i,j;
P=A; // pointer p points to array A
for(i=0;i<1000;i++)
{ // analyzed area begins
#pragma ANALYSE_HERE // potential checkpoint
for(j=0;j<(1<<24);j++)
{
p[j]=j;
}
……
} // analyzed area finishes
}
The program of example 1 can analyze pointer p by the DU chain and point to array A's.Syntax tree by the scanning analysis zone, scan p[j]=during the j statement, discovery is a write operation, its object is pointer p, because pointer p points to A's, so write operation to as if A, can determine the scope of write operation by the bound of analyzing this statement upper strata loop statement, thereby determine that whole array A has been write.Added before this time write not read or write to A, therefore be for the first time A to be write in analyzed area, that is to say that A is the data space of write-then-read, because its content will be rewritten before using again, just this does not need to keep before writing the loop statement execution in analyzed area.
Example 2
Int A[1<<24]; // 64MB data space
main()
{
int *p;
int?i,j;
P=A; // pointer p points to array A
for(i=0;i<1000;i++)
{ // analyzed area begins
#pragma ANALYSE_HERE // potential checkpoint
memset(p,0,sizeof(A));
……
} // analyzed area finishes
}
The program of example 2, when the scanning analysis area code, find that linear function calls memset (p, 0, sizeof (A)), can know by common mathematical function read-write behavioural information table, memset can write the memory headroom that first parameter is pointed to, and the length of writing is the 3rd parameter, and its first parameter is pointer p, can draw pointer p by the DU chain and point to array A's, thereby can know that this function call writes A, length is sizeof (A), and reading or write operation A not before, thereby can determine that array A is a write-then-read, this write statement does not need to keep before carrying out in analyzed area.
Example 3
Int A[1<<24]; // 64MB data space
void?func(int *q,int?size)
{
int?k,count=0;
for(k=0;k<size;k++)
{
count+=q[k]
}
}
main()
{
int *p;
int?i,j;
P=A; // pointer p points to array A
For (j=0; J<(1<<24); J++) // array A is carried out assignment
{
A[j]=j;
}
for(i=0;i<1000;i++)
{ // analyzed area begins
#pragma ANALYSE_HERE // potential checkpoint
func(p,1<<24);
} // analyzed area finishes
}
The program of example 3, when the code in scanning analysis zone, run into linear function and call func (p, sizeof (A)), by function calling relationship figure, can know that function f unc is user-defined function, can find the syntax tree of its function body, and then the function body of scanning func, to determine the read-write situation of this function to two parameters, by scanning func function body, can know that func is read-only to the memory headroom of two parameters or parameter sensing, does not have the write operation to it, by DU chain and real ginseng of function call and shape ginseng, can determine that the corresponding real ginseng of shape ginseng q among the func is pointer p, and pointer p points to array A, therefore can determine among the func A to be read.After whole analyzed area has scanned, can know that not to the writing of array A, just A is read-only in analyzed area.Therefore the A array only need keep once, and the place, each checkpoint that just not be used in the analyzed area keeps.
Therefore the analytical approach of above-mentioned memory headroom combines data-flow analysis and interprocedural analysis, can analyze the program behavior that strides across journey, and can dynamically analyze does not need the memory headroom that keeps.
Fig. 4 is the analytical equipment corresponding to the memory headroom of the analytical approach of above-mentioned memory headroom, and described device comprises: unit 41, analytic unit 42 and identify unit 43 are set.
Unit 41 is set, is used in program potential checkpoint being set, described potential checkpoint is for analyzing the indication of memory headroom;
Analytic unit 42 is used for describedly in the reach of potential checkpoint, and whether analyze to have does not need the memory headroom that keeps;
Identify unit 43 is used for when the memory headroom that analytic unit 42 analysis not needing to obtain keeping, and identifies the action scope that described memory headroom does not need the attribute that keeps.
Please refer to Fig. 3, it shows the process flow diagram of reservation method of the checkpoint of the embodiment of the invention, the reservation method of described checkpoint is after the analytical approach of using above-mentioned memory headroom compiles program, carries out automatically in the process of the program after the operation compiling.
Step S31 according to the memory headroom action scope sign of the attribute that keeps of needs not, in memory headroom does not need the action scope of the attribute that keeps, writes down the information of described memory headroom.
In the step S13 of the analytical approach of memory headroom shown in Figure 1, analysis through compiler, having does not need the memory headroom that keeps, compiler does not need the starting position and the end position of the action scope of the attribute that keeps all to insert function call at described memory headroom, during program run, by carry out these function calls dynamically the current run location of logging program have which memory headroom not need to keep.For example, compiler has inserted function call ckpt_nosave (A in the starting position of action scope, size), program run is to this moment, record does not need start address and the length size of the memory headroom A that keeps, the memory headroom that record does not need to keep can adopt the form of record sheet, has write down the start address and the length thereof that do not need the memory headroom that keeps in the table.Compiler has inserted function call ckpt_nosave_end at the end position of action scope, and (A, size), program run is to this moment, start address and the length size of the memory headroom A that cancellation has been write down.
Step S32, initiate the reservation of diaphany point, in the position of diaphany point place inquiry present procedure operation whether in memory headroom does not need the action scope of the attribute that keeps, what whether inquiry just had a record does not need the memory headroom that keeps, if then carry out step S33, then carry out step S34 if not.In any moment of program run, the outside all might be initiated the reservation of diaphany point at any time, when needs carry out the reservation of diaphany point, program is interrupted, enter the reservation flow process of diaphany point, whether the position of at first inquiring about the present procedure operation has the attribute of some memory headroom not need to keep, just whether the current checkpointed retention position is positioned at the action scope that some memory headroom does not need the attribute that keeps, if can know that then these memory headrooms do not need to keep in the reservation of current checkpoint.For instance, if the initiation of diaphany point be function call ckpt_nosave (A, size) and function call ckpt_nosave_end (A, size) between, memory headroom A does not need the memory headroom that keeps so; If the initiation of diaphany point is that (A, size) (A, size) afterwards, memory headroom A is exactly the memory headroom that needs reservation so before or at function call ckpt_nosave_end at function call ckpt_nosave.
Step S33, if there is the memory headroom that do not need to keep (promptly being the action scope that does not need the attribute that keeps at memory headroom) position of present procedure operation, what then do not keep described record does not need the memory headroom that keeps, and only keeping needs the memory headroom that keeps and other running state of programs.Do not keep these at checkpoint place and do not need the memory headroom that keeps, just can effectively reduce the reservation amount of diaphany point, the while has also shortened retention time; And because the reservation amount of checkpoint reduces, if need to recover this checkpoint, also shortened corresponding release time.
Step S34 if the position of present procedure operation does not need the memory headroom that keeps, then keeps all memory headrooms and running state of programs.
After finishing the reservation flow process of checkpoint, get back to the interrupted position of program among the step S32, program continues operation.
Fig. 5 is the retaining device corresponding to the checkpoint of the reservation method of above-mentioned checkpoint, and described device comprises: record cell 51, query unit 52 and stick unit 53.
Record cell 51 is used for according to the memory headroom action scope sign of the attribute that keeps of needs not, in memory headroom does not need the action scope of the attribute that keeps, writes down the information of described memory headroom.
Query unit 52, what be used for whether having in the position of checkpoint place inquiry present procedure operation record does not need the memory headroom that keeps.
Stick unit 53, when being used for having in the position of present procedure operation the memory headroom that does not need to keep of record, what do not keep described record does not need the memory headroom that keeps, keeps Unrecorded memory headroom.
In addition, also need to prove, though said method is to be that example describes with the diaphany point, in fact, it also is applicable to embedded checkpoint, that is to say that compiler the time adopts the analytical approach of above-mentioned memory headroom that program is analyzed in compiling, do not need the action scope starting position and the end position of the attribute that keeps to insert function call at memory headroom; Program is in when operation, writes down the memory headroom that needs not keep according to function call, and when moving to embedded checkpoint whether there being the run location of inquiry present procedure does not need the memory headroom that keeps.
In sum, technique scheme is by analyzing memory headroom, the sign memory headroom does not need the action scope of the attribute that keeps, in program run to the checkpoint, whether the position of inquiry present procedure operation is to be positioned at the action scope that memory headroom does not need the attribute that keeps, just can obtain locating in the checkpoint not needing the memory headroom that keeps.Do not keep these in the checkpoint and do not need the memory headroom that keeps, just can reduce the reservation amount of checkpoint effectively, shortened retention time simultaneously yet; And because the reservation amount of checkpoint reduces, if need to recover this checkpoint, also shortened corresponding release time.The minimizing of the reservation amount of checkpoint and keep the shortening of release time and improved the efficient of program run has also promoted the fault freedom of Large Scale Computer System simultaneously.
In addition, use static data-flow analysis compared to existing technology, the flow analysis of technique scheme binding data, interprocedural analysis, global pointer alias analysis and common mathematical function behavioural analysis, can analyze does not need the memory headroom that keeps, dynamically identify simultaneously memory headroom and do not need the action scope of the attribute that keeps, therefore whether, carry out the reservation of checkpoint in any moment of program run, can dynamically inquire about to have does not need the memory headroom that keeps.
Though the present invention with preferred embodiment openly as above; but it is not to be used for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can make possible change and modification, so protection scope of the present invention should be as the criterion with the scope that claim of the present invention was defined.

Claims (21)

1. the analytical approach of a memory headroom is characterized in that, comprises the steps:
Potential checkpoint is set in program, and described potential checkpoint is for analyzing the indication of memory headroom;
Whether in the reach of described potential checkpoint, analyzing to have does not need the memory headroom that keeps;
Do not need the memory headroom that keeps if having, then identify the action scope that described memory headroom does not need the attribute that keeps.
2. the analytical approach of memory headroom according to claim 1 is characterized in that, before described potential checkpoint is positioned at the loop body of loop statement.
3. the analytical approach of memory headroom according to claim 1 is characterized in that, described memory headroom comprises overall array and/or the space of dynamically applying for.
4. the analytical approach of memory headroom according to claim 1 is characterized in that, the described memory headroom that does not need to keep comprises the read-only memory headroom and/or the memory headroom of write-then-read.
5. the analytical approach of memory headroom according to claim 1 is characterized in that, whether described analysis has the memory headroom that does not need to keep further to comprise:
Structure definite value-quote chain and function calling relationship;
Structure common mathematical function read-write behavioural information;
In conjunction with definite value-quote chain, function calling relationship and common mathematical function read-write behavioural information, carry out the global pointer alias analysis, structure global pointer another name information;
According to definite value-quote chain, function calling relationship, global pointer another name information and common mathematical function read-write behavioural information, whether the program block of analyzing described indication place has does not need the memory headroom that keeps.
6. the analytical approach of memory headroom according to claim 5, it is characterized in that, described structure definite value-quote chain and function calling relationship comprise utilizes data-flow analysis technical construction definite value-quote chain, utilizes interprocedural analysis technical construction function calling relationship figure.
7. the analytical approach of memory headroom according to claim 5 is characterized in that, described structure common mathematical function read-write behavioural information comprises the latent structure common mathematical function read-write behavioural information table that utilizes java standard library, parallel storehouse and common mathematical function storehouse.
8. the analytical approach of memory headroom according to claim 1, it is characterized in that, identifying described memory headroom does not need the action scope of the attribute that keeps to comprise: do not need the starting position of the action scope of the attribute that keeps to insert the function call that the sign action scope begins at described memory headroom, do not need the end position of the action scope of the attribute that keeps to insert the function call that the sign action scope finishes at described memory headroom.
9. the analytical equipment of a memory headroom is characterized in that, comprising:
The unit is set, is used in program potential checkpoint being set, described potential checkpoint is for analyzing the indication of memory headroom;
Analytic unit is used for describedly in the reach of potential checkpoint, and whether analyze to have does not need the memory headroom that keeps;
Identify unit is used for when the memory headroom that described analytic unit analysis not needing to obtain keeping, and identifies the action scope that described memory headroom does not need the attribute that keeps.
10. the analytical equipment of memory headroom according to claim 9 is characterized in that, the described unit that is provided with is provided with potential checkpoint before the loop body of loop statement.
11. the analytical equipment of memory headroom according to claim 9 is characterized in that, described memory headroom comprises overall array and/or the space of dynamically applying for.
12. the analytical equipment of memory headroom according to claim 9 is characterized in that, the described memory headroom that does not need to keep comprises the read-only memory headroom and/or the memory headroom of write-then-read.
13. the analytical equipment of memory headroom according to claim 9, it is characterized in that, the described memory headroom of the sign of described identify unit does not need the action scope of the attribute that keeps to comprise: do not need the starting position of the action scope of the attribute that keeps to insert the function call that the sign action scope begins at described memory headroom, do not need the end position of the action scope of the attribute that keeps to insert the function call that the sign action scope finishes at described memory headroom.
14. the reservation method of a checkpoint is characterized in that, comprises the steps:
According to the memory headroom action scope sign of the attribute that keeps of needs not, in memory headroom does not need the action scope of the attribute that keeps, write down the information of described memory headroom;
What whether record was arranged in the position of checkpoint place inquiry present procedure operation does not need the memory headroom that keeps;
If what there was a record position of present procedure operation does not need the memory headroom that keeps, what then do not keep described record does not need the memory headroom that keeps, keeps Unrecorded memory headroom.
15. the reservation method of checkpoint according to claim 14, it is characterized in that, it is described in memory headroom does not need the action scope of the attribute that keeps, the information that writes down described memory headroom comprises: do not need the starting position of the action scope of the attribute that keeps to write down the start address and the length of described memory headroom at described memory headroom, do not need the start address and the length of memory headroom of end position cancellation record of the action scope of the attribute that keeps at described memory headroom.
16. the reservation method of checkpoint according to claim 14 is characterized in that, described checkpoint is the diaphany point.
17. the reservation method of checkpoint according to claim 14 is characterized in that, described checkpoint is embedded checkpoint.
18. the retaining device of a checkpoint is characterized in that, comprising:
Record cell is used for according to the memory headroom action scope sign of the attribute that keeps of needs not, in memory headroom does not need the action scope of the attribute that keeps, writes down the information of described memory headroom;
Query unit, what be used for whether having in the position of checkpoint place inquiry present procedure operation record does not need the memory headroom that keeps;
Stick unit, when being used for having in the position of present procedure operation the memory headroom that does not need to keep of record, what do not keep described record does not need the memory headroom that keeps, keeps Unrecorded memory headroom.
19. the retaining device of checkpoint according to claim 18, it is characterized in that, described record cell in memory headroom does not need the action scope of the attribute that keeps, the information that writes down described memory headroom comprises: do not need the starting position of the action scope of the attribute that keeps to write down the start address and the length of described memory headroom at described memory headroom, do not need the start address and the length of memory headroom of end position cancellation record of the action scope of the attribute that keeps at described memory headroom.
20. the retaining device of checkpoint according to claim 18 is characterized in that, described checkpoint is the diaphany point.
21. the retaining device of checkpoint according to claim 18 is characterized in that, described checkpoint is embedded checkpoint.
CN 200710094330 2007-11-28 2007-11-28 Internal memory space analyzing method and device and check point reserving method and device Expired - Fee Related CN101452379B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200710094330 CN101452379B (en) 2007-11-28 2007-11-28 Internal memory space analyzing method and device and check point reserving method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200710094330 CN101452379B (en) 2007-11-28 2007-11-28 Internal memory space analyzing method and device and check point reserving method and device

Publications (2)

Publication Number Publication Date
CN101452379A true CN101452379A (en) 2009-06-10
CN101452379B CN101452379B (en) 2012-05-23

Family

ID=40734629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200710094330 Expired - Fee Related CN101452379B (en) 2007-11-28 2007-11-28 Internal memory space analyzing method and device and check point reserving method and device

Country Status (1)

Country Link
CN (1) CN101452379B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136407A (en) * 2011-12-03 2013-06-05 南京南瑞继保电气有限公司 Method of achieving snapshot with electro-magnetic transient in DC system (EMTDC) simulation model based on data integrated access technique
CN106484618A (en) * 2016-10-10 2017-03-08 中国电力科学研究院 A kind of based on memory access rely on to parallel playback method and device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753361B (en) * 2019-01-04 2020-10-23 合肥杰发科技有限公司 Memory management method, electronic equipment and storage device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6105148A (en) * 1995-06-16 2000-08-15 Lucent Technologies Inc. Persistent state checkpoint and restoration systems
JP3120033B2 (en) * 1996-03-19 2000-12-25 株式会社東芝 Distributed memory multiprocessor system and fault recovery method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136407A (en) * 2011-12-03 2013-06-05 南京南瑞继保电气有限公司 Method of achieving snapshot with electro-magnetic transient in DC system (EMTDC) simulation model based on data integrated access technique
CN106484618A (en) * 2016-10-10 2017-03-08 中国电力科学研究院 A kind of based on memory access rely on to parallel playback method and device
CN106484618B (en) * 2016-10-10 2019-04-30 中国电力科学研究院 A kind of parallel playback method and device based on memory access dependence pair

Also Published As

Publication number Publication date
CN101452379B (en) 2012-05-23

Similar Documents

Publication Publication Date Title
US20220245057A1 (en) Systems, methods, and devices for vertically integrated instrumentation and trace reconstruction
US8024719B2 (en) Bounded hash table sorting in a dynamic program profiling system
KR101354796B1 (en) Optimization of software transactional memory operations
Sridharan et al. Demand-driven points-to analysis for Java
US8533699B2 (en) System and method for optimizing a code section by forcing a code section to be executed atomically
US6742178B1 (en) System and method for instrumenting application class files with correlation information to the instrumentation
US8347061B2 (en) Method for protecting user-managed memory using an exception
US8352921B2 (en) Static analysis defect detection in the presence of virtual function calls
Sui et al. Sparse flow-sensitive pointer analysis for multithreaded programs
US20090248721A1 (en) System And Method for Stack Crawl Testing and Caching
US7308682B2 (en) Method and apparatus for recovering data values in dynamic runtime systems
EP1172729A2 (en) Apparatus and method for cataloguing symbolic data for use in performance analysis of computer programs
US20100031241A1 (en) Method and apparatus for detection and optimization of presumably parallel program regions
CN106325970A (en) Compiling method and compiling system
Roemer et al. Smarttrack: efficient predictive race detection
US8056061B2 (en) Data processing device and method using predesignated register
Yu et al. Fast loop-level data dependence profiling
CN101452379B (en) Internal memory space analyzing method and device and check point reserving method and device
US9146719B2 (en) Data layout using data type information
CN104461880A (en) Method for automatically detecting heap corruption in embedded system
KR20070087400A (en) Method and system for test coverage analysis of operating system software
Selva et al. Building a polyhedral representation from an instrumented execution: Making dynamic analyses of nonaffine programs scalable
Bai et al. {DLOS}: Effective Static Detection of Deadlocks in {OS} Kernels
Popov et al. Piecewise holistic autotuning of parallel programs with cere
Nanjekye et al. Towards Reliable Memory Management for Python Native Extensions

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120523

Termination date: 20131128