debugDDe (1158408), страница 8
Текст из файла (страница 8)
The following functions call functions of the accumulation or comparing modules according to the current trace mode:
| void cmptrace_BeginSeqLoop( char *File, unsigned long Line, long No ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
| No | – | unique structure number |
The function generates a trace event of the sequential loop beginning.
| void cmptrace_BeginParLoop( char *File, unsigned long Line, long No, byte Rank, long *Init, long *Last, long *Step ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
| No | – | unique structure number |
| Rank | – | loop rank |
| Init | – | the array of initial values of iteration variables |
| Last | – | the array of end values of iteration variables |
| Step | – | the array of iteration variables steps |
The function generates a trace event of the parallel loop beginning.
| void cmptrace_BeginTaskRegion( char *File, unsigned long Line, long No ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
| No | – | unique structure number |
The function generates a trace event of the task region beginning.
| void cmptrace_EndStruct( char *File, unsigned long Line, long No, unsigned long BegLine ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
| No | – | unique structure number |
| BegLine | – | line number of the structure beginning |
The function generates a trace event of the finishing of a loop or task region.
| void cmptrace_Iter( AddrType *index ) | ||
| index | – | array of pointers to iteration variables |
The function generates a trace event of the new iteration or parallel task beginning.
| void cmptrace_PreStoreVar( char *File, unsigned long Line, char *Operand, long Type, byte Reduct ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
| Operand | – | variable name |
| Type | – | variable type |
| Reduct | – | reduction variable flag. It is equal to 1 if a reduction variable is used |
The function enervates a trace event of the beginning of an expression calculation.
| void cmptrace_PostStoreVar( char* File, unsigned long Line, char* Operand, long Type, void* Value, byte Reduct ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
| Operand | – | variable name |
| Type | – | variable type |
| Value | – | variable address |
| Reduct | – | reduction variable flag. It is equal to 1 if a reduction variable is used |
The function generates a trace event of the finishing of an expression calculation and storing the expression result into a variable.
| void cmptrace_LoadVar( char* File, unsigned long Line, char* Operand, long Type, void* Value, byte Reduct ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
| Operand | – | variable name |
| Type | – | variable type |
| Value | – | variable address |
| Reduct | – | reduction variable flag. It is equal to 1 if a reduction variable is used |
The function generates a trace event of the reading from a variable.
| void cmptrace_ReductVar( char *File, unsigned long Line, long Type, void *Value, byte Wait ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
| Operand | – | variable name |
| Type | – | variable type |
| Value | – | variable address |
| Wait | – | wait reduction flag. It is equal to one if reduction result will be stored in the trace only after a current loop finishing |
The function generates a trace event of the completion reduction calculation.
| void cmptrace_SkipBlock( char *File, unsigned long Line ) | ||
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
The function generates a trace event of finishing the self-calculation block in the sequential program part.
The following functions are intended for work with descriptions of program structures.
| STRUCT_INFO* trc_InfoNew(STRUCT_INFO* pParent) | ||
| pParent | – | pointer to the description of enclosing program structure |
The function allocates and initializes a new structure description. The function returns a pointer to the new structure.
| void trc_InfoDone(STRUCT_INFO* pInfo) | ||
| pInfo | – | pointer to the description of program structure |
Destructor of the description of program structure.
| int trc_InfoCanTrace(STRUCT_INFO* pInfo, int nRecType) | ||
| pInfo | – | pointer to the description of current executed program structure |
| nRecType | – | type of the trace event |
The function checks the structure trace level and entrance of the current structure iteration in a range of traced iterations. It returns non zero value if the specified trace event can be traced..
| void trc_InfoSetup(STRUCT_INFO* pInfo, long *Init, long *Last, long *Step) | ||
| pInfo | – | pointer to the description of program structure |
| Init | – | the array of initial values of iteration variables |
| Last | – | the array of end values of iteration variables |
| Step | – | the array of iteration variables steps |
The function prepares the structure description for beginning the structure execution.
| STRUCT_INFO* trc_InfoFindForCurrentLevel(long No, byte Type, byte Rank, char *File, unsigned long Line) | ||
| No | – | unique structure number |
| Type | – | structure type (parallel or sequential loop, task region); |
| Rank | – | structure rank |
| File | – | the source file name of DVM-program |
| Line | – | the line number of DVM-program |
The function searches a structure description in the current level by the specified parameters.
| STRUCT_INFO* trc_InfoFindByNo(long No, s_COLLECTION *pColl) | ||
| No | – | unique structure number |
| pColl | – | collection of descriptions of program structures |
The function recursively searches a structure description by the structure number.
6.5.2Trace writing module
The functions of trace writing module are intended for forming trace file and trace configuration file. The functions have the following prototypes:
| void trc_wrt_header( s_COLLECTION* pStructs, int Level, FILE *hf, int nWriteInfo ) | ||
| pStructs | – | a set of structure descriptions of the top level |
| Level | – | current processed level. This parameter is used for the recursive calls |
| hf | – | opened file handle |
| nWriteInfo | – | it is equal to 1, if an additional trace information should be written in to the loop description file |
The function forms the trace configuration file. It recursively calls itself with Level+1 and set of inner structures of each structure from the pStructs.
| void trc_wrt_trace( FILE *hf ) | ||
| hf | – | open file handle |
The function forms standard trace file.
| size_t trc_wrt_beginstruct( FILE *hf, STRUCT_BEGIN *pStruct) | ||
| hf | – | open file handle |
| pStruct | – | pointer to the trace record of the structure beginning. |
The function writes the record of structure beginning into the standard trace file. It returns the size of the written record in bytes.
| size_t trc_wrt_enstruct( FILE *hf, STRUCT_END* pStruct) | ||
| hf | – | open file handle |
| pStruct | – | pointer to the trace record of the structure finishing. |
The function writes the record of structure finishing into the standard trace file. It returns the size of the written record in bytes.
| size_t trc_wrt_iter( FILE *hf, ITERATION *Iter ) | ||
| hf | – | open file handle |
| Iter | – | pointer to the trace record of the iteration or task beginning. |
The function writes the record of iteration or task beginning into the standard trace file. It returns the size of the written record in bytes.
| size_t trc_wrt_readvar( FILE *hf, VARIABLE *Var ) | ||
| hf | – | open file handle |
| Var | – | pointer to the trace record of the variable usage |
The function writes the record of variable reading into the standard trace file. It returns the size of the written record in bytes.
| size_t trc_wrt_prewritevar( FILE *hf, VARIABLE *Var ) | ||
| hf | – | open file handle |
| Var | – | pointer to the trace record of the variable usage |
The function writes the record of beginning expression calculation into the standard trace file and returns the size of the written record in bytes.
| size_t trc_wrt_postwritevar( FILE *hf, VARIABLE *Var ) | ||
| hf | – | open file handle |
| Var | – | pointer to the trace record of the variable usage |
The function writes the record of finishing expression calculation into the standard trace file and returns the size of the written record in bytes.
| size_t trc_wrt_reductvar( FILE *hf, VARIABLE *Var ) | ||
| hf | – | open file handle |
| Var | – | pointer to the trace record of the variable usage |
The function writes the record of completion reduction calculation into the standard trace file. The size of the written record in bytes is returned.
| size_t trc_wrt_variable( FILE *hf, VARIABLE *Var, int iType ) | ||
| hf | – | open file handle |
| Var | – | pointer to the trace record of the variable usage |
| iType | – | trace record type |
The common function of writing a variable usage record into the standard trace file. The size of the written record in bytes is returned.
| size_t trc_wrt_skip( FILE *hf, SKIP *Skip ) | ||
| hf | – | open file handle |
| Skip | – | pointer to the record of finishing self-calculation block |
The function writes the record of finishing self-calculation block in a sequential branch of the program. The size of the written record in bytes is returned.
| void trc_wrt_calctraceinfo(void) |
The function calculates the trace size for the each program structure and common trace size.
| void trc_wrt_calcinfo(STRUCT_INFO* pInfo) | ||
| pInfo | – | pointer to the description of program structure |
The function calculates the trace size for the specified structure.
6.5.3Trace accumulation module
Trace accumulation functions form trace records in the global trace table. If the cross-passage mode of writing is specified then these functions do not form trace records in the memory and write them in to the standard trace file using trace writing module (trc_wrt_() functions).















