FDVM_DD (1158349), страница 3
Текст из файла (страница 3)
| void | DeclareVarDVM | ( | SgStatement | *lstat | ) | |
| lstat | - pointer to the statement | |||||
Creates the declaration statements of reserved variables used in procedure:
-
headers of distributed arrays,
-
do-variables of loops implementing I/O of distributed arrays,
-
variables for addressing distributed arrays(DVM memory variables),
-
common block for DVM memory variables,
-
buffer arrays for remote access data,
-
buffer arrays for I/O of distributed arrays,
-
variables of type group (SHADOW_GROUP,REDUCTION_GROUP, so on),
-
array for storing LibDVM function results,
-
LibDVM functions,
and inserts they in procedure after the statement lstat (last declaration statement or the statement preceding DATA statement.
(See TempVarDVM( )).
4.1 Distributed Array Creation and Remapping
| void | GenDistArray | ( | SgSymbol | *das, | |
| int | idisars, | ||||
| SgStatement | *stdis | ) | |||
| das | - pointer to the symbol of distributed array | ||||
| idisars | - the mapping rules (distribution formats) are stored in the elements of reserved array dvm000 : dvm000(idisars), dvm000(idisars+1),... | ||||
| stdis | - pointer to the DISTRIBUTE statement | ||||
Generates the statements to create LibDVM object and allocate a memory for array declared with DISTRIBUTE attribute and for all the arrays immediately or ultimately aligned with it, and inserts these statements before first executable statement of the procedure.
| void | GenAlignArray | ( | align | *node, | |
| align | *root, | ||||
| int | nr, | ||||
| int | iaxis | ) | |||
| node | - pointer to the alignment tree node that corresponds to the aligned array | ||||
| root | - pointer to the alignment tree node that corresponds to the array node is aligned with | ||||
| nr | - the number of aligning rules | ||||
| iaxis | - the aligning rules (AxisArray(nr), CoefArray(nr), ConstArray(nr)) are stored in the elements of reserved array dvm000 : dvm000(iaxis), dvm000(iaxis+1),... | ||||
Generates the statements to create LibDVM object and allocate a memory for array declared with ALIGN attribute and inserts these statements before first executable statement of the procedure.
| void | doAlignRule_1 | ( | int | rank | ) |
| rank | - rank of array | ||||
Generates the statements to initialize 3 arrays of aligning rules:
AxisArray(i) = 1
CoeffArray(i) = 1
ConstArray(i) = 1 , i=1, rank
that are used as arguments of align( ) LibDVM function.
| int | doAlignRule | ( | SgSymbol | *alignee, | |
| SgStatement | *algn_st, | ||||
| int | iaxis | ) | |||
| alignee | - pointer to the symbol of aligned array | ||||
| algn_st | - pointer to the ALIGN statement | ||||
| iaxis | - index of reserved array dvm000 | ||||
The function generates the statements to create arrays of aligning rules that are used as arguments of align( ) LibDVM function.
The function returns the number of aligning rules (the length of align-source-list in ALIGN directive).
| void | AlignTree | ( | align | *root | ) |
| root | - pointer to the alignment tree root | ||||
Traverses the alignment tree and calls the function GenAlignArray() for creating distributed array for each aligned array (node of tree).
| int | doDisRuleArrays | ( | SgExpression | *dist_format, | ||
| SgExpression | *aster | ) | ||||
| dist_format | - distribution format list | |||||
| aster | - pointer to the expression * or null pointer | |||||
The function generates the statements to create 2 arrays of mapping rules that are used as arguments (AxisArray, DistrParamArray) of distr( ) and redis( ) LibDVM functions.
The function returns the index of array dvm000 element storing the first mapping rule (AxisArray(1)).
| void | RedistributeArray | ( | SgSymbol | *das, | |
| int | idisars, | ||||
| int | sign, | ||||
| SgStatement | *stdis | ) | |||
| das | - pointer to the symbol of redistributed array | ||||
| idisars | - the mapping rules (distribution formats) are stored in the elements of reserved array dvm000 : dvm000(idisars), dvm000(idisars+1),... | ||||
| sign | - the flag that defines whether to update contents of redistributed array or not | ||||
| stdis | - pointer to the REDISTRIBUTE directive | ||||
Generates statement to redistribute array:
dvm000(i) = redis(...)
and inserts it in procedure in place of REDISTRIBUTE directive.
| void | RealignArray | ( | SgSymbol | *als, | |
| SgSymbol | *tgs, | ||||
| int | iaxis, | ||||
| int | nr, | ||||
| int | new_sign, | ||||
| SgStatement | *stal | ) | |||
| als | - pointer to the symbol of realigned array | ||||
| tgs | - pointer to the symbol of the alignment target array | ||||
| iaxis | - the aligning rules are stored in the elements of reserved array dvm000 : dvm000(iaxis), dvm000(iaxis+1),... | ||||
| nr | - the number of aligning rules | ||||
| new_sign | - the flag that defines whether to update contents of realigned array or not | ||||
| stal | - pointer to the REALIGN directive | ||||
Generates statement to realign the array:
dvm000(i) = realn(...)
and inserts it in procedure in place of REALIGN directive.
| void | AllocateArray | ( | SgStatement | *stmt, | |
| distribute_list | *distr | ) | |||
| stmt | - pointer to the statement of ALLOCATE function call | ||||
| distribute_list | - DISTRIBUTE directive list | ||||
If the POINTER variable in left part of assignment statement stmt has DISTRIBUTE attribute then AllocDistArray( ) function is called else AllocAlignArray( ) function is called.
| void | AllocateDistArray | ( | SgSymbol | *p, | |
| SgExpression | *desc, | ||||
| SgStatement | *stdis, | ||||
| SgStatement | *stmt | ) | |||
| p | - pointer to the symbol of POINTER variable | ||||
| desc | - pointer to the descriptor reference expression (descriptor - vector of the dimension sizes of dynamic array) | ||||
| stdis | - pointer to the DISTRIBUTE directive specifying p | ||||
| stmt | - pointer to the statement of ALLOCATE function call: p = ALLOCATE(desc,...) | ||||
Generates the statements to create LibDVM object and allocate a memory for dynamic array declared with DISTRIBUTE attribute and for all the arrays immediately or ultimately aligned with it, and inserts these statements in procedure in place of statement stmt.
| void | AllocateAlignArray | ( | SgSymbol | *p, | |
| SgExpression | *desc, | ||||
| SgStatement | *stdis, | ||||
| SgStatement | *stmt | ) | |||
| p | - pointer to the symbol of POINTER variable | ||||
| desc | - pointer to the descriptor reference expression (descriptor - vector of the dimension sizes of dynamic array) | ||||
| stmt | - pointer to the statement of ALLOCATE function call: p = ALLOCATE(desc,...) | ||||
The function generates the statements for creating distributed array declared with ALIGN and POINTER attributes and for the arrays aligned with it , and inserts these statements in procedure in place of statement stmt.
AlignTreeAlloc( ) and AlignAllocArray( ) are called.
| void | AlignTreeAlloc | ( | align | *root | ) |
| root | - pointer to the alignment tree root | ||||
Traverses the alignment tree and calls the function AlignAllocArray() to create distributed arrays for the nodes of tree that are corresponds to the aligned arrays not having POINTER attribute.
| void | AlignAllocArray | ( | align | *node, | |
| align | *root, | ||||
| int | nr, | ||||
| int | iaxis, | ||||
| SgExpression | *desc | ) | |||
| node | - pointer to the alignment tree node that corresponds to the aligned array with attribute POINTER | ||||
| root | - pointer to the alignment tree node that corresponds to the array node is aligned with | ||||
| nr | - the number of the aligning rules | ||||
| iaxis | - the aligning rules (AxisArray(nr), CoefArray(nr), ConstArray(nr)) are stored in the elements of reserved array dvm000 : dvm000(iaxis), dvm000(iaxis+1),... | ||||
| desc | - pointer to the descriptor reference expression (descriptor - vector of the dimension sizes of dynamic array) | ||||
Generates the statements to create LibDVM object and allocate a memory for dynamic array declared with ALIGN attribute and inserts these statements in procedure in place of statement pointer = ALLOCATE(desc,...).
| void | ArrayHeader | ( | SgSymbol | *ar, | |
| int | ind | ) | |||
| ar | - pointer to the symbol of array | ||||
| ind | - 0, if ar is POINTER | ||||
| 1, if ar is distributed array | |||||
| n, where dvm000(n)is element storing pointer to the abstract machine representation, if ar is TEMPLATE | |||||
Adds the attribute (ARRAY_HEADER) to the symbol of distributed object ar (ind - is value of attribute).
4.2 Distributed array referencing
| void | DistArrayRef | ( | SgExpression | *e ) | ||
| e | - pointer to the array reference expression | |||||
Linearizes distributed array element reference, that is, replaces reference















