NORMA_DD (1158356), страница 13
Текст из файла (страница 13)
At start RDDG is put on the first layer of Parallel layer scheme . It consists of the dependencies of the type
| g | dependency-node | … | dependency-node |
Then all the dependencies which have <graph node> with condition <graph node>=<dependency node> performed even for one <dependency node> of even one dependency (i.e. dependencies for all the operators which the operators of the first layer depend on) are put on the second layer. Then these two layers are corrected. If there is a dependency for the operator on the second layer, then it is eliminated from the first one. Besides if there is a node of <iteration number> type on the first layer then parallel layer subscheme is built for it recursively using Table of iterations structure and temporary graph zavit.
Procedure defined above for the first and the second layer is performed for the second and the third layers etc. till on the current layer there are only operators depend on nothing. At this moment the process of ordering ends ( the process ends in all cases as graph RDDG is acyclic).
Entry point of Data dependencies graph analyser unit is function pord, which realises given algorithm.
After end of Data dependencies graph analyser unit work unit Fortran DVM intermediate representation generator is called:
p
ord beg
5.6Fortran DVM intermediate representation generator
Fortran DVM intermediate representation generator realises Parallel layer scheme by translation of Parallel layer scheme into Intermediate representation of Fortran DVM program (List FORT).
Entry point of Fortran DVM intermediate representation generator is function beg, general structure of its control is given in the following scheme.
begkf
b
eg begkend begk begk1 gen_iter
ms
mssv
Function begkend receives Parallel layer scheme as an input, chooses a <layer> from it and passes it to function begk.
Function begk receives <layer> as an input, chooses a <node> and passes it to function begk1.
Function begk1 calls functions begkf, gen_iter, ms, mssv corresponding to type <node> - <statement number>, <iteration number>, <ordered group number>, <MSCS number>.
5.6.1Simple node realisation (function begkf)
Function begkf is used for realisation of node <parallel layer scheme> of <statement number> type.
General structure of function begkf control is given in the following scheme
genio
b
egkf issump issumm realop loopcmc
Function begkf chooses the body of the operator from Table of operators body by <statement number> and Table of functional dependencies. If it is input-output operator it is passed to function genio for processing, otherwise - to function issump.
General structure of function genio control is given in the following scheme
inm ima
ins isa
g
enio in-queue
outm oma
outs osa
Function genio generates input-output operators of Fortran language, realising constructions input-output-variable or input-output-scalar of Norma language.
Input-variable, input-scalar, output-variable, output-scalar are processed correspondingly by functions inm, ins, outm, outs. These functions generates necessary operators READ-WRITE, put them into List FORT in format of Intermediate representation of Fortran DVM program. Next line are added to the table of input file names fti or to the table of the names of output files fto.
Structure of a line from tables fti and fto
| file-name | file-number |
<file-number>::=<integer>
Value of <file-number> is used in generation of READ-WRITE operators as a number of canal. Table fti is used in unit Input files analyser.
Then functions inm, ins, outm, outs call correspondingly functions inm, ins, outm, outs. These functions generate operator FORMAT for operators READ-WRITE using Table of input-output formats and put this operator into List FORT in format of Intermediate representation of Fortran DVM program.
Function in-queue puts information about processed construction input-variable or input-scalar into Input variables queue. This information is used in unit Input files analyser.
Function issump analyses if there is call-external-function in processed operator, and if their is one it generates copy operators into working array of real parameters values of name-variable-on-domain ON domain-of -parameter type and iterated-variable-on-domain ON domain-of-parameter if domain-of-parameter doesn't coincide with definitional domain of variable-on-domain. Copy operators are put into List FORT in the format of Intermediate representation of Fortran DVM program. Names of working arrays are put into Symbol table.
Function issumm analyses if there is call-reduction-function in processed operator and if there is one it generates operators calling reduction-function. In processed operator call of reduction-function of type name-function ( ( name-domain ) arithm-expression ) is substituted for RFi, RFi - name of working variable. Besides additional operator is considered
RFi = name-function ( ( name-domain ) arithm-expression ),
It is realised by Fortran operators which are generated and put into List FORT in the format of Intermediate representation of Fortran DVM program.
If reduction function is executed on the distributed variables then function issumm generates DVM-comment REDUCTION using Table of distribution indexes and puts it into List FORT. Modified operator which hasn't call-reduction-function anymore, is passed to function realop for processing.
Function realop defines the type of operator (scalar operator, ASSUME operator, exit condition of iteration) generates Fortran operators realising this operator and put them into List FORT in the format of Intermediate representation of Fortran DVM program. ASSUME operator is passed to function loopcmc for additional processing.
Function loopcmc is used for generation DVM-comments REMOTE, SHADOW and PARALLEL. This special comments are put down if distributed variable is set in the left part of the operator. This condition is checked using Table of distribution indexes.
DVM-comments REMOTE and SHADOW are generated basing on <statement number> of processed operator, Table of shadow variables and Table of remote variables. DVM-comment PARALLEL is generated using Table of distribution indexes and Table of distributed variables. Special comments are written into List FORT.
5.6.2Iteration node realisation (function gen_iter)
Function gen_iter is used for generating Fortran operators realising construction iteration.
General scheme of fragment of Fortran-program realising construction iteration is represented in Fig 2.
| f | Operators realizing BOUNDARY | |
| f | Operators realising INITIAL | |
| iteration-index=0 | ||
| label iteration-index=iteration-index+1 | ||
| f | Operators realising Iteration Body | |
| IF(exit condition) GOTO label1 | ||
| Rewrite operators | ||
| GOTO label | ||
| label1 CONTINUE |
Fig.2. General scheme of iteration construction realization
General structure of function gen_iter control is given in the following scheme
g
en_iter realise gengr gennzn gentelo1
begkend begkend begkend
Function gen_iter receives <iteration number><parallel layer scheme>as parameters, <parallel layer scheme> determines the order of executing <boundary operators>, <initial operators>, <body operators> of construction iteration.
Function realise chooses iteration-index of processed iteration from Table of iterations structure by <iteration number>, generates Fortran operators for computations written in italics in the scheme, calls functions gengr, gennzn, gentelo1.
Function gengr receives <parallel layer subscheme> as a parameter for <boundary operators> and calls function begkend for realisation of this <parallel layer subscheme>.
Function gennzn receives <parallel layer subscheme> as a parameter for <initial operators> and calls function begkend for realisation of this <parallel layer subscheme>.
Function gentelo1 receives <parallel layer subscheme> as a parameter for <body operators> and calls function begkend for realisation of this <parallel layer subscheme>.
5.6.3Ordered group node realisation (function ms)
Function ms is used for realisation of node <parallel layer scheme> of <MSCS number> type.
General structure of function ms control is given in the following scheme
unction gengr
unction gennzn
unction gentelo1














