PCSRSCL(l)

πŸ“¦ version 1.5, in ubuntu jammy

✨ PCSRSCL ✨ (the l manual page, LAPACK auxiliary routine, version 1.5)

okay bestie, gather round, because today we're talking about PCSRSCL and honestly? she's lowkey a queen πŸ’…


🌸 NAME 🌸

PCSRSCL β€” she multiplies an N-element complex distributed vector sub( X ) by the real scalar 1/a. that's it. that's the job. slay.


πŸŽ€ SYNOPSIS πŸŽ€

SUBROUTINE PCSRSCL( N, SA, SX, IX, JX, DESCX, INCX )

    INTEGER         IX, INCX, JX, N

    REAL            SA

    INTEGER         DESCX( * )

    COMPLEX         SX( * )

πŸ¦‹ PURPOSE πŸ¦‹

PCSRSCL multiplies an N-element complex distributed vector sub( X ) by the real scalar 1/a. and the way she does it?? no overflow, no underflow β€” as long as the final sub( X )/a itself doesn't overflow or underflow. iconic behaviour fr fr πŸ’–

where sub( X ) means:

  • X(IX:IX+N-1,JX:JX), if INCX = 1
  • X(IX:IX,JX:JX+N-1), if INCX = M_X

πŸ’« Notes πŸ’«

every global data object has a lil bestie called a description vector. this vector stores all the info you need to map an object element to its corresponding process and memory location. it's giving personal assistant energy, honestly.

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 comments below, read the character _ as "of the global array". iykyk.

  • DT_A (global) β€” stored in descA[ DT_ ] β€” the descriptor type. in this case, DT_A = 1.
  • CTXT_A (global) β€” stored in descA[ CTXT_ ] β€” the BLACS context handle, indicating the BLACS process grid A is distributed over. the context itself is global, but the handle (the integer value) may vary.
  • M_A (global) β€” stored in descA[ M_ ] β€” the number of rows in the global array A.
  • N_A (global) β€” stored in descA[ N_ ] β€” the number of columns in the global array A.
  • MB_A (global) β€” stored in descA[ MB_ ] β€” the blocking factor used to distribute the rows of the array.
  • NB_A (global) β€” stored in descA[ NB_ ] β€” the blocking factor used to distribute the columns of the array.
  • RSRC_A (global) β€” stored in descA[ RSRC_ ] β€” the process row over which the first row of the array A is distributed.
  • CSRC_A (global) β€” stored in descA[ CSRC_ ] β€” the process column over which the first column of the array A is distributed.
  • LLD_A (local) β€” stored in 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 its process grid has dimension p x q.

  • LOCr( K ) is the number of elements of K that a process would receive if K were distributed over the p processes of its process column.
  • LOCc( K ) is the number of elements of K that a process would receive if K were distributed over the q processes of its process row.

you can get the values of LOCr() and LOCc() by calling 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 ).

and an upper bound for these quantities can be computed like:

LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A
LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A

because vectors may be seen as particular matrices, a distributed vector is considered to be a distributed matrix. periodt. πŸ’…


πŸ‘‘ ARGUMENTS πŸ‘‘

  • N (global input) pointer to INTEGER β€” the number of components of the distributed vector sub( X ). N >= 0.
  • SA (global input) REAL β€” the scalar a which is used to divide each component of sub( X ).
🚨 bestie listen: SA must be >= 0, or the subroutine will divide by zero. do not do that to her.
  • SX (local input/local output) COMPLEX array β€” contains the local pieces of a distributed matrix of dimension of at least ( (JX-1)*M_X + IX + ( N - 1 )*abs( INCX ) ). this array contains the entries of the distributed vector sub( X ).
  • IX (global input) pointer to INTEGER β€” the global row index of the submatrix of the distributed matrix X to operate on.
  • JX (global input) pointer to INTEGER β€” the global column index of the submatrix of the distributed matrix X to operate on.
  • DESCX (global and local input) INTEGER array of dimension 8 β€” the array descriptor of the distributed matrix X.
  • INCX (global input) pointer to INTEGER β€” the global increment for the elements of X. only two values of INCX are supported in this version, namely 1 and M_X. no other vibes accepted, sorry πŸ’€

LAPACK version 1.5 Β· 12 May 1997

and that's the whole page, bestie 🫢 written back on 12 May 1997 for LAPACK version 1.5 β€” still serving, still iconic, still not dividing by zero. mwah πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from