FDVM_DD (1158349), страница 2
Текст из файла (страница 2)
| a | ... | b | ... | c | ... | ||||||||||||||||||||
Symbol Table
Fig. 3.4. Internal representation of the statement a = b + c.
4 Detailed Description of Basic Modules
Scheme of high level functions calls of the main module dvm.cpp is:
m
ain initialize
initVariantNames
initLibNames
initDVM
TranslateFileDVM • TransFunc
unparse (class File) InsertDebugStat
main(int argc, char *argv[])
| int | main | ( | int argc, | char *argv[] ) |
The function processes the compilation parameters and sets compilation mode on. It initializes compiler data structures, calls the TranslateFileDVM( ) function to restructure parse tree according to the compilation mode, and calls the unparse( ) class SgFile member function for generating new source code from restructured internal form. The function returns 1 if there are found some errors in the program.
| void | TranslateFileDVM | ( | SgFile | *f ) | ||
| f | - pointer to the program file | |||||
If the compilation mode is generating of parallel program then the TransFunc( ) function is called for each procedure of program else the InsertDebugStat( ) function is called.
| void | TransFunc | ( | SgStatement | *func | ) | |
| func | - pointer to the procedure header statement | |||||
The statements of procedure are scanned in lexical order until last statement of procedure.
Specification statements and directives processing.
A DISTRIBUTE directive is involved in list. The function builds the aligning trees processing ALIGN directives. After specification directives scanning
When all specification statements and directives are scanned the LibDVM function calls for creating distributed arrays are generated and inserted in program before first executable statement. The GenDistArray( ) function creates distributed arrays (LibDVM object) for array with DISTRIBUTE attribute and all arrays immediately or ultimately aligned with it.
Executable statements and directives processing.
The distributed array element references in assignment, CALL , arithmetical IF, logical IF, IF-THEN, ELSE_IF, and computed GOTO statements are linearizing.
A DVM directive is replaced by sequence of LibDVM functions calls. When new statement is inserted in a program restructuring of the control graph (carring or substituting label, replacement of logical IF statement by IF...THEN...ENDIF construct, and so on) is performed if necessary. The ReplaceContext( ), doAssignStmtAfter( ), InsertNewStatementAfter( ), InserNewStatementBefore( ) functions serve for inserting new statement in parse tree and restructuring it.
After processing last statement of procedure the declaration statements for temporary variables that are used for argument passing, storing function value, buffering I/O, and addressing distributed arrays are created and inserted in specification part of procedure (DeclareVarDVM( )).
List of called functions:
| TempVarDVM | ChangeDistArrayRef |
| RTLInit | DebugVarArrayRef |
| RTLExit | DebugVarArrayRef_Left |
| BeginBlock | ChangeArg_DistArrayRef |
| EndBlock | DebugArg_VarArrayRef |
| GetAM | ReplaceAssignByIf |
| GetVM | ReplaceContext |
| doDisRuleArrays | ParallelLoop |
| GenDistArray | AddToGroupNameList |
| InsertNewStatementBefore | CreateBoundGroup |
| InsertNewStatementAfter | ShadowList |
| doAssignStmtAfter | StartBound |
| Extract_Stmt | WaitBound |
| RemoteAccessEnd | CreateReductionGroup |
| GoRoundEntry | ReductionList |
| BeginBLockForEntry | StartRed |
| initMask | WaitRed |
| Error | doAlignRule |
| err | RealignArray |
| addToStmtList | RealignArr |
| ReplaceDoNestLabel_Above | DistObjectRef |
| CloseDoInParLoop | RedistributeArray |
| CloseParLoop | control_list_open |
| EndParLoop | ReplaceByIfStmt |
| EndPl | InsertSendIOSTAT |
| isDoEndStmt | InsertSendInquire |
| CloseLoop | InsertSendInputList |
| DebugLoop | IOcontrol |
| SeqLoopBegin | TestIOList |
| SeqLoopEndInParLoop | IO_ThroughBuffer |
| OverLoopAnalyze | D_Skpbl |
| SeqLoopEnd | D_Lnumb |
| DeleteObject | D_Fname |
| OpenInterval | St_Binter |
| CloseInterval | St_Einter |
| Value | St_Biof |
| lastStmtOfDo | St_Eiof |
| AddRemoteAccess | St_Eloop |
| RemoteVariableList | DeclareVarDVM |
| Rank |
| void | InsertDebugStat | ( | SgStatement | *func | ) | |
| func | - pointer to the procedure header statement | |||||
The function generates the sequential code including Debugger and Performance Analyzer functions calls. Parameters of compilation(-e… and -d…) control the process of generating new statements.
The statements of procedure are scanned in lexical order until last statement of procedure. The specification statements and directives are omitted.
If the user specify non-zero level of debugging in compiler run command the statements containing expressions (assignment, CALL , arithmetical IF and so on) are surrounded with Debugger functions for control of variables value.
The function inserts Debugger calls at the beginning and the end of each parallel and sequential loop and Performance Analyzer calls at the beginning and the end of each interval.
List of called functions:
| TempVarDVM | DebugVarArrayRef |
| RTLInit | DebugVarArrayRef_Left |
| RTLExit | DebugArg_VarArrayRef |
| InsertNewStatementBefore | SkipParLoopNest |
| InsertNewStatementAfter | ReplaceContext |
| doAssignStmtAfter | ParallelLoop_Debug |
| Extract_Stmt | isParallelLoopEndStmt |
| addToStmtList | AddToGroupNameList |
| ReplaceDoNestLabel_Above | CreateReductionGroup |
| CloseDoInParLoop | ReductionList |
| CloseParLoop | D_Lnumb |
| isDoEndStmt | D_Fname |
| CloseLoop | St_Binter |
| DebugLoop | St_Einter |
| SeqLoopBegin | St_Biof |
| SeqLoopEndInParLoop | St_Eiof |
| OverLoopAnalyze | St_Eloop |
| SeqLoopEnd | DeclareVarDVM |
| OpenInterval | DeleteObject |
| CloseInterval | Error |
| Value | err |
| initMask |
| void | initialize | ( | ) |
This function initializes the variables of compiler used in the mode of generating Debugger and Performance Analyzer calls.
| void | initVariantNames | ( | ) |
This function initializes the table of variant tags.
| void | initLibNames | ( | ) |
This function initializes the LibDVM function name table.
| void | initDVM | ( | ) |
This function inserts the LibDVM function symbols in the Symbol Table.
| void | initMask | ( | ) |
This function cleans the mask of using LibDVM functions. The functions generating LibDVM library calls reset the corresponding mask element to 1. The declaration statement is created only for masked (used in procedure) LibDVM functions.
| void | TempVarDVM | ( | SgStatement | *func | ) | |
| func | - pointer to the procedure header statement | |||||
The function puts in the Symbol Table the following symbols of reserved variables:
| integer | dvm000(...) | - array for storing LibDVM function results |
| integer | i0000m(0:0) | - base for addressing distributed arrays of type integer |
| real | r0000m(0:0) | - base for addressing distributed arrays of type real |
| double precision | d0000m(0:0) | - base for addressing distributed arrays of type double precision |
| logical | l0000m(0:0) | - base for addressing distributed arrays of type logical |
| complex | c0000m(0:0) | - base for addressing distributed arrays of type complex |
| integer | i000io(1000) | - buffer for I/O of distributed arrays of type integer |
| real | r000io(1000) | - buffer for I/O of distributed arrays of type real |
| double precision | d000io(1000) | - buffer for I/O of distributed arrays of type double precision |
| logical | l000io(1000) | - buffer for I/O of distributed arrays of type logical |
| complex | c000io(1000) | - buffer for I/O of distributed arrays of type complex |
| integer | idvm00 | - do-variables of loops implementing I/O of |
| idvm01 | distributed arrays | |
| . . . | ||
| idvm07 | ||
| integer | i000bf(...) | - buffer for storing remote data of type integer |
| real | r000bf(...) | - buffer for storing remote data of type real |
| double precision | d000bf(1000) | - buffer for storing remote data of type double precision |
| logical | l000bf(1000) | - buffer for storing remote data of type logical |
| complex | c000bf(1000) | - buffer for storing remote data of type complex |















