debugDDe (1158408), страница 10
Текст из файла (страница 10)
Thus, we can manually calculate the specified reduction operation by restoring initial reduction variable value after each iteration and applying the specified reduction operation for an intermediate values.
The following functions are intended for work with the reduction variable-table and performing manual reduction calculation:
| void trcreduct_Insert(s_REDVAR* RVar ) | ||
| RVar | – | pointer to an internal RTL structure that describes the reduction variable |
The function registers the reduction variable in the variable-table. The function is called when a user defines the reduction variable.
| REDUCT_INFO* trcreduct_Find( void* addr ) | ||
| addr | – | variable address. |
The function finds reduction variable description structure by the variable address. It returns NULL if a reduction variable with the specified address is not registered.
| void trcreduct_Remove( s_REDVAR* RVar ) | ||
| RVar | – | pointer to an internal RTL structure that describes the reduction variable. |
The function removes the reduction variable from the variable-table. The function is called when the reduction calculation is completed.
| int trcreduct_IsReduct( void *addr ) | ||
| addr | – | variable address. |
The function checks registration of the reduction variable with the specified address in the variable table.
| void trcreduct_VarDestructor( VarInfo *Var ) | ||
| Var | – | pointer to the reduction variable description structure. |
Destructor of the reduction variable description structure.
| void trcreduct_StoreInitial(s_REDVAR* RVar) | ||
| RVar | – | pointer to an internal RTL structure that describes the reduction variable. |
The function saves the initial value of the reduction variable.
| void trcreduct_Calculate(void) |
The function calculates the intermediate result of the manual reduction calculation after completion a next iteration of a current parallel loop or next parallel task.
| void trcreduct_CalculateVar( VarInfo *Var ) | ||
| Var | – | pointer to the reduction variable description structure. |
The function calculates the intermediate result of the manual reduction calculation for the specified reduction variable.
| void trcreduct_Complete( void *addr, long Type ) | ||
| addr | – | reduction variable address. |
| Type | – | reduction variable type (rt_INT, rt_LONG, rt_FLOAT or rt_DOUBLE). |
The function completes the manual reduction calculation for the specified reduction variable. The function puts the reduction result into the trace.
| void trcreduct_CopyResult( s_COLLECTION *RedVars ) | ||
| RedVars | – | the collection of reduction variables that are calculated in the current parallel structure. |
The function copies the calculated reduction results into the specified reduction variables.
6.5.7Parameters of comparing execution results sub-system
The comparing execution results sub-system uses the same technique of parameter specifying as dynamic control. The execution result tracing uses the following parameters:
EnableTrace – flag to enable or disable execution result tracing performance. If it is equal to 0 then tracing is disabled.
ManualReductCalc – reduction calculation mode. The manual reduction calculation method is used if this parameter is equal to 1.
TraceOptions.FileLoopInfo – trace configuration file name. This file is looked in the TraceOptions.TracePath directory.
TraceOptions.TraceFile – the name of the standard trace file. This file is looked in the TraceOptions.TracePath directory. This parameter is used only in the trace-comparing mode.
TraceOptions.ErrorFile – the name of diagnostic output file. This file is used if parameter TraceOptions.ErrorToScreen is equal to 0. If system cannot open the file, the error messages will be output to the screen.
TraceOptions.Ext – extension of trace files. The name of a trace file is formed by using the following rule: <processor number>.<TraceOptions.Ext>. The trace file will be created in the TraceOptions.TracePath directory. This parameter is used only in the trace accumulation mode.
TraceOptions.Exp – exactitude of a float number comparison in the trace-comparing mode.
TraceOptions.WrtHeaderProc – the number of a processor that forms trace configuration file. The trace configuration file will contain trace size estimations for the specified processor. The summary trace size estimation can be got by launching the program on a single processor.
TraceOptions.TracePath – the directory of trace files.
TraceOptions.TraceMode – the mode of execution result tracing:
0 – generate trace configuration file. Only processor with the number TraceOptions.WrtHeaderProc creates this file;
1 – accumulate trace into the file <processor number>.<TraceOptions.Ext>;
2 – join of the two previous modes;
3 – compare the execution result trace with the standard trace file TraceOptions.TraceFile.
TraceOptions.TraceLevel – the default trace level. It is used only in the trace accumulation mode. The possible values:
0 – disable tracing (level NONE);
1 – trace beginning and finishing loops and task regions, beginning iterations and parallel task only (level MINIMAL);
2 – the previous level plus trace variable modifications (level MODIFY);
3 – trace all events (level FULL).
TraceOptions.SpaceIndent – the indent size that is used in the trace files.
TraceOptions.ErrorToScreen – if this parameter is not equal to 0 then all diagnostic messages will be output to the screen.
TraceOptions.TableTraceSize – increment size of the trace table.
TraceOptions.HashIterIndex and TraceOptions.HashIterSize – hash-table parameters.
TraceOptions.ReductHashIndexSize, TraceOptions.ReductHashTableSize and TraceOptions.ReductVarTableSize – the parameters of the reduction variable-table.
TraceOptions.SaveThroughExec – the trace will be written into the file during program execution if this parameter is not equal to 1. Otherwise the trace will be accumulated in the memory and written after program completion. You can enable this mode only if the trace configuration file is existing.
TraceOptions.PrintStatistic – flag to enable or disable output of the trace statistics.
TraceOptions.WriteEmptyIter – if it is equal to 0 then the empty iterations are not put into the trace.
TraceOptions.AppendErrorFile – the mode of a diagnostic file usage. The file will be cleared each time before program startup if the parameter is equal to 0.
TraceOptions.MaxErrors – the maximum count of errors after that the trace accumulation or comparing is disabled.
7Diagnostic messages of the dynamic debugger
Table 1. The messages of dynamic control of DVM-directives
| Error message | Description |
| Writing to read-only variable <var> | Writing to read-only variable is detected. |
| Using non-initialized variable <var> | Access to non-initialized variable is detected. |
| Using non-initialized element <elem> | Access to non-initialized array element is detected. |
| Using variable <var> before asynchronous reduction competed | Access to reduction variable before reduction operation completion is detected. |
| Access to non-local element <elem> | Access to non-local element of distributed array is detected. |
| Writing to shadow element <elem> of array | Writing to shadow element of array is detected. |
| Data dependence in loop due to access to element <elem> | Data dependence in parallel loop is detected. |
| Using shadow element <elem> before asynchronous shadow renew competed | The dynamic debugger detects access to a shadow element before asynchronous shadow renew competed |
| Writing to remote data buffer <var> | Writing to remote data buffer is detected. |
| Write to remote element <elem> in sequential branch | Access to array element in sequential branch of program without preliminary testing that the element is located on current processor. |
| Reading remote element %s in sequential branch | Access to non-local array element in sequential branch of program is detected. |
| WAIT for reduction without START | Waiting for asynchronous reduction completion is issued without Start asynchronous reduction. |
| Using element outside of array limits: <elem> | Access to element of array beyond its limits. |
| START for reduction without WAIT | The wait operation is missing for started asynchronous reduction calculation. |
| Reduction operation was not started | The reduction variable is specified but the reduction calculation is never performed. |
Table 2. The messages of comparing execution results
| Error message | Description |
| Bad file structure | It is reported when any non-correspondence of trace or loop description file is detected. |
| Undefined keyword | It is reported if unknown keyword appears in trace or loop description file. |
| Bad command syntax | It is reported, if wrong parameters appear after keyword. |
| Can't open a file <file name> | Specified file can’t be open on reading or writing. |
| Trace file is empty | Specified trace file exists, but it is empty. |
| Bad trace structure (missing current program construct) | It is reported, if iteration or task beginning or structure completion event occurs without correspondent structure beginning event. |
| No current program construct | It is reported if iteration or task beginning or structure completion event occurs without corresponding structure beginning event. |
| Unexpected task or iteration of loop | It is reported if iteration or task beginning event occurred, but there is no correspondent record in reference trace. |
| Double execution of task or iteration, No = <iteration number> | It is reported if iteration or task beginning event occurs for already executed loop iteration or task. Absolute iteration number is reported. |
| Unexpected execution of program construct | It is reported if structure beginning event occurs, but there is no correspondent record in reference trace. |
| Abnormal loop exit | It is reported if record of loop end is not corresponds to the record of loop beginning. |
| Unexpected use of variable | It is reported if there is no record in reference trace for variable access event. |
| Unexpected trace record | It is reported if there is no record in reference trace for an event of completion of self-calculation block in the sequential branch. |
| Different <type> values: <standard value> != <current value> | Different values of the same variable are detected for current event and in reference trace record. |
| Different <type> values of reduction variable: <standard value> != <current value> | Different values of reduction operation are detected for current event and in reference trace record. |















