cdvmDDe (1158399), страница 5
Текст из файла (страница 5)
ShadowGroupRef sh-group-id;
Note. Source declaration is substituted.
Implementation.
The function ISWFdcltr verifies (besides all) that sh-group-id is declared as void *, and issues a message otherwise.
The function crRef(N,type) changes the type "void*" by the RTL type "ShadowGroupRef".
3.3.4CREATE_SHADOW_GROUP directive
Context and syntax.
DVM(CREATE_SHADOW_GROUP sh-group-id : renewee...);
Proposed compiler output.
DVM_CREATE_SHADOW_GROUP( sh-group-id,
(DVM_SHADOWS(a,k,ls,hs,corner), // for each renewee
...
))
Note. The executable directive is converted to the statement.
Implementation.
The function wfDVMshw() verifies shadow edge width list and issues a message if:
-
ranks mismatch;
-
declared (or default) maximal width is exceeded.
The function wfDVMshad() verifies renewee and issues a message if CORNER is used for 1-D array (warning).
Required subtrees are built by the function wfLX_CRSG. It uses the following functions:
-
Width gets shadow edge width from a directive (or 1 by default);
-
cmpWidth calculates affecting width from the widths, specified in the directive, the declaration, or default one;
-
cSHw builds a comma-list of (low or high) shadow edges;
-
cSG0 builds a macro DVM_SHADOWS for one renewee;
-
cSG builds a list of DVM_SHADOWS for all the renewees.
3.3.5SHADOW_START directive
Context and syntax.
DVM(SHADOW_START sh-group-id);
Proposed compiler output.
DVM_SHADOW_START(sg);
Note. The executable directive is converted to the statement.
Implementation.
The function wfLXIsg verifies sh-group-id and issues a message if it is not defined or not specified as SHADOW_GROUP.
Required subtrees are built by the function wfSHSTART().
3.3.6SHADOW_START clause
Context and syntax.
DVM(PARALLEL ... ; SHADOW_START sh-group-id ... ) ...
Proposed compiler output.
DVM_PAR_SHADOW_START(n,sg); // in loop header
Implementation.
The function wfLXIsg verifies sh-group-id and issues a message if it is not defined or not specified as SHADOW_GROUP.
Required subtrees are built by the function wfSHSTART(). Final tree building is performed by the function Ploop, after the loop is entirely parsed. It inserts early created subtree into appropriate point of a parallel loop shell.
3.3.7SHADOW_WAIT directive
Context and syntax.
DVM(SHADOW_WAIT sh-group-id);
Proposed compiler output.
DVM_SHADOW_WAIT(sg);
Note. The executable directive is converted to the statement.
Implementation.
The function wfLXIsg verifies sh-group-id and issues a message if it is not defined or not specified as SHADOW_GROUP.
Required subtrees are built by the function wfSHWAIT().
3.3.8SHADOW_WAIT clause
Context and syntax.
DVM(PARALLEL ... ; SHADOW_WAIT sh-group-id ...) ...
Proposed compiler output.
DVM_PAR_SHADOW_WAIT(n,sg); // in loop header
Implementation.
The function wfLXIsg verifies sh-group-id and issues a message if it is not defined or not specified as SHADOW_GROUP.
Required subtrees are built by the function wfSHWAIT(). Final tree building is performed by the function Ploop, after the loop is entirely parsed. It inserts early created subtree into appropriate point of a parallel loop shell.
3.4Remote access
3.4.1REMOTE_ACCESS directive and clause
Context and syntax.
DVM(REMOTE_ACCESS ra-reference...)
C-statement
DVM(PARALLEL ... ;
REMOTE_ACCESS [ ra-group : ] ra-reference...
...) ...
ra-reference ::= array [ "["[expr]"]"... ]
Proposed compiler output.
DVM_BLOCK_BEG();
DVM_REMOTE20(arr,buf,k,as,bs);
statements using remote references
DVM_BLOCK_END();
Implementation.
The function wfREMOTE() verifies index expressions and issues a message if they are incorrect. It also keeps information necessary for remote reference recognition and convertion.
Required subtrees are built by the function mk_remote(dir,oper). It uses the functions:
-
mk_rabufid(lx,n) generates an identifier of remote access buffer;
-
mk_radcl(ra) creates declarations of remote access buffers;
-
mk_racrt(ra,rg) creates statements for remote access buffer creation.
3.4.2REMOTE_GROUP directive
Context and syntax.
DVM(REMOTE_GROUP) void * ra-group-id;
Proposed compiler output.
RegularAccessGroupRef ra-group-id;
long RMG_ra-group-id;
Note. Source declaration is substituted. The PREFETCH and RESET operations require a flag variable to control buffer renewing operations.
Implementation.
The function ISWFdcltr verifies (besides all) that ra-group-id is declared as void *, and issues a message otherwise.
The function crRef(N,type) changes the type "void*" by the RTL type "RegularAccessGroupRef" and creates a declaration of flag variable "RMG_...". The function crRMGdcltrs(N) generates a declarator for it.
3.4.3PREFETCH directive
Context and syntax.
DVM(PREFETCH ra-group-id );
Proposed compiler output.
DVM_PREFETCH(rg);
Note. The executable directive is converted to the statement.
Implementation.
The function wfLXIag verifies ra-group-id and issues a message if it is not defined or not specified as REMORE_GROUP.
Required subtrees are built by the function wfPREFETCH().
3.4.4RESET directive
Context and syntax.
DVM(RESET ra-group-id );
Proposed compiler output.
DVM_RESET(rg);
Note. The executable directive is converted to the statement.
Implementation.
The function wfLXIag verifies ra-group-id and issues a message if it is not defined or not specified as REMORE_GROUP.
Required subtrees are built by the function wfRESET().
3.4.5Remote references
Remote references are substituted by references to remote access buffers.
Implementation.
-
The function inRemote() looks for surrounding REMOTE_ACCESS directive;
-
RAfind(N,ra) looks for matching remote reference pattern;
-
RAcmpR(N,ra) compares a reference with the pattern;
-
RAsubstR(N,ra,bufid) creates a reference to the remote access buffer bufid.
3.5Reduction operations
3.5.1REDUCTION_GROUP directive
Context and syntax.
DVM(REDUCTION_GROUP) void * red-group-id;
Proposed compiler output.
RedGroupRef red-group-id;
Note. Source declaration is substituted.
Implementation.
The function ISWFdcltr verifies (besides all) that the red-group-id is declared as void *, and issues a message otherwise.
The function crRef(N,type) changes the type "void*" by the RTL type "RedGroupGroupRef".
3.5.2REDUCTION clause
Context and syntax.
DVM( PARALLEL | TASK_REGION ... ;
REDUCTION [ red-group-id : ] red-operation...
... ) ...
Proposed compiler output.
DVM_CREATE_RG(rg, (
DVM_RVAL(...) | DVM_RLOC(...) // for each operation
...
));
loop creation and mapping
DVM_REDUCTION20(loopid,rg); // insert to the group
loop headers and body
[ DVM_END_REDUCTION(); ] // synchronous reduction
Implementation.
Required subtrees are built by the function wfREDUCTION, namely a list of DVM_RVAR or DVM_RLOC macros for all reduction operations in the directive is created. Final tree building is performed by the function Ploop, after the loop has been entirely parsed. It inserts early created subtree into appropriate point of a parallel loop shell, depending on whether reduction is synchronous or asynchronous.
3.5.3Reduction variables and operations
Context and syntax.
DVM(...; REDUCTION ... MAX(red-var) ... )
DVM(...; REDUCTION ... MIN(red-var) ... )
DVM(...; REDUCTION ... SUM(red-var) ... )
DVM(...; REDUCTION ... PROD(red-var) ... )
DVM(...; REDUCTION ... AND(red-var) ... )
DVM(...; REDUCTION ... OR(red-var) ... )
DVM(...; REDUCTION ... MAXLOC(red-var,loc-var) ... )
DVM(...; REDUCTION ... MINLOC(red-var,loc-var) ... )
Proposed compiler output.
DVM_RVAR(rf_MAX,var,t,l)
DVM_RVAR(rf_MIN,var,t,l)
DVM_RVAR(rf_SUM,var,t,l)
DVM_RVAR(rf_PROD,var,t,l)
DVM_RVAR(rf_AND,var,t,l)
DVM_RVAR(rf_OR,var,t,l)
DVM_RLOC(rf_MAX,var,t,l,loc-var)
DVM_RLOC(rf_MIN,var,t,l,loc-var)
Note. The parameter t is a code of the variable type (rt_INT, rt_LONG, rt_FLOAT, rt_DOUBLE). Parameter l is the number of elements in red-var (if it is an array) or 1.
Implementation.
The function cRG0() creates macro DVM_RVAR or DVM_RLOC for one reduction operation of the list. Its first parameter is RTL's name of the operation which is generated by the function rts_name(t). The function cRG(Ad,N) creates a list of the macros for all operations in a directive.
3.5.4REDUCTION_START directive
Context and syntax.
DVM(REDUCTION_START red-group-id);
Proposed compiler output.
DVM_REDUCTION_START(red-group-id);
Note. The executable directive is converted to the statement.
Implementation.
The function wfLXIrg verifies red-group-id and issues a message if it is not defined or not specified as REDUCTION_GROUP.
Required subtrees are built by the function wfRSTART().
3.5.5REDUCTION_WAIT directive
Context and syntax.
DVM(REDUCTION_WAIT red-group-id);
Proposed compiler output.















