DEB_DD (1158343), страница 5
Текст из файла (страница 5)
'Find' operations – number of variable searching requests.
'Compare' operations – total number of comparison performed by searching operations.
HashTable elements – visually maps a degree of a hash-values distribution. It shows number of variables connected to each hash-value.
The dynamic control subsystem uses such concept as execution level.
The root level is a level of the initial sequential branch of the program . This level has 0 number. When entering a parallel construction the number of current level is incremented by one unit. When leaving parallel construction the number of current level is decrement by on unit. Thus, the number of current level defines a depth of parallel constructions.
The number of the current level is important for work with variables, since the ideology of using variables depends on current level. This level is taken into account with registering a new variable in the dynamic control and is kept together with a basic information about a variable.
3.3.The base functions of dynamic control module
void dyn_Init( void );
The function initializes all required structures and variables for dynamic control subsystem.
void dyn_Done( void );
The uninitializes all dynamic control structures and outputs all detected errors.
void dyn_LevelDone( void );
The current parallel loop is completed. The function removes all registered variables for the current execution level.
VarInfo *dyn_GetVarInfo( void *addr );
addr – variable address.
Searching variable information by its address. The function returns NULL if variable is not registered.
VarInfo *dyn_CheckVar( char *Operand, void *addr, SysHandle *Handle, byte isWrt );
Operand – variable name.
addr – variable address.
Handle – distributed array handle. It is equal to NULL for scalar variables.
isWrt – variable accessing flag. It is equal to 0 if variable is accessed for reading and equal to 1 in the other case.
The general function of dynamic control module. The function checks all variables accessed for reading and writing.
VarInfo *dyn_DefineVar( byte type, byte Stat, void *addr, SysHandle *Handle, void *Info, PFN_VARTABLE_ELEMDESTRUCTOR pfnDestructor);
type – type of the variable usage.
Stat – flag of static variable. It is equal to 1 for a static variable (not deleted when leaving a parallel construction ).
addr – variable address.
Handle – distributed array handle. It is equal to NULL for the scalar variable.
Info – pointer to an additional variable information.
pfnDestructor – variable information destructor. It is called when variable information is deleted from a variable-table.
It is the general variable definition (registration) function.
VarInfo *dyn_DefineReduct( byte Stat, void *addr );
Stat – flag of static variable. It is equal to 1 for a static variable (not deleted when leaving a parallel construction ).
addr – variable address.
The function registers a reduction variable.
VarInfo *dyn_DefineDisArray( SysHandle *Handle, byte Stat, DISARR_INFO *Info );
Handle – distributed array handle.
Stat – flag of static variable. It is equal to 1 for a static variable (not deleted when a parallel construction has been done).
Info – additional distributed array information.
The function registers a distributed array.
VarInfo *dyn_DefinePrivate( void *addr, byte Stat );
addr – variable address.
Stat – flag of static variable. It is equal to 1 for a static variable (not deleted when leaving a parallel construction ).
The function registers a variable with private type of access.
VarInfo *dyn_DefineReadOnly( void *addr, void *Info );
addr – variable address.
Info – additional variable information.
The function registers a variable with read-only type of access.
VarInfo *dyn_DefineRemoteBufferArray( SysHandle *SrcHandle, SysHandle *DstHandle, long *Index );
SrcHandle – the source distributed array.
DstHandle – created buffer of remote access.
Index – array of elements indexes for which the buffer is created.
Registration of remote access buffer for several elements of the source distributed array. The remote access buffer is created as a distributed array.
VarInfo *dyn_DefineRemoteBufferScalar( SysHandle *SrcHandle, void *RmtBuff, long *Index );
SrcHandle – the source distributed array.
RmtBuff – variable address used as remote access buffer.
Index – array of elements indexes for which the buffer is created.
Registration of remote access buffer for a single element of the source distributed array. The remote access buffer is created as a scalar variable.
void dyn_DestructReduct( VarInfo *Var );
Var – pointer to variable information structure.
Destructor of a reduction variable. The reduction variable registration assigns this destructor for variable information structure.
void dyn_DestructPrivate( VarInfo *Var );
Var – pointer to variable information structure.
Destructor of a variable with the private type of access. The private variable registration assigns this destructor for variable information structure.
void dyn_DestructReadOnly( VarInfo *Var );
Var – pointer to variable information structure.
Destructor of a variable with the read-only type of access. The read-only variable registration assigns this destructor for variable information structure.
void dyn_DestructDisArray( VarInfo *Var );
Var – pointer to variable information structure.
Destructor of a distributed array. The distributed array registration assigns this destructor for variable information structure.
VarInfo *dyn_CheckValidVar( VarInfo *Current, void *addr, SysHandle *Handle, byte isWrt );
Current – pointer to current variable information structure for the specified address. Can be NULL if the variable with this address is not registered.
addr – address of the variable or distributed array element.
Handle – distributed array handle.
isWrt – it is equal to 1, if variable is used for writing.
The function checks the current variable information structure on the correspondence to a current program execution level. If Current does not correspond to the current execution level then a new variable information is created and returned as the function result. Otherwise, the Current pointer is returned.
void dyn_RemoveVar( void *addr );
addr – variable address.
Removing variable information for the current execution level.
void dyn_PrivateSet( VarInfo *Var, size_t LI );
Var – pointer to private variable or distributed array information.
LI – absolute index of an array element.
The function sets initialization flag for the variable or element of distributed array.
void dyn_PrivateReset( VarInfo *Var );
Var – pointer to private variable or distributed array information.
The function clears initialization flag for the variable or all elements of distributed array.
int dyn_PrivateIsSet( VarInfo *Var, size_t LI );
Var – pointer to private variable or distributed array information.
LI – absolute index of an array element.
The function checks initialization of variable or element of distributed array . It returns 1 if variable or element has been initialized.
void dyn_DisArrSendBounds( s_DISARRAY *Arr );
Arr – pointer to the internal distributed array structure of the DVM system.
The function sets the flag of starting edge exchange for the specified distributed array description.
void dyn_DisArrRecieveBounds( s_DISARRAY *Arr );
Arr – pointer to the internal distributed array structure of the DVM system.
The function sets the flag of completion of edge exchange for the specified distributed array description.
void dyn_DisArrCheckBounds( char *Operand, VarInfo *Var, size_t LI, byte isWrt, long Iter );
Operand – the variable name.
Var – pointer to a variable information structure.
LI – absolute index of an array element.
isWrt – it is equal to 1 if element is used for writing.
Iter – absolute index of the current parallel loop iteration.
The function calculates the current local part of the distributed array allocated on the current abstract machine and checks whether the element belongs to this local part or its edges or not.
In addition, the correctness of edge usage is checked.
void dyn_DisArrCheckDataDepends( char *Operand, VarInfo *Var, size_t LI, byte isWrt, long Iter );
Operand – the variable name.
Var – pointer to a variable information structure.
LI – absolute index of an array element.
isWrt – 1 if element is used for writing.
Iter – absolute index of the current parallel loop iteration.
The function checks the undeclared loop data dependence when the specified distributed array elements is used.
byte dyn_DisArrCheckLimits( char *Operand, long LI, DISARR_INFO *Info );
Operand – the variable name.
LI – absolute index of an array element.
Info – the additional distributed array information.
The function checks out of range for the specified distributed array. It returns 1 if the element with the index LI belongs to the local array part.
byte dyn_GetLocalBlock(s_BLOCK *DABlock, s_DISARRAY *DA, s_PARLOOP *PL);
DABlock – pointer to a result block structure.
DA – pointer to the internal distributed array structure of the DVM system.
PL – pointer to the internal parallel loop structure of the DVM system.
The function calculates the block of a distributed array, access to which elements is possible inside the current iteration of a parallel loop. It returns 0 in case of a successful evaluation of the block.
3.4.The parameters of dynamic control
The user can manage some parameters of dynamic control module using the file of parameters. The parameters of dynamic control module are set in files with names USRDEBUG.*.
The dynamic control module uses the following parameters:
-
EnableDynControl – flag of dynamic control If it is equal to 0 then dynamic control is disabled.
-
DebugOptions.ErrorFile – the name of diagnostic output file. This file is used if parameter DebugOptions.ErrorToScreen is equal to 0. If system cannot open the file, the error messages will be output to the screen.
-
DebugOptions.HashIndexSize – size of hash-index for the dynamic control variable table.
-
DebugOptions.HashTableSize – increment size of hash-array of the variable-table.
-
DebugOptions.VarTableSize – increment size of the variable-table.
-
DebugOptions.ErrorToScreen – if this parameter is not equal to 0 then all diagnostic messages will be output to the screen.
-
DebugOptions.PrintStatistic – flag to enable or disable output of the variable-table usage statistics.
-
DebugOptions.AppendErrorFile – the mode of a diagnostic file usage. The file will be cleared each time before program running if this parameter is equal to 0.
-
DebugOptions.MaxErrors – the maximum count of errors after that the dynamic control is disabled.
-
DebugOptions.CheckVarInitialization – flag to enable or disable checking scalar variables initialization.
-
DebugOptions.CheckVarReadOnly – flag to enable or disable checking usage of variables with read-only access mode.
-
DebugOptions.CheckReductionAccess – flag to enable or disable checking usage of reduction variables.
-
DebugOptions.CheckDisArrInitialization – flag to enable or disable checking distributed array elements initialization.
-
DebugOptions.CheckDisArrLimits – flag enable or disable checking access out of distributed array range.
-
DebugOptions.CheckDisArrEdgeExchange – flag to enable or disable checking edge exchange for distributed arrays.
-
DebugOptions.CheckDisArrSequentialAccess – flag to enable or disable checking usage of distributed array elements in the sequential program part.
-
DebugOptions.CheckDisArrLocalElm – flag to enable or disable checking membership of an element to the distributed array local part.
-
DebugOptions.CheckDataDependence – flag to enable or disable checking undeclared loop data dependence.
-
DebugOptions.CheckRemoteBufferAccess – flag to enable or disable checking usage of remote access buffers.
-
HashMethod – this parameter defines algorithm that is used for the hash-value calculation. If it is equal to 0 then the StandartHashCalc algorithm is used, if it is equal to 1 then the OffsetHashCalc algorithm is used.
-
HashOffsetValue – offset value for the OffsetHashCalc algorithm. The values from 0 up to 16 are supposed.
3.5.Error messages
The common error message structure of dynamic control module is the following:
(<process number>)<context> File: <file>, Line: <line>















