FDVM_PD (1158350), страница 2
Текст из файла (страница 2)
* creating distributed array
it = crtda(buffer,i0000m,n,...)
. . .
* aligning distributed array
it = align(buffer,iamv,n,...)
* copying distributed arrays
it = arrcpy(array-header,...,buffer,...)
4.3.2 The other FDVM directives
The REDUCTION_GROUP directive is translated into the following code:
* creating reduction group
reduction-group-var = crtrg(...)
{
* creating reduction
irv = crtrgf(reduction-function, reduction-var,...)
* including reduction in reduction group
it = insred(reduction-group-var,irv)
}... for each reduction in reduction-list
* storing values of reduction variables
it = saverv(reduction-group-var)
The REDUCTION_START directive is replaced by the statement:
* starting reduction group
it = strtrd(reduction-group-var)
The REDUCTION_WAIT directive is replaced by the statements:
* waiting for completion of reduction group
it = waitrd(reduction-group-var)
* deleting reduction group
it = delobj(reduction-group-var)
The SHADOW_GROUP directive is translated into the following code:
* creating shadow edge group
shadow-group-var = crtshg(...)
{
* including shadow edge in the group
it = inssh(shadow-group-var,array,...)
}... for each array in renewee-list
The SHADOW_START directive is replaced by the statement:
* starting shadow edge group renewing
it = strtsh(shadow-group-var)
The SHADOW_WAIT directive is replaced by the statement:
* waiting for completion of shadow edge group renewing
it = waitsh(shadow-group-var)
The NEW_VALUE directive affects translating of the next directive (REDISTRIBUTE or REALIGN) and doesn’t require generating new statements. The REDISTRIBUTE and REALIGN directives are implemented accordingly by the redis( ) and realn( ) function. The NewSign flag set to 1 for variables, listed in NEW_VALUE directive.
The Debug Directive.
The DEBUG and ENDDEBUG directives are not executable directives and don’t require generating new statements. They are defined the fragment of program the user would like to get the information about program execution for. These directives are causes resetting compilation mode. The compilation mode depends on debug level, that may be specified for each fragment in compiler run command.
The TRACE ON (TRACE OFF) directive sets on (sets off) tracing of program execution and implemented by tron( )(troff( )) function of LibDVM.
The INTERVAL and END INTERVAL directives intend for description of intervals of the program execution, for which the user would like to get the performance characteristics. The compiler inserts performance analizer calls at the beginning and the end of the interval:
call binter(...)
. . .
call einter(...)
4.3.3 Input/Output Statements
In DVM model, input, output and other operations with external files are executed by single processor ( I/O processor ), which is determined by run-time system. I/O of a replicated variable deals with variable copy allocated on I/O processor. I/O of a distributed array deals with buffer array allocated on I/O processor. Inputted data are sent to all other processors owing the variables of input list. When the distributed array is outputted, data are transferred into the buffer from other processors owing elements of the array.
The FDVM compiler replaces each I/O statement by logical IF statement:
IF(tstio().ne.0 ) I/O-statement
except statement of I/O to internal file that stays unchanged. The function tstio( ) returns 1, if current processor is I/O processor.
Moreover for READ statement and I/O statements with IOSTAT parameter, compiler generates srmem( ) function calls for sending memory areas of I/O processor to other processor.
In case of I/O of distributed array the memory is allocated in user program for buffer I/O.
Let A(N1,N2,...,Nk) is distributed array of rank k, BUF(L) - vector of the same type as array A. Then the compiler replaces a statement I/O of A with the sequence of statements according to the following scheme:
s0 = L
si = [si-1 / Ni] i {1 : k}
n = max(i)
si 0, i{0 : k}
m = 1 (if n = k)
}
DO label In+2 = 0, Nn+2-1. . . n+2 k
DO label Ik = 0, Nk-1
}
DO label In+1 = 0, Nn+1-1, snif (In+1 .LE. Nn+1) then
m = sn n+1 k
else
m = Nn+1 - In+1
endif
input:
IF(tstio( ) .ne. 0 ) READ (...) (BUF(j), j = 1, N1 * ...*Nn * m)
| n 1 |
copying-arrray-section (BUF(1 : N1 * ...*Nl* m),
| n 1 |
A(1: N1,...,1:Nn , In+1 +1: In+1 +m , In+2 +1, ..., Ik +1) )
| n 1 | n+1 k | n+2 k |
output:
copying-arrray-section (BUF(1 : N1 * ...*Nl* m),
n 1
A(1: N1,...,1:Nn , In+1 +1: In+1 +m , In+2 +1, ..., Ik +1) )
| n 1 | n+1 k | n+2 k |
IF(tstio( ) .ne. 0 ) WRITE (...) (BUF(j), j = 1, N1 * ...*Nn * m)
| n 1 |
label CONTINUE
An operation of copying-array-section is implemented by function arrcpy( ).















