SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
All Classes Files Functions Variables Typedefs Macros

◆ psqppiv()

subroutine psqppiv ( integer  m,
integer  n,
real, dimension( * )  a,
integer  ia,
integer  ja,
integer, dimension( * )  desca,
integer, dimension( * )  ipiv 
)

Definition at line 868 of file psqrdriver.f.

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