PSROT(3) ScaLAPACK routine of NEC Numeric Library Collection PSROT(3) NAME PSROT - applies a planar rotation defined by CS and SN to the two dis- tributed vectors sub(X) and sub(Y) SYNOPSIS SUBROUTINE PSROT( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY, CS, SN, WORK, LWORK, INFO ) INTEGER N, IX, JX, INCX, IY, JY, INCY, LWORK, INFO REAL CS, SN INTEGER DESCX( * ), DESCY( * ) REAL X( * ), Y( * ), WORK( * ) PURPOSE PSROT applies a planar rotation defined by CS and SN to the two dis- tributed vectors sub(X) and sub(Y). Notes ===== Each global data object is described by an associated description vec- tor. This vector stores the information required to establish the map- ping between an object element and its corresponding process and memory location. Let A be a generic term for any 2D block cyclicly distributed array. Such a global array has an associated description vector DESCA. In the following comments, the character _ should be read as "of the global array". NOTATION STORED IN EXPLANATION --------------- -------------- -------------------------------------- DTYPE_A(global) DESCA( DTYPE_ )The descriptor type. In this case, DTYPE_A = 1. CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating the BLACS process grid A is distribu- ted over. The context itself is glo- bal, but the handle (the integer value) may vary. M_A (global) DESCA( M_ ) The number of rows in the global array A. N_A (global) DESCA( N_ ) The number of columns in the global array A. MB_A (global) DESCA( MB_ ) The blocking factor used to distribute the rows of the array. NB_A (global) DESCA( NB_ ) The blocking factor used to distribute the columns of the array. RSRC_A (global) DESCA( RSRC_ ) The process row over which the first row of the array A is distributed. CSRC_A (global) DESCA( CSRC_ ) The process column over which the first column of the array A is distributed. LLD_A (local) DESCA( LLD_ ) The leading dimension of the local array. LLD_A >= MAX(1,LOCr(M_A)). Let K be the number of rows or columns of a distributed matrix, and assume that its process grid has dimension p x q. LOCr( K ) denotes the number of elements of K that a process would receive if K were distributed over the p processes of its process col- umn. Similarly, LOCc( K ) denotes the number of elements of K that a process would receive if K were distributed over the q processes of its process row. The values of LOCr() and LOCc() may be determined via a call to the ScaLAPACK tool function, NUMROC: LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ), LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ). An upper bound for these quantities may be computed by: LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A ARGUMENTS N (global input) INTEGER The number of elements to operate on when applying the planar rotation to X and Y. N>=0. X (local input/local output) REAL PRECSION array of dimension ( (JX-1)*M_X + IX + ( N - 1 )*abs( INCX ) ) This array contains the entries of the distributed vector sub( X ). IX (global input) INTEGER The global row index of the submatrix of the distributed matrix X to operate on. If INCX = 1, then it is required that IX = IY. 1 <= IX <= M_X. JX (global input) INTEGER The global column index of the submatrix of the distributed matrix X to operate on. If INCX = M_X, then it is required that JX = JY. 1 <= IX <= N_X. DESCX (global and local input) INTEGER array of dimension 9 The array descriptor of the distributed matrix X. INCX (global input) INTEGER The global increment for the elements of X. Only two values of INCX are supported in this version, namely 1 and M_X. Moreover, it must hold that INCX = M_X if INCY = M_Y and that INCX = 1 if INCY = 1. Y (local input/local output) REAL PRECSION array of dimension ( (JY-1)*M_Y + IY + ( N - 1 )*abs( INCY ) ) This array contains the entries of the distributed vector sub( Y ). IY (global input) INTEGER The global row index of the submatrix of the distributed matrix Y to operate on. If INCY = 1, then it is required that IY = IX. 1 <= IY <= M_Y. JY (global input) INTEGER The global column index of the submatrix of the distributed matrix Y to operate on. If INCY = M_X, then it is required that JY = JX. 1 <= JY <= N_Y. DESCY (global and local input) INTEGER array of dimension 9 The array descriptor of the distributed matrix Y. INCY (global input) INTEGER The global increment for the elements of Y. Only two values of INCY are supported in this version, namely 1 and M_Y. Moreover, it must hold that INCY = M_Y if INCX = M_X and that INCY = 1 if INCX = 1. CS (global input) REAL SN (global input) REAL The parameters defining the properties of the planar rotation. It must hold that 0 <= CS,SN <= 1 and that SN**2 + CS**2 = 1. The latter is hardly checked in finite precision arithmetics. WORK (local input) REAL array of dimension LWORK Local workspace area. LWORK (local input) INTEGER The length of the workspace array WORK. If INCX = 1 and INCY = 1, then LWORK = 2*MB_X If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the IWORK array, and no error message related to LIWORK is issued by PXERBLA. INFO (global output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. If the i-th argument is an array and the j-entry had an illegal value, then INFO = -(i*100+j), if the i-th argument is a scalar and had an illegal value, then INFO = -i. Additional requirements ======================= The following alignment requirements must hold: (a) DESCX( MB_ ) = DESCY( MB_ ) and DESCX( NB_ ) = DESCY( NB_ ) (b) DESCX( RSRC_ ) = DESCY( RSRC_ ) (c) DESCX( CSRC_ ) = DESCY( CSRC_ ) ScaLAPACK routine 31 October 2017 PSROT(3)