FDVM_DD (1158349), страница 4
Текст из файла (страница 4)
A(I1,I2, ..., IN)
by
N
base(A(N+2) + I1 + A(N-j+2) * Ij )
i=2
where A - distributed array name,
base - i0000m , if A is of type integer
r0000m , if A is of type real
d0000m , if A is of type double precision
c0000m , if A is of type complex
l0000m , if A is of type logical
| SgExpression | *LinearForm | ( | SgSymbol | *ar, | |
| SgExpression | *el | ) | |||
| ar | - pointer to the symbol of distributed array | ||||
| el | - 0, pointer to the subscript list (I1,I2, ..., IN) of array reference | ||||
Generates the expression
A(N+2) + I1 + A(N-j+2) * Ij
where A - distributed array name.
| void | ChangeDistArrayRef | ( | SgExpression | *e ) | ||
| e | - pointer to the expression | |||||
Traverses the expression e and linearizes each distributed array element reference (calls DistArrayRef( )).
| void | ChangeArg_DistArrayRef | ( | SgExpression | *ele ) | ||
| ele | - pointer to the expression that is an actual argument of procedure | |||||
Traverses the expression ele and linearizes distributed array element references, except whole array reference.
| void | DebugVarArrayRef | ( | SgExpression | *e, | ||
| SgStatement | *stmt | ) | ||||
| e | - pointer to the expression | |||||
| stmt | - pointer to the statement that contains the expression e | |||||
The function traverses the expression e and linearizes each distributed array element reference (calling DistArrayRef( )). If compilation mode is set on debugging this function inserts the statements before stmt to check values of the variables during the execution in debugging mode.
| void | DebugVarArrayRef_Left | ( | SgExpression | *e, | ||
| SgStatement | *stmt | ) | ||||
| e | - pointer to the expression in left part of assignment statement | |||||
| stmt | - pointer to the assignment statement that contains the expression e | |||||
The function traverses the expression e and linearizes each distributed array element reference. If compilation mode is set on debugging this function inserts the statements before and after stmt to check values of the variables during the execution in debugging mode.
| void | DebugArg_VarArrayRef | ( | SgExpression | *ele, | ||
| SgStatement | *stmt | ) | ||||
| ele | - pointer to the expression that is an actual argument of procedure | |||||
| stmt | - pointer to the statement that contains the expression e | |||||
The function traverses the expression e and linearizes each distributed array element reference except whole array reference. If compilation mode is set on debugging this function inserts the statements before stmt to check values of the variables during the execution in debugging mode.
4.3 Parallel loop
| void | ParallelLoop | ( | SgStatement | *stmt | ) | |
| stmt | - pointer to the PARALLEL directive | |||||
The regular parallel loop:
*DVM$ PARALLEL (I1, ..., In) ON A(…)...
DO label I1 = ...
. . .
DO label In = ...
loop-body
label CONTINUE
is translated into
[ REDUCTION-block-1 ]
* creating parallel loop
dvm000(ipl) = crtpl(n)
[ SHADOW-RENEW-block-1 ]
[ SHADOW-START-block ]
[ SHADOW-WAIT-block ]
[ REMOTE-ACCESS-block ]
* mapping parallel loop (1)
dvm000(j) = mappl(dvm000(ipl),A,...)
[ SHADOW-RENEW-block-2 ]
* inquiry of continuation of parallel loop execution
lab1 if(dopl(dvm000(ipl)) .eq. 0) go to lab2
DO label I1 = ...
. . .
DO label In = ...
loop-body
label CONTINUE
go to lab1
* terminating parallel loop
lab2 dvm000(k) = endpl(dvm000(ipl))
[ REDUCTION-block-2 ]
The function generates and inserts in procedure all the statements preceding the DO nest. In addition, the initial, end and step value of do-variables in parallel DO-nest are changed. The statements followed end statement of parallel loop:
label CONTINUE
are generated by TransFunc( ) when this statement is processing.
If compilation mode is set on debugging, the CALL statements:
call dbegpl(...)
call diter(...)
call dendl(...)
are created and inserted in block (1) before IF statement, before first statement of parallel loop body ,and after the statement
go to lab1
accordingly.
If compilation mode is set on performance analyzing, the CALL statements:
call bploop(...)
call eloop(...)
are created and inserted before the first and after the last statement of the block (1).
The following functions are called for creating blocks implementing SHADOW_RENEW, REDUCTION, and REMOTE_ACCESS specifications:
ShadowList
ReductionList
RemoteVariableList
| void | ParallelLoop_Debug | ( | SgStatement | *stmt | ) | |
| stmt | - pointer to the PARALLEL directive | |||||
If compilation mode is set on debugging, the CALL statements:
call dbegpl(...)
call diter(...)
are created and inserted before the DO loop nest and before the first statement of parallel loop body accordingly. This function generates the REDUCTION-block-1 if need be.
If compilation mode is set on performance analyzing, the CALL statement:
call bploop(...)
is created and inserted before the DO loop nest.
| void | ReductionList | ( | SgExpression | *el, | ||
| SgStatement | *st, | |||||
| SgExpression | *gref | ) | ||||
| el | - reduction list | |||||
| st | - pointer to the PARALLEL directive with REDUCTION clause or to the REDUCTION_GROUP directive containing the reduction list el | |||||
| gref | - pointer to the reduction group reference expression | |||||
Generates and inserts in procedure the statements:
* creating reduction
dvm000(irv) = crtrgf(reduction-function, red-var,...)
* including reduction in reduction group
dvm000(i) = insred(gref,dvm000(irv))
for each reduction in reduction list and the statement
* storing values of reduction variables
dvm000(j) = saverv(gref)
| void | ShadowList | ( | SgExpression | *el, | ||
| SgStatement | *st, | |||||
| SgExpression | *gref | ) | ||||
| el | - renewee-list | |||||
| st | - pointer to the PARALLEL directive with SHADOW_RENEW clause or to the SHADOW_GROUP directive containing the renewee-list el | |||||
| gref | - pointer to the shadow group reference expression | |||||
Generates and inserts in procedure the statement:
* including shadow edge in the group
dvm000(i) = inssh(gref,array,...)
for each array in the renewee-list.
| void | RemoteVariableList | ( | SgExpression | *rml, | ||
| SgStatement | *stmt | ) | ||||
| rml | - array reference list | |||||
| stmt | - pointer to the PARALLEL directive with REMOTE_ACCESS clause or to the REMOTE_ACCESS directive containing the array reference list rml | |||||
The function generates and inserts in procedure the statements for reading remote data in buffer.
1) In case of one element of array is remote variable the following statement is generated:
* copying of element of distributed array
dvm000(i) = rwelmf(array-header,buffer-var,...)
2) In case of n-dimensional section of array is remote variable the statements for creating distributed buffer array and copying distributed arrays are generated.
*
* creating abstract machine representation
dvm000(iamv) = crtamv(am,n,...)
* mapping abstract machine representation
dvm000(i) = distr(dvm000(iamv),...)
* storing lower bounds of array dimensions in header of
* distributed array
dvm000(j+n+3) = lower-bound-of-1-st-section-dimension
. . .
buffer(j+2*N) = lower-bound-of-n-th-section-dimension















