rtsIDe (1158448), страница 15
Текст из файла (страница 15)
*ShadowGroupRefPtr reference to the shadow edge group.
The function strtsh_ initializes the system renewing buffer (if the shadow edge group is renewed at first time) and starts the shadow edge renewing operation for all shadow edges registered by the function inssh_.
All elements of all processor systems, the arrays, registered in started group, are mapped on, must belong to the current processor system. Shadow edge renewing of specified group can be started only if all previous operations of shadow edge group renewing, imported element receiving and exported element sending are completed by waitsh_ function (see sections 12.4, 12.5 and 12.6).
The function returns zero.
12.4Initializating receiving imported elements of specified shadow edge group
long recvsh_(ShadowGroupRefPtr *ShadowGroupRefPtr);
*ShadowGroupRefPtr reference to a shadow edges group.
All elements of all processor systems the, arrays, registered in started group, are mapped on, must belong to the current processor system. Receiving imported elements of the group can be started only if all previous operations of shadow edge renewing of the group and imported element receiving are completed by waitsh_ (see sections 12.4, 12.5 and 12.6).
Imported element receiving can be performed simultaneously with exported element sending (see section 12.5), but can't be started if exported element sending, initialized by non-current subtask, is not completed yet.
Waiting for completion of receiving imported elements is performed by the function waitsh_ (see section 12.6).
The function returns zero.
12.5Initializing sending exported elements of specified shadow edges group
long sendsh_ (ShadowGroupRefPtr *ShadowGroupRefPtr);
*ShadowGroupRefPtr reference to the shadow edges group.
All elements of all processor systems, the arrays, registered in specified group, are mapped on, must belong to the current processor system. Sending exported elements of the group can be started only if all previous operations of shadow edge renewing of the group and imported element sending are completed by waitsh_ function (see sections 12.4, 12.5 and 12.6).
Exported element sending can be performed simultaneously with imported element receiving (see section 12.4), but can't be started if imported element receiving, initialized by non-current subtask, is not completed yet.
Waiting for completion of sending exported elements is performed by the function waitsh_ (see section 12.6).
The function returns zero.
Note. The sequence of function calls
recvsh_(ShadowGroupRefPtr);
sendsh_(ShadowGroupRefPtr);
is equivalent to the call strtsh_(ShadowGroupRefPtr).
12.6Waiting for completion of shadow edge group renewing
long waitsh_(ShadowGroupRef *ShadowGroupRefPtr);
*ShadowGroupRefPtr reference to the shadow edge group.
The function waitsh_ completes shadow edge renewing operation, initialized by strtsh_ function, and allows to start new shadow edge renewing of the group. The function also performs waiting for completion of imported element receiving and exported elements sending, initialized by recvsh_ or sendsh_ functions (see sections 12.4 and 12.5). After waitsh_ function execution the group becomes opened for distributed arrays including.
Waiting for completion of shadow edge renewing, imported element receiving and exported element sending can be performed only by the subtask, starting the correspondent operation.
The function returns zero.
12.7Deleting shadow edge group
long delshg_(ShadowGroupRef *ShadowGroupRefPtr);
*ShadowGroupRefPtr reference to the shadow edge group.
The function delshg_ deletes the shadow edge group created by the function the crtshg_. After deleting of the group the reference to this group can be used by user program for any goal.
The reduction variable can be deleted by delshg_ function only if it was created in the current subtask and in the current program block (or its sub-block) (see sections 8 and 10). The shadow edge group can't be deleted, if previously started operations of shadow edge renewing, imported element receiving or exported element sending are not completed (see sections 12.4, 12.5 and 12.6).
To delete shadow edge group the function delobj_ can also be used (see section 17.5).
The function returns zero.
13Access to distributed array elements
13.1Coping distributed array element
13.1.1Reading distributed array element and assigning value to element
| long rwelm_( | long | FromArrayHeader[], |
| FromArrayHeader | | the header to the source distributed array or the pointer to the source memory area. |
| ToArrayHeader | | the header to the distributed array, which contains the target element, or the pointer to the target memory area. |
| IndexArray | | array, which i-th element is an index of the source or target element on the (i+1)-th dimension. |
If the function rwelm_ is used to read the element of the distributed array, then:
| FromArrayHeader | | the header of the distributed array containing the source element; |
| ToArrayHeader | | pointer to the target memory area; |
| IndexArray | | array of the indexes of the source element. |
If the function rwelm_ is used to assign the value to the element of the distributed array, then:
| FromArrayHeader | | pointer to the source memory area; |
| ToArrayHeader | | the header of the distributed array, containing the target element; |
| IndexArray | | array of the indexes of the target element. |
Reading is executed on all the processors. Writing (modification of the element of the distributed array) is executed only on the processors, where the element is allocated.
The number of the indexes in the array IndexArray has to be equal to the rank of the source or target array.
Specified in the function call distributed array (read or written) must be mapped in the processor system, which each element must belong to the current processor system.
The function returns the number of bytes actually read or written (that is the element size of the source or target array).
Note. To avoid warnings from Fortran-compiler when the function rwelm_ is called with different types of variables, the distributed array element will be assigned to, Run-Time System provides the function
| long rwelmf_ ( | long | FromArrayHeader[], |
distinguished from the function rwelm_ in the second parameter:
| *ToArrayHeaderPtr | | pointer to a memory area, the distributed array element cast to type AddrType by one of the functions from section 17.7 will be written in. |
Other parameters of the function rwelmf_ are similar to the corresponding parameters of the function rwelm_.
13.1.2Copying one element of distributed array to another
| long copelm_ ( | long | FromArrayHeader[], |
| FromArrayHeader | | the header of the source distributed array. |
| FromIndexArray | | array, which i-th element is the index of the source element on the (i+1)-th dimension. |
| ToArrayHeader | | the header of the target distributed array. |
| ToIndexArray | | array, which j-th element is the index of the target element on the (i+1)-th dimension. |
The types of the source and target elements have to be the same.
As read distributed array as written one must be mapped on the processor systems, which each element must belong to the current processor system.
The function returns the number of the copied bytes.
13.1.3Unified coping of element of distributed array
| long elmcpy_( | long | FromArrayHeader[], |
| FromArrayHeader | | the header of the source distributed array, or the pointer to the source memory area. |
| FromIndexArray | | array, which i-th element is the index of the source element on the (i+1)-th dimension. |
| ToArrayHeader | | the header of the target distributed array. |
| ToIndexArray | | array, which j-th element is the index of the target element on the (i+1)-th dimension. |
| *CopyRegimPtr | | the mode of copying. |
The function elmcpy_ is a generalization of the more specialized functions rwelm_ and copelm_ discussed above.
If FromArrayHeader and ToArrayHeader are the headers of the distributed arrays, then the types of the elements of this arrays have to be the same.
If FromArrayHeader (ToArrayHeader) is the pointer to the memory area, then the values of the array FromIndexArray (ToIndexArray) is ignored. In this case the copying is controlled by the *CopyRegimPtr flag. If *CopyRegimPtr is not equal to zero, then the memory is assumed to be allocated on the I/O processor only. The pointers FromArrayHeader and ToArrayHeader must not be both the pointers to a memory area.
As read distributed array as written one must be mapped on the processor systems, which each element must belong to the current processor system.
The function returns the number of the copied bytes.
13.2Coping distributed arrays
| long arrcpy_( | long | FromArrayHeader[], |
| FromArrayHeader | | the header of the source distributed array. |
| FromInitIndexArray | | array, which i-th element is the initial index value of the (i+1)-th dimension of the source array. |
| FromLastIndexArray | | array, which i-th element is the last index value of the (i+1)-th dimension of the source array. |
| FromStepArray | | array, which i-th element is the step of the index of the (i+1)-th dimension of the source array. |
| ToArrayHeader | | the header of the target distributed array. |
| ToInitIndexArray | | array, which j-th element is the initial index value of the (i+1)-th dimension of the target array. |
| ToLastIndexArray | | array, which j-th element is the last index value of the (i+1)-th dimension of the target array. |
| ToStepArray | | array, which j-th element is the step of the index of the (i+1)-th dimension of the target array. |
| *CopyRegimPtr | | the mode of copying. |
The copying is executed until the exhaustion of the source or target elements. The elements are copied according to the C language discipline of allocating of the elements in the memory, that is the right index is changed more faster then the left one. If the initial value of the index by some dimension of the source or target array is greater or equal to its last value, then the index of this dimension is not changed during copy operation. Note, that Run-Time System considers the last index value of any dimension as a minimum of the defined value in the function call and the real size of this dimension minus 1.















