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

◆ pdqppiv()

subroutine pdqppiv ( integer  m,
integer  n,
double precision, dimension( * )  a,
integer  ia,
integer  ja,
integer, dimension( * )  desca,
integer, dimension( * )  ipiv 
)

Definition at line 867 of file pdqrdriver.f.

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