DEB_DD (1158343), страница 8
Текст из файла (страница 8)
hf – opened file handle.
Skip – pointer to the record of possible skipping of operator group.
The function writes the record of possible skip of group of operators in a sequential branch of the program after checking the membership of an array element to the current processor into the standard trace file. 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 loop and common trace size.
void trc_wrt_calcinfo( LOOP_INFO *Loop );
Loop – pointer to the loop description file.
The function calculates the trace size for the specified loop.
4.3.2.Trace 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).
If the trace-comparing mode is specified then these functions are used by trace reading module for reading trace file and forming trace structure in the memory.
void trc_put_beginloop( char *File, unsigned long Line, long No, byte IsPar, byte Rank, long *Init, long *Last, long *Step );
File – file name.
Line – line number.
No – loop number.
IsPar – loop flag. Equal one if the loop is a parallel.
Rank – loop rang.
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 puts the record of the loop beginning into the trace table.
void trc_put_endloop( char *File, unsigned long Line, long No, unsigned long BegLine );
File – file name.
Line – line number.
No – loop number.
BegLine –number of the loop beginning line.
The function puts the record of the loop finishing into the trace table.
void trc_put_iteration( AddrType *index );
index – array of pointers to iteration variables.
The function puts the record of the iteration beginning into the trace table. If the mode of writing empty iterations is not selected then the record really will be put into the trace table only after beginning sub-loop or variable accessing inside this iteration.
void trc_put_iteration_flash_par( byte Rank, long *Index, long LI );
Rank – iteration rank.
Index – array of pointers to iteration variables.
LI – absolute iteration index.
The function unconditionally puts the record of the iteration beginning into the trace table.
void trc_put_iteration_flash(void);
The function put the current postponed record of the iteration beginning into the trace table. This function is called from functions trc_put_beginloop() and trc_put_variable().
void trc_put_readvar( char *File, unsigned long Line, char *Operand, long Type, void *Value, byte Reduct );
File – file name.
Line – line number.
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 puts the record of the variable reading into the trace table.
void trc_put_prewritevar( char *File, unsigned long Line, char *Operand, long Type, byte Reduct );
File – file name.
Line – line number.
Operand – variable name.
Type – variable type.
Reduct – reduction variable flag. It is equal to 1 if a reduction variable is used.
The function puts the record of the beginning of an expression calculation into the trace table.
void trc_put_postwritevar( char *File, unsigned long Line, char *Operand, long Type, void *Value, byte Reduct );
File – file name.
Line – line number.
Operand – variable name.
Type – variable type.
Value – variable address.
Reduct – reduction variable flag. It is equal to one if a reduction variable is used.
The function puts the record of the completion of an expression calculation into the trace table.
void trc_put_reductvar( char *File, unsigned long Line, long Type, void *Value );
File – file name.
Line – line number.
Operand – variable name.
Type – variable type.
Value – reduction variable address.
The function puts the record of the completion a reduction calculation into the trace table.
void trc_put_variable( char *File, unsigned long Line, char *Operand, byte iType, long Type, void *Value, byte Reduct );
File – file name.
Line – line number.
Operand – variable name.
IType – trace record type.
Type – variable type.
Value – variable address.
Reduct – reduction variable flag. It is equal to 1 if a reduction variable is used.
The common function of putting the record of the variable accesses into the trace table.
void trc_put_skip( char *File, unsigned long Line );
File – file name.
Line – line number.
The function puts the record of possible skip of group of operators in a sequential branch of the program after checking the membership of an array element to the current processor into the trace table.
4.3.3.Trace reading module
The functions of trace reading module read trace records from the standard trace file and form corresponding records in the memory using the trace accumulation functions (trc_put_*).
void trc_rd_header( DVMFILE *hf, char* szFileName );
hf – opened file handle.
szFileName – filename that is used in the diagnostic messages.
The function reads loop description file. It forms the hierarchy of loop description structures in the memory.
void trc_rd_trace( DVMFILE *hf, char* szFileName );
hf – opened file handle.
szFileName – filename that is used in the diagnostic messages.
The function reads the standard trace file.
unsigned long trc_rd_gets( DVMFILE *hf );
hf – opened file handle.
The function reads a next record from a file. This function skips all empty strings and removes comments. The number of the read file line is returned.
short trc_rd_search_key(char *str);
str – string with a keyword.
The function gets the key code that corresponds to a keyword. It returns -1 if key code is not found for the specified string.
char *trc_rd_split( char *Str, char *Format, ... );
Str – the parsed string.
Format – the string format.
The function parses string and get parameters by specified format.
The following symbols can be used with the Format string:
-
& – a keyword. It corresponds to a short type.
-
% – an optional integer value. It corresponds to a long type.
-
! – a required integer value. It corresponds to a long type.
-
#<type> – required value of the specified type, where the type can be one of the following symbols:
-
i – int
-
l – long
-
f – float
-
d – double
-
@ – any string.
All other symbols should matches to corresponding symbols from the parsed string.
4.3.4.Trace comparing module
void trc_cmp_beginloop( char *File, unsigned long Line, long No, byte IsPar, byte Rank, long *Init, long *Last, long *Step );
File – file name.
Line – line number.
No – loop number.
IsPar – loop flag. It is equal to one if loop is parallel.
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 compares the trace record of a loop beginning with the corresponding standard trace record.
void trc_cmp_endloop( char *File, unsigned long Line, long No, unsigned long BegLine );
File – file name.
Line – line number.
No – loop number.
BegLine – number of loop beginning line.
The function compares the trace record of a loop completion with the corresponding standard trace record.
void trc_cmp_iteration( AddrType *index );
index – the array of pointers to loop iteration variables.
The function compares the trace record of the iteration beginning with the corresponding standard trace record. If the mode of writing empty iterations is not selected then the record really will be compared only after beginning a sub-loop or variable accessing inside this iteration.
void trc_cmp_iteration_flash(void);
The function compares the current postponed trace record of the iteration beginning with the corresponding standard trace record. This function is called from functions trc_cmp_beginloop () and trc_cmp_variable ().
void trc_cmp_readvar( char *File, unsigned long Line, long Type, void *Value, byte Reduct );
File – file name.
Line – line number.
Operand – variable name.
Type – variable type.
Value – variable address.
Reduct – reduction flag. It is equal to 1 if the reduction variable is used.
The function compares the trace record of a variable reading with the corresponding standard trace record.
void trc_cmp_prewritevar( char *File, unsigned long Line, long Type, byte Reduct );
File – file name.
Line – line number.
Operand – variable name.
Type – variable type.
Reduct – reduction flag. It is equal to 1 if the reduction variable is used.
The function compares the trace record of a beginning expression calculation with the corresponding standard trace record.
void trc_cmp_postwritevar( char *File, unsigned long Line, long Type, void *Value, byte Reduct );
File – file name.
Line – line number.
Operand – variable name.
Type – variable type.
Value – variable address.
Reduct – reduction flag. It is equal to one if the reduction variable is used.
The function compares the trace record of a completion expression calculation with the corresponding standard trace record.
void trc_cmp_reductvar( char *File, unsigned long Line, long Type, void *Value );
File – file name.
Line – line number.
Operand – variable name.
Type – variable type.
Value – reduction variable address.
The function compares the trace record of a reduction result with the corresponding standard trace record.
void trc_cmp_variable( char *File, unsigned long Line, enum_TraceType iType, long vType, void *Value, byte Reduct );
File – file name.
Line – line number.
Operand – variable name.
IType – trace record type.
Type – variable type.
Value –variable address.
Reduct – reduction flag. Equal one if the reduction variable is used.
The general function of the comparing variable usage trace record with the corresponding standard trace record.
void trc_cmp_skip( char *File, unsigned long Line );
File – file name.
Line – line number.
The function compares the trace record of possible skip of group of operators in a sequential branch of the program with the standard trace record.
long trc_cmp_forward(long CurTraceRecord, enum_TraceType iType);
CurTraceRecord – the number of the current trace record.
iType – searched trace record type.
The function searches a nearest trace record with the specified type from the current trace record. It returns the number of a found trace record or –1 if the specified type is absent or records with ‘loop beginning’, ‘iteration beginning’ or ‘loop completion’ types are presented between the current and found trace records.
4.3.5.Reduction processing module
The reduction-processing module uses its own variable-table. This variable-table contains entries of the following type that describe a reduction variable:
typedef struct tag_REDUCT_INFO
{
void* Current;
void* Initial;
byte StartReduct;
s_REDVARINFO* RVar;
}
REDUCT_INFO;
Current – pointer to the buffer with a current calculated reduction result.
Initial – pointer to the buffer with an initial value of the reduction variable.
StartReduct – asynchronous reduction flag. It is equal to one if reduction calculation is started.
RVar – pointer to an internal RTL-structure that describes the reduction variable.















