SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pzqppiv()

subroutine pzqppiv ( integer  m,
integer  n,
complex*16, dimension( * )  a,
integer  ia,
integer  ja,
integer, dimension( * )  desca,
integer, dimension( * )  ipiv 
)

Definition at line 888 of file pzqrdriver.f.

889*
890* -- ScaLAPACK routine (version 1.7) --
891* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
892* and University of California, Berkeley.
893* May 1, 1997
894*
895* .. Scalar Arguments ..
896 INTEGER IA, JA, M, N
897* ..
898* .. Array Arguments ..
899 INTEGER DESCA( * ), IPIV( * )
900 COMPLEX*16 A( * )
901* ..
902*
903* Purpose
904* =======
905*
906* PZQPPIV applies to sub( A ) = A(IA:IA+M-1,JA:JA+N-1) the pivots
907* returned by PZGEQPF in reverse order for checking purposes.
908*
909* Notes
910* =====
911*
912* Each global data object is described by an associated description
913* vector. This vector stores the information required to establish
914* the mapping between an object element and its corresponding process
915* and memory location.
916*
917* Let A be a generic term for any 2D block cyclicly distributed array.
918* Such a global array has an associated description vector DESCA.
919* In the following comments, the character _ should be read as
920* "of the global array".
921*
922* NOTATION STORED IN EXPLANATION
923* --------------- -------------- --------------------------------------
924* DTYPE_A(global) DESCA( DTYPE_ )The descriptor type. In this case,
925* DTYPE_A = 1.
926* CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating
927* the BLACS process grid A is distribu-
928* ted over. The context itself is glo-
929* bal, but the handle (the integer
930* value) may vary.
931* M_A (global) DESCA( M_ ) The number of rows in the global
932* array A.
933* N_A (global) DESCA( N_ ) The number of columns in the global
934* array A.
935* MB_A (global) DESCA( MB_ ) The blocking factor used to distribute
936* the rows of the array.
937* NB_A (global) DESCA( NB_ ) The blocking factor used to distribute
938* the columns of the array.
939* RSRC_A (global) DESCA( RSRC_ ) The process row over which the first
940* row of the array A is distributed.
941* CSRC_A (global) DESCA( CSRC_ ) The process column over which the
942* first column of the array A is
943* distributed.
944* LLD_A (local) DESCA( LLD_ ) The leading dimension of the local
945* array. LLD_A >= MAX(1,LOCr(M_A)).
946*
947* Let K be the number of rows or columns of a distributed matrix,
948* and assume that its process grid has dimension p x q.
949* LOCr( K ) denotes the number of elements of K that a process
950* would receive if K were distributed over the p processes of its
951* process column.
952* Similarly, LOCc( K ) denotes the number of elements of K that a
953* process would receive if K were distributed over the q processes of
954* its process row.
955* The values of LOCr() and LOCc() may be determined via a call to the
956* ScaLAPACK tool function, NUMROC:
957* LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ),
958* LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ).
959* An upper bound for these quantities may be computed by:
960* LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A
961* LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A
962*
963* Arguments
964* =========
965*
966* M (global input) INTEGER
967* The number of rows to be operated on, i.e. the number of rows
968* of the distributed submatrix sub( A ). M >= 0.
969*
970* N (global input) INTEGER
971* The number of columns to be operated on, i.e. the number of
972* columns of the distributed submatrix sub( A ). N >= 0.
973*
974* A (local input/local output) COMPLEX*16 pointer into the
975* local memory to an array of dimension (LLD_A, LOCc(JA+N-1)).
976* On entry, the local pieces of the M-by-N distributed matrix
977* sub( A ) which is to be permuted. On exit, the local pieces
978* of the distributed permuted submatrix sub( A ) * Inv( P ).
979*
980* IA (global input) INTEGER
981* The row index in the global array A indicating the first
982* row of sub( A ).
983*
984* JA (global input) INTEGER
985* The column index in the global array A indicating the
986* first column of sub( A ).
987*
988* DESCA (global and local input) INTEGER array of dimension DLEN_.
989* The array descriptor for the distributed matrix A.
990*
991* IPIV (local input) INTEGER array, dimension LOCc(JA+N-1).
992* On exit, if IPIV(I) = K, the local i-th column of sub( A )*P
993* was the global K-th column of sub( A ). IPIV is tied to the
994* distributed matrix A.
995*
996* =====================================================================
997*
998* .. Parameters ..
999 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
1000 $ LLD_, MB_, M_, NB_, N_, RSRC_
1001 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
1002 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
1003 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
1004* ..
1005* .. Local Scalars ..
1006 INTEGER IACOL, ICOFFA, ICTXT, IITMP, IPVT, IPCOL,
1007 $ IPROW, ITMP, J, JJ, JJA, KK, MYCOL, MYROW,
1008 $ NPCOL, NPROW, NQ
1009* ..
1010* .. External Subroutines ..
1011 EXTERNAL blacs_gridinfo, igebr2d, igebs2d, igerv2d,
1012 $ igesd2d, igamn2d, infog1l, pzswap
1013* ..
1014* .. External Functions ..
1015 INTEGER INDXL2G, NUMROC
1016 EXTERNAL indxl2g, numroc
1017* ..
1018* .. Intrinsic Functions ..
1019 INTRINSIC min, mod
1020* ..
1021* .. Executable Statements ..
1022*
1023* Get grid parameters
1024*
1025 ictxt = desca( ctxt_ )
1026 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1027 CALL infog1l( ja, desca( nb_ ), npcol, mycol, desca( csrc_ ), jja,
1028 $ iacol )
1029 icoffa = mod( ja-1, desca( nb_ ) )
1030 nq = numroc( n+icoffa, desca( nb_ ), mycol, iacol, npcol )
1031 IF( mycol.EQ.iacol )
1032 $ nq = nq - icoffa
1033*
1034 DO 20 j = ja, ja+n-2
1035*
1036 ipvt = ja+n-1
1037 itmp = ja+n
1038*
1039* Find first the local minimum candidate for pivoting
1040*
1041 CALL infog1l( j, desca( nb_ ), npcol, mycol, desca( csrc_ ),
1042 $ jj, iacol )
1043 DO 10 kk = jj, jja+nq-1
1044 IF( ipiv( kk ).LT.ipvt )THEN
1045 iitmp = kk
1046 ipvt = ipiv( kk )
1047 END IF
1048 10 CONTINUE
1049*
1050* Find the global minimum pivot
1051*
1052 CALL igamn2d( ictxt, 'Rowwise', ' ', 1, 1, ipvt, 1, iprow,
1053 $ ipcol, 1, -1, mycol )
1054*
1055* Broadcast the corresponding index to the other process columns
1056*
1057 IF( mycol.EQ.ipcol ) THEN
1058 itmp = indxl2g( iitmp, desca( nb_ ), mycol, desca( csrc_ ),
1059 $ npcol )
1060 CALL igebs2d( ictxt, 'Rowwise', ' ', 1, 1, itmp, 1 )
1061 IF( ipcol.NE.iacol ) THEN
1062 CALL igerv2d( ictxt, 1, 1, ipiv( iitmp ), 1, myrow,
1063 $ iacol )
1064 ELSE
1065 IF( mycol.EQ.iacol )
1066 $ ipiv( iitmp ) = ipiv( jj )
1067 END IF
1068 ELSE
1069 CALL igebr2d( ictxt, 'Rowwise', ' ', 1, 1, itmp, 1, myrow,
1070 $ ipcol )
1071 IF( mycol.EQ.iacol .AND. ipcol.NE.iacol )
1072 $ CALL igesd2d( ictxt, 1, 1, ipiv( jj ), 1, myrow, ipcol )
1073 END IF
1074*
1075* Swap the columns of A
1076*
1077 CALL pzswap( m, a, ia, itmp, desca, 1, a, ia, j, desca, 1 )
1078*
1079 20 CONTINUE
1080*
1081* End of PZQPPIV
1082*
integer function indxl2g(indxloc, nb, iproc, isrcproc, nprocs)
Definition indxl2g.f:2
subroutine infog1l(gindx, nb, nprocs, myroc, isrcproc, lindx, rocsrc)
Definition infog1l.f:3
integer function numroc(n, nb, iproc, isrcproc, nprocs)
Definition numroc.f:2
#define min(A, B)
Definition pcgemr.c:181
Here is the call graph for this function:
Here is the caller graph for this function: