1 SUBROUTINE pzoptee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
9 INTEGER ICTXT, NOUT, SCODE
156 IF( scode.EQ.21 )
THEN
161 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
163 ELSE IF( scode.EQ.22 .OR. scode.EQ.25 .OR. scode.EQ.26 .OR.
169 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
171 ELSE IF( scode.EQ.23 )
THEN
176 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
181 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
186 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'D', apos )
190 ELSE IF( scode.EQ.31 )
THEN
195 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
200 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'B', apos )
202 ELSE IF( scode.EQ.32 )
THEN
207 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'S', apos )
212 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
214 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 .OR. scode.EQ.35 .OR.
215 $ scode.EQ.36 .OR. scode.EQ.40 )
THEN
220 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
225 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
227 ELSE IF( scode.EQ.38 )
THEN
232 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'S', apos )
237 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
242 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
247 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'D', apos )
250 ELSE IF( scode.EQ.39 )
THEN
255 CALL pzchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
264 SUBROUTINE pzchkopt( ICTXT, NOUT, SUBPTR, SCODE, SNAME, ARGNAM,
274 INTEGER ARGPOS, ICTXT, NOUT, SCODE
399 CHARACTER DIAG, SIDE, TRANSA, TRANSB, UPLO
400 COMMON /pblasc/diag, side, transa, transb, uplo
408 IF( lsame( argnam,
'D' ) )
THEN
414 ELSE IF( lsame( argnam,
'S' ) )
THEN
420 ELSE IF( lsame( argnam,
'A' ) )
THEN
426 ELSE IF( lsame( argnam,
'B' ) )
THEN
432 ELSE IF( lsame( argnam,
'U' ) )
THEN
447 CALL pchkpbe( ictxt, nout, sname, infot )
454 SUBROUTINE pzdimee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
462 INTEGER ICTXT, NOUT, SCODE
609 IF( scode.EQ.11 .OR. scode.EQ.12 .OR. scode.EQ.13 .OR.
610 $ scode.EQ.14 .OR. scode.EQ.15 )
THEN
615 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
619 ELSE IF( scode.EQ.21 )
THEN
624 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
629 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
631 ELSE IF( scode.EQ.22 .OR. scode.EQ.25 .OR. scode.EQ.26 .OR.
637 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
639 ELSE IF( scode.EQ.23 )
THEN
644 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
646 ELSE IF( scode.EQ.24 )
THEN
651 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
656 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
660 ELSE IF( scode.EQ.31 )
THEN
665 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
670 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
675 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'K', apos )
677 ELSE IF( scode.EQ.32 )
THEN
682 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
687 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
689 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 .OR. scode.EQ.35 .OR.
695 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
700 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'K', apos )
702 ELSE IF( scode.EQ.37 )
THEN
707 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
712 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
714 ELSE IF( scode.EQ.38 )
THEN
719 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
724 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
726 ELSE IF( scode.EQ.39 )
THEN
731 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
736 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
738 ELSE IF( scode.EQ.40 )
THEN
743 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
748 CALL pzchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
757 SUBROUTINE pzchkdim( ICTXT, NOUT, SUBPTR, SCODE, SNAME, ARGNAM,
767 INTEGER ARGPOS, ICTXT, NOUT, SCODE
892 INTEGER KDIM, MDIM, NDIM
893 COMMON /PBLASN/KDIM, MDIM, NDIM
901 IF( lsame( argnam,
'M' ) )
THEN
907 ELSE IF( lsame( argnam,
'N' ) )
THEN
928 CALL pchkpbe( ictxt, nout, sname, infot )
935 SUBROUTINE pzvecee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
943 INTEGER ICTXT, NOUT, SCODE
1092 IF( scode.EQ.11 )
THEN
1097 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1102 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1104 ELSE IF( scode.EQ.12 .OR. scode.EQ.15 )
THEN
1109 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1111 ELSE IF( scode.EQ.13 )
THEN
1116 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1121 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1123 ELSE IF( scode.EQ.14 )
THEN
1128 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1132 ELSE IF( scode.EQ.21 )
THEN
1137 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1142 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1144 ELSE IF( scode.EQ.22 )
THEN
1149 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1154 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1156 ELSE IF( scode.EQ.23 )
THEN
1161 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1163 ELSE IF( scode.EQ.24 .OR. scode.EQ.27 )
THEN
1168 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1173 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1175 ELSE IF( scode.EQ.26 .OR. scode.EQ.27 )
THEN
1180 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1189 SUBROUTINE pzmatee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
1197 INTEGER ICTXT, NOUT, SCODE
1346 IF( scode.EQ.21 .OR. scode.EQ.23 )
THEN
1351 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1353 ELSE IF( scode.EQ.22 )
THEN
1358 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1360 ELSE IF( scode.EQ.24 .OR. scode.EQ.27 )
THEN
1365 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1367 ELSE IF( scode.EQ.25 .OR. scode.EQ.26 )
THEN
1372 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1376 ELSE IF( scode.EQ.31 )
THEN
1381 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1386 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1391 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1393 ELSE IF( scode.EQ.32 .OR. scode.EQ.35 .OR. scode.EQ.36 )
THEN
1398 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1403 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1408 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1410 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 )
THEN
1415 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1420 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1422 ELSE IF( scode.EQ.37 )
THEN
1427 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1432 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1434 ELSE IF( scode.EQ.38 )
THEN
1439 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1444 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1446 ELSE IF( scode.EQ.39 )
THEN
1451 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1456 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1458 ELSE IF( scode.EQ.40 )
THEN
1463 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1468 CALL pzchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1570 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1571 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
1573 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
1574 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1575 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1576 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1577 DOUBLE PRECISION RONE
1579 parameter( one = ( 1.0d+0, 0.0d+0 ),
1586 CHARACTER*1 DIAG, SIDE, TRANSA, TRANSB, UPLO
1587 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
1588 $ jc, jx, jy, kdim, mdim, ndim
1589 DOUBLE PRECISION USCLR
1591 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
1592 $ descx( dlen_ ), descy( dlen_ )
1593 COMPLEX*16 A( 2, 2 ), B( 2, 2 ), C( 2, 2 ), X( 2 ), Y( 2 )
1594 COMMON /PBLASC/DIAG, SIDE, TRANSA, TRANSB, UPLO
1595 COMMON /pblasd/desca, descb, descc, descx, descy
1596 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
1597 $ ja, jb, jc, jx, jy
1598 COMMON /pblasm/a, b, c
1599 COMMON /pblasn/kdim, mdim, ndim
1600 COMMON /pblass/sclr, usclr
1630 CALL pb_descset2( desca, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1640 CALL pb_descset2( descb, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1650 CALL pb_descset2( descc, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1658 CALL pb_descset2( descx, 2, 1, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1667 CALL pb_descset2( descy, 2, 1, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1675 SUBROUTINE pzchkmat( ICTXT, NOUT, SUBPTR, SCODE, SNAME, ARGNAM,
1685 INTEGER ARGPOS, ICTXT, NOUT, SCODE
1801 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1802 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
1804 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
1805 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1806 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1807 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1809 PARAMETER ( DESCMULT = 100 )
1812 INTEGER I, INFOT, NPROW, NPCOL, MYROW, MYCOL
1822 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
1824 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
1825 $ descx( dlen_ ), descy( dlen_ )
1826 COMMON /pblasd/desca, descb, descc, descx, descy
1827 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
1828 $ ja, jb, jc, jx, jy
1832 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1834 IF( lsame( argnam,
'A' ) )
THEN
1842 CALL pchkpbe( ictxt, nout, sname, infot )
1850 CALL pchkpbe( ictxt, nout, sname, infot )
1860 infot = ( ( argpos + 3 ) * descmult ) + i
1862 CALL pchkpbe( ictxt, nout, sname, infot )
1866 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1867 $ ( i.EQ.lld_ ) )
THEN
1874 $ desca( i ) = nprow
1879 $ desca( i ) = npcol
1883 IF( i.EQ.lld_ )
THEN
1884 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
1891 infot = ( ( argpos + 3 ) * descmult ) + i
1893 CALL pchkpbe( ictxt, nout, sname, infot )
1899 ELSE IF( lsame( argnam,
'B' ) )
THEN
1907 CALL pchkpbe( ictxt, nout, sname, infot )
1915 CALL pchkpbe( ictxt, nout, sname, infot )
1925 infot = ( ( argpos + 3 ) * descmult ) + i
1927 CALL pchkpbe( ictxt, nout, sname, infot )
1931 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1932 $ ( i.EQ.lld_ ) )
THEN
1939 $ descb( i ) = nprow
1944 $ descb( i ) = npcol
1948 IF( i.EQ.lld_ )
THEN
1949 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
1956 infot = ( ( argpos + 3 ) * descmult ) + i
1958 CALL pchkpbe( ictxt, nout, sname, infot )
1964 ELSE IF( lsame( argnam,
'C' ) )
THEN
1972 CALL pchkpbe( ictxt, nout, sname, infot )
1980 CALL pchkpbe( ictxt, nout, sname, infot )
1990 infot = ( ( argpos + 3 ) * descmult ) + i
1992 CALL pchkpbe( ictxt, nout, sname, infot )
1996 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1997 $ ( i.EQ.lld_ ) )
THEN
2004 $ descc( i ) = nprow
2009 $ descc( i ) = npcol
2013 IF( i.EQ.lld_ )
THEN
2014 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2021 infot = ( ( argpos + 3 ) * descmult ) + i
2023 CALL pchkpbe( ictxt, nout, sname, infot )
2029 ELSE IF( lsame( argnam,
'X' ) )
THEN
2037 CALL pchkpbe( ictxt, nout, sname, infot )
2045 CALL pchkpbe( ictxt, nout, sname, infot )
2055 infot = ( ( argpos + 3 ) * descmult ) + i
2057 CALL pchkpbe( ictxt, nout, sname, infot )
2061 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
2062 $ ( i.EQ.lld_ ) )
THEN
2069 $ descx( i ) = nprow
2074 $ descx( i ) = npcol
2078 IF( i.EQ.lld_ )
THEN
2079 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2086 infot = ( ( argpos + 3 ) * descmult ) + i
2088 CALL pchkpbe( ictxt, nout, sname, infot )
2100 CALL pchkpbe( ictxt, nout, sname, infot )
2110 CALL pchkpbe( ictxt, nout, sname, infot )
2118 CALL pchkpbe( ictxt, nout, sname, infot )
2128 infot = ( ( argpos + 3 ) * descmult ) + i
2130 CALL pchkpbe( ictxt, nout, sname, infot )
2134 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
2135 $ ( i.EQ.lld_ ) )
THEN
2142 $ descy( i ) = nprow
2147 $ descy( i ) = npcol
2151 IF( i.EQ.lld_ )
THEN
2152 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2159 infot = ( ( argpos + 3 ) * descmult ) + i
2161 CALL pchkpbe( ictxt, nout, sname, infot )
2173 CALL pchkpbe( ictxt, nout, sname, infot )
2311 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2312 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2314 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
2315 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2316 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2317 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2320 CHARACTER*1 DIAG, SIDE, TRANSA, TRANSB, UPLO
2321 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
2322 $ JC, JX, JY, KDIM, MDIM, NDIM
2323 DOUBLE PRECISION USCLR
2325 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
2326 $ descx( dlen_ ), descy( dlen_ )
2327 COMPLEX*16 A( 2, 2 ), B( 2, 2 ), C( 2, 2 ), X( 2 ), Y( 2 )
2328 COMMON /pblasc/diag, side, transa, transb, uplo
2329 COMMON /pblasd/desca, descb, descc, descx, descy
2330 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
2331 $ ja, jb, jc, jx, jy
2332 COMMON /pblasm/a, b, c
2333 COMMON /pblasn/kdim, mdim, ndim
2334 COMMON /pblass/sclr, usclr
2341 IF( scode.EQ.11 )
THEN
2343 CALL subptr( ndim, x, ix, jx, descx, incx, y, iy, jy, descy,
2346 ELSE IF( scode.EQ.12 )
THEN
2348 CALL subptr( ndim, sclr, x, ix, jx, descx, incx )
2350 ELSE IF( scode.EQ.13 )
THEN
2352 CALL subptr( ndim, sclr, x, ix, jx, descx, incx, y, iy, jy,
2355 ELSE IF( scode.EQ.14 )
THEN
2357 CALL subptr( ndim, sclr, isclr, x, ix, jx, descx, incx )
2359 ELSE IF( scode.EQ.15 )
THEN
2361 CALL subptr( ndim, usclr, x, ix, jx, descx, incx )
2365 ELSE IF( scode.EQ.21 )
THEN
2367 CALL subptr( transa, mdim, ndim, sclr, a, ia, ja, desca, x, ix,
2368 $ jx, descx, incx, sclr, y, iy, jy, descy, incy )
2370 ELSE IF( scode.EQ.22 )
THEN
2372 CALL subptr( uplo, ndim, sclr, a, ia, ja, desca, x, ix, jx,
2373 $ descx, incx, sclr, y, iy, jy, descy, incy )
2375 ELSE IF( scode.EQ.23 )
THEN
2377 CALL subptr( uplo, transa, diag, ndim, a, ia, ja, desca, x, ix,
2380 ELSE IF( scode.EQ.24 )
THEN
2382 CALL subptr( mdim, ndim, sclr, x, ix, jx, descx, incx, y, iy,
2383 $ jy, descy, incy, a, ia, ja, desca )
2385 ELSE IF( scode.EQ.25 )
THEN
2387 CALL subptr( uplo, ndim, sclr, x, ix, jx, descx, incx, a, ia,
2390 ELSE IF( scode.EQ.26 )
THEN
2392 CALL subptr( uplo, ndim, usclr, x, ix, jx, descx, incx, a, ia,
2395 ELSE IF( scode.EQ.27 )
THEN
2397 CALL subptr( uplo, ndim, sclr, x, ix, jx, descx, incx, y, iy,
2398 $ jy, descy, incy, a, ia, ja, desca )
2402 ELSE IF( scode.EQ.31 )
THEN
2404 CALL subptr( transa, transb, mdim, ndim, kdim, sclr, a, ia, ja,
2405 $ desca, b, ib, jb, descb, sclr, c, ic, jc, descc )
2407 ELSE IF( scode.EQ.32 )
THEN
2409 CALL subptr( side, uplo, mdim, ndim, sclr, a, ia, ja, desca, b,
2410 $ ib, jb, descb, sclr, c, ic, jc, descc )
2412 ELSE IF( scode.EQ.33 )
THEN
2414 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2415 $ sclr, c, ic, jc, descc )
2417 ELSE IF( scode.EQ.34 )
THEN
2419 CALL subptr( uplo, transa, ndim, kdim, usclr, a, ia, ja, desca,
2420 $ usclr, c, ic, jc, descc )
2422 ELSE IF( scode.EQ.35 )
THEN
2424 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2425 $ b, ib, jb, descb, sclr, c, ic, jc, descc )
2427 ELSE IF( scode.EQ.36 )
THEN
2429 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2430 $ b, ib, jb, descb, usclr, c, ic, jc, descc )
2432 ELSE IF( scode.EQ.37 )
THEN
2434 CALL subptr( mdim, ndim, sclr, a, ia, ja, desca, sclr, c, ic,
2437 ELSE IF( scode.EQ.38 )
THEN
2439 CALL subptr( side, uplo, transa, diag, mdim, ndim, sclr, a, ia,
2440 $ ja, desca, b, ib, jb, descb )
2442 ELSE IF( scode.EQ.39 )
THEN
2444 CALL subptr( transa, mdim, ndim, sclr, a, ia, ja, desca, sclr,
2445 $ c, ic, jc, descc )
2447 ELSE IF( scode.EQ.40 )
THEN
2449 CALL subptr( uplo, transa, mdim, ndim, sclr, a, ia, ja, desca,
2450 $ sclr, c, ic, jc, descc )
2459 SUBROUTINE pzerrset( ERR, ERRMAX, XTRUE, X )
2467 DOUBLE PRECISION ERR, ERRMAX
2562 DOUBLE PRECISION PDDIFF
2566 INTRINSIC abs, dble, dimag,
max
2570 err = abs( pddiff( dble( xtrue ), dble( x ) ) )
2571 err =
max( err, abs( pddiff( dimag( xtrue ), dimag( x ) ) ) )
2573 errmax =
max( errmax, err )
2580 SUBROUTINE pzchkvin( ERRMAX, N, X, PX, IX, JX, DESCX, INCX,
2589 INTEGER INCX, INFO, IX, JX, N
2590 DOUBLE PRECISION ERRMAX
2594 COMPLEX*16 PX( * ), X( * )
2718 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2719 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2721 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
2722 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2723 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2724 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2725 DOUBLE PRECISION ZERO
2726 PARAMETER ( ZERO = 0.0d+0 )
2729 LOGICAL COLREP, ROWREP
2730 INTEGER I, IB, ICTXT, ICURCOL, ICURROW, IIX, IN, IXCOL,
2731 $ IXROW, J, JB, JJX, JN, KK, LDPX, LDX, LL,
2732 $ MYCOL, MYROW, NPCOL, NPROW
2733 DOUBLE PRECISION ERR, EPS
2739 DOUBLE PRECISION PDLAMCH
2743 INTRINSIC abs, dble, dimag,
max,
min, mod
2755 ictxt = descx( ctxt_ )
2756 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
2758 eps = pdlamch( ictxt,
'eps' )
2760 CALL pb_infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix,
2761 $ jjx, ixrow, ixcol )
2764 ldpx = descx( lld_ )
2765 rowrep = ( ixrow.EQ.-1 )
2766 colrep = ( ixcol.EQ.-1 )
2770 IF( ( myrow.EQ.ixrow .OR. rowrep ) .AND.
2771 $ ( mycol.EQ.ixcol .OR. colrep ) )
2772 $
CALL pzerrset( err, errmax, x( ix+(jx-1)*ldx ),
2773 $ px( iix+(jjx-1)*ldpx ) )
2775 ELSE IF( incx.EQ.descx( m_ ) )
THEN
2779 jb = descx( inb_ ) - jx + 1
2781 $ jb = ( ( -jb ) / descx( nb_ ) + 1 ) * descx( nb_ ) + jb
2785 IF( myrow.EQ.ixrow .OR. rowrep )
THEN
2788 IF( mycol.EQ.icurcol .OR. colrep )
THEN
2790 CALL pzerrset( err, errmax, x( ix+(j-1)*ldx ),
2791 $ px( iix+(jjx-1)*ldpx ) )
2795 icurcol = mod( icurcol+1, npcol )
2797 DO 30 j = jn+1, jx+n-1, descx( nb_ )
2798 jb =
min( jx+n-j, descx( nb_ ) )
2800 IF( mycol.EQ.icurcol .OR. colrep )
THEN
2803 CALL pzerrset( err, errmax, x( ix+(j+kk-1)*ldx ),
2804 $ px( iix+(jjx+kk-1)*ldpx ) )
2811 icurcol = mod( icurcol+1, npcol )
2821 ib = descx( imb_ ) - ix + 1
2823 $ ib = ( ( -ib ) / descx( mb_ ) + 1 ) * descx( mb_ ) + ib
2827 IF( mycol.EQ.ixcol .OR. colrep )
THEN
2830 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
2832 CALL pzerrset( err, errmax, x( i+(jx-1)*ldx ),
2833 $ px( iix+(jjx-1)*ldpx ) )
2837 icurrow = mod( icurrow+1, nprow )
2839 DO 60 i = in+1, ix+n-1, descx( mb_ )
2840 ib =
min( ix+n-i, descx( mb_ ) )
2842 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
2845 CALL pzerrset( err, errmax, x( i+kk+(jx-1)*ldx ),
2846 $ px( iix+kk+(jjx-1)*ldpx ) )
2853 icurrow = mod( icurrow+1, nprow )
2861 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
2864 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
2866 ELSE IF( errmax.GT.eps )
THEN
2875 SUBROUTINE pzchkvout( N, X, PX, IX, JX, DESCX, INCX, INFO )
2883 INTEGER INCX, INFO, IX, JX, N
2887 COMPLEX*16 PX( * ), X( * )
3007 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3008 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3010 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3011 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3012 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3013 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3014 DOUBLE PRECISION ZERO
3015 PARAMETER ( ZERO = 0.0d+0 )
3018 LOGICAL COLREP, ROWREP
3019 INTEGER I, IB, ICTXT, ICURCOL, ICURROW, II, IMBX, INBX,
3020 $ J, JB, JJ, KK, LDPX, LDX, LL, MBX, MPALL,
3021 $ MYCOL, MYCOLDIST, MYROW, MYROWDIST, NBX, NPCOL,
3023 DOUBLE PRECISION EPS, ERR, ERRMAX
3026 EXTERNAL BLACS_GRIDINFO, DGAMX2D, PZERRSET
3030 DOUBLE PRECISION PDLAMCH
3031 EXTERNAL PDLAMCH, PB_NUMROC
3034 INTRINSIC abs, dble, dimag,
max,
min, mod
3043 IF( ( descx( m_ ).LE.0 ).OR.( descx( n_ ).LE.0 ) )
3048 ictxt = descx( ctxt_ )
3049 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3051 eps = pdlamch( ictxt,
'eps' )
3053 mpall = pb_numroc( descx( m_ ), 1, descx( imb_ ), descx( mb_ ),
3054 $ myrow, descx( rsrc_ ), nprow )
3055 nqall = pb_numroc( descx( n_ ), 1, descx( inb_ ), descx( nb_ ),
3056 $ mycol, descx( csrc_ ), npcol )
3061 ldpx = descx( lld_ )
3062 icurrow = descx( rsrc_ )
3063 icurcol = descx( csrc_ )
3064 rowrep = ( icurrow.EQ.-1 )
3065 colrep = ( icurcol.EQ.-1 )
3066 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3067 imbx = descx( imb_ )
3071 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3072 inbx = descx( inb_ )
3079 myrowdist = mod( myrow - icurrow + nprow, nprow )
3084 mycoldist = mod( mycol - icurcol + npcol, npcol )
3089 IF( incx.EQ.descx( m_ ) )
THEN
3093 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3096 IF( mycoldist.EQ.0 )
THEN
3099 j = descx( inb_ ) + ( mycoldist - 1 ) * nbx + 1
3101 jb =
min(
max( 0, descx( n_ ) - j + 1 ), inbx )
3102 ib =
min( descx( m_ ), descx( imb_ ) )
3106 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR. j+kk.GT.jx+n-1 )
3107 $
CALL pzerrset( err, errmax,
3108 $ x( i+ll+(j+kk-1)*ldx ),
3109 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3115 j = j + inbx + ( npcol - 1 ) * nbx
3118 DO 50 jj = inbx+1, nqall, nbx
3119 jb =
min( nqall-jj+1, nbx )
3123 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3125 $
CALL pzerrset( err, errmax,
3126 $ x( i+ll+(j+kk-1)*ldx ),
3127 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3143 icurrow = mod( icurrow + 1, nprow )
3145 DO 110 i = descx( imb_ ) + 1, descx( m_ ), mbx
3146 ib =
min( descx( m_ ) - i + 1, mbx )
3148 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3150 IF( mycoldist.EQ.0 )
THEN
3153 j = descx( inb_ ) + ( mycoldist - 1 ) * nbx + 1
3157 jb =
min(
max( 0, descx( n_ ) - j + 1 ), inbx )
3160 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3162 $
CALL pzerrset( err, errmax,
3163 $ x( i+ll+(j+kk-1)*ldx ),
3164 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3170 j = j + inbx + ( npcol - 1 ) * nbx
3173 DO 100 jj = inbx+1, nqall, nbx
3174 jb =
min( nqall-jj+1, nbx )
3178 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3180 $
CALL pzerrset( err, errmax,
3181 $ x( i+ll+(j+kk-1)*ldx ),
3182 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3198 icurrow = mod( icurrow + 1, nprow )
3206 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3209 IF( myrowdist.EQ.0 )
THEN
3212 i = descx( imb_ ) + ( myrowdist - 1 ) * mbx + 1
3214 ib =
min(
max( 0, descx( m_ ) - i + 1 ), imbx )
3215 jb =
min( descx( n_ ), descx( inb_ ) )
3219 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR. i+ll.GT.ix+n-1 )
3220 $
CALL pzerrset( err, errmax,
3221 $ x( i+ll+(j+kk-1)*ldx ),
3222 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3228 i = i + imbx + ( nprow - 1 ) * mbx
3231 DO 160 ii = imbx+1, mpall, mbx
3232 ib =
min( mpall-ii+1, mbx )
3236 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3238 $
CALL pzerrset( err, errmax,
3239 $ x( i+ll+(j+kk-1)*ldx ),
3240 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3256 icurcol = mod( icurcol + 1, npcol )
3258 DO 220 j = descx( inb_ ) + 1, descx( n_ ), nbx
3259 jb =
min( descx( n_ ) - j + 1, nbx )
3261 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3263 IF( myrowdist.EQ.0 )
THEN
3266 i = descx( imb_ ) + ( myrowdist - 1 ) * mbx + 1
3270 ib =
min(
max( 0, descx( m_ ) - i + 1 ), imbx )
3273 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3275 $
CALL pzerrset( err, errmax,
3276 $ x( i+ll+(j+kk-1)*ldx ),
3277 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3283 i = i + imbx + ( nprow - 1 ) * mbx
3286 DO 210 ii = imbx+1, mpall, mbx
3287 ib =
min( mpall-ii+1, mbx )
3291 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3293 $
CALL pzerrset( err, errmax,
3294 $ x( i+ll+(j+kk-1)*ldx ),
3295 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3311 icurcol = mod( icurcol + 1, npcol )
3317 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3320 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3322 ELSE IF( errmax.GT.eps )
THEN
3331 SUBROUTINE pzchkmin( ERRMAX, M, N, A, PA, IA, JA, DESCA, INFO )
3339 INTEGER IA, INFO, JA, M, N
3340 DOUBLE PRECISION ERRMAX
3344 COMPLEX*16 PA( * ), A( * )
3467 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3468 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3470 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3471 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3472 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3473 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3474 DOUBLE PRECISION ZERO
3475 PARAMETER ( ZERO = 0.0d+0 )
3478 LOGICAL COLREP, ROWREP
3479 INTEGER H, I, IACOL, IAROW, IB, ICTXT, ICURCOL,
3480 $ ICURROW, II, IIA, IN, J, JB, JJ, JJA, JN, K,
3481 $ KK, LDA, LDPA, LL, MYCOL, MYROW, NPCOL, NPROW
3482 DOUBLE PRECISION ERR, EPS
3488 DOUBLE PRECISION PDLAMCH
3492 INTRINSIC abs, dble, dimag,
max,
min, mod
3501 IF( ( m.EQ.0 ).OR.( n.EQ.0 ) )
3506 ictxt = desca( ctxt_ )
3507 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3509 eps = pdlamch( ictxt,
'eps' )
3511 CALL pb_infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia,
3512 $ jja, iarow, iacol )
3517 ldpa = desca( lld_ )
3520 rowrep = ( iarow.EQ.-1 )
3521 colrep = ( iacol.EQ.-1 )
3525 jb = desca( inb_ ) - ja + 1
3527 $ jb = ( ( -jb ) / desca( nb_ ) + 1 ) * desca( nb_ ) + jb
3531 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3534 ib = desca( imb_ ) - ia + 1
3536 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
3539 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3541 CALL pzerrset( err, errmax, a( ia+k+(ja+h-1)*lda ),
3542 $ pa( ii+k+(jj+h-1)*ldpa ) )
3546 icurrow = mod( icurrow+1, nprow )
3550 DO 30 i = in+1, ia+m-1, desca( mb_ )
3551 ib =
min( desca( mb_ ), ia+m-i )
3552 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3554 CALL pzerrset( err, errmax, a( i+k+(ja+h-1)*lda ),
3555 $ pa( ii+k+(jj+h-1)*ldpa ) )
3559 icurrow = mod( icurrow+1, nprow )
3570 icurcol = mod( icurcol+1, npcol )
3574 DO 90 j = jn+1, ja+n-1, desca( nb_ )
3575 jb =
min( desca( nb_ ), ja+n-j )
3576 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3578 ib = desca( imb_ ) - ia + 1
3580 $ ib = ( ( -ib ) / desca( mb_ ) + 1 )*desca( mb_ ) + ib
3583 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3585 CALL pzerrset( err, errmax, a( ia+k+(j+h-1)*lda ),
3586 $ pa( ii+k+(jj+h-1)*ldpa ) )
3590 icurrow = mod( icurrow+1, nprow )
3594 DO 70 i = in+1, ia+m-1, desca( mb_ )
3595 ib =
min( desca( mb_ ), ia+m-i )
3596 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3599 $ a( i+k+(j+h-1)*lda ),
3600 $ pa( ii+k+(jj+h-1)*ldpa ) )
3604 icurrow = mod( icurrow+1, nprow )
3614 icurcol = mod( icurcol+1, npcol )
3618 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3621 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3623 ELSE IF( errmax.GT.eps )
THEN
3632 SUBROUTINE pzchkmout( M, N, A, PA, IA, JA, DESCA, INFO )
3640 INTEGER IA, INFO, JA, M, N
3644 COMPLEX*16 A( * ), PA( * )
3763 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3764 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3766 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3767 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3768 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3769 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3770 DOUBLE PRECISION ZERO
3771 PARAMETER ( ZERO = 0.0d+0 )
3774 LOGICAL COLREP, ROWREP
3775 INTEGER I, IB, ICTXT, ICURCOL, II, IMBA, J, JB, JJ, KK,
3776 $ LDA, LDPA, LL, MPALL, MYCOL, MYROW, MYROWDIST,
3778 DOUBLE PRECISION EPS, ERR, ERRMAX
3781 EXTERNAL blacs_gridinfo, dgamx2d,
pzerrset
3785 DOUBLE PRECISION PDLAMCH
3786 EXTERNAL PDLAMCH, PB_NUMROC
3798 IF( ( desca( m_ ).LE.0 ).OR.( desca( n_ ).LE.0 ) )
3803 ictxt = desca( ctxt_ )
3804 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3806 eps = pdlamch( ictxt,
'eps' )
3808 mpall = pb_numroc( desca( m_ ), 1, desca( imb_ ), desca( mb_ ),
3809 $ myrow, desca( rsrc_ ), nprow )
3812 ldpa = desca( lld_ )
3816 rowrep = ( desca( rsrc_ ).EQ.-1 )
3817 colrep = ( desca( csrc_ ).EQ.-1 )
3818 icurcol = desca( csrc_ )
3819 IF( myrow.EQ.desca( rsrc_ ) .OR. rowrep )
THEN
3820 imba = desca( imb_ )
3827 myrowdist = mod( myrow - desca( rsrc_ ) + nprow, nprow )
3830 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3833 IF( myrowdist.EQ.0 )
THEN
3836 i = desca( imb_ ) + ( myrowdist - 1 ) * desca( mb_ ) + 1
3838 ib =
min(
max( 0, desca( m_ ) - i + 1 ), imba )
3839 jb =
min( desca( n_ ), desca( inb_ ) )
3843 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3844 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3845 $
CALL pzerrset( err, errmax, a( i+ll+(j+kk-1)*lda ),
3846 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3852 i = i + imba + ( nprow - 1 ) * desca( mb_ )
3855 DO 50 ii = imba + 1, mpall, desca( mb_ )
3856 ib =
min( mpall-ii+1, desca( mb_ ) )
3860 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3861 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3863 $ a( i+ll+(j+kk-1)*lda ),
3864 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3869 i = i + desca( mb_ )
3871 i = i + nprow * desca( mb_ )
3880 icurcol = mod( icurcol + 1, npcol )
3882 DO 110 j = desca( inb_ ) + 1, desca( n_ ), desca( nb_ )
3883 jb =
min( desca( n_ ) - j + 1, desca( nb_ ) )
3885 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3887 IF( myrowdist.EQ.0 )
THEN
3890 i = desca( imb_ ) + ( myrowdist - 1 ) * desca( mb_ ) + 1
3894 ib =
min(
max( 0, desca( m_ ) - i + 1 ), imba )
3897 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3898 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3900 $ a( i+ll+(j+kk-1)*lda ),
3901 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3907 i = i + imba + ( nprow - 1 ) * desca( mb_ )
3910 DO 100 ii = imba+1, mpall, desca( mb_ )
3911 ib =
min( mpall-ii+1, desca( mb_ ) )
3915 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3916 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3918 $ a( i+ll+(j+kk-1)*lda ),
3919 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3924 i = i + desca( mb_ )
3926 i = i + nprow * desca( mb_ )
3935 icurcol = mod( icurcol + 1, npcol )
3939 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3942 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3944 ELSE IF( errmax.GT.eps )
THEN
3953 SUBROUTINE pzmprnt( ICTXT, NOUT, M, N, A, LDA, IRPRNT, ICPRNT,
3962 INTEGER ICPRNT, ICTXT, IRPRNT, LDA, M, N, NOUT
3965 CHARACTER*(*) CMATNM
3966 COMPLEX*16 A( LDA, * )
4022 INTEGER I, J, MYCOL, MYROW, NPCOL, NPROW
4025 EXTERNAL BLACS_GRIDINFO
4028 INTRINSIC dble, dimag
4034 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
4039 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4041 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
4043 WRITE( nout, fmt = * )
4048 WRITE( nout, fmt = 9999 ) cmatnm, i, j,
4049 $ dble( a( i, j ) ), dimag( a( i, j ) )
4057 9999
FORMAT( 1x, a,
'(', i6,
',', i6,
')=', d30.18,
'+i*(',
4065 SUBROUTINE pzvprnt( ICTXT, NOUT, N, X, INCX, IRPRNT, ICPRNT,
4074 INTEGER ICPRNT, ICTXT, INCX, IRPRNT, N, NOUT
4077 CHARACTER*(*) CVECNM
4131 INTEGER I, MYCOL, MYROW, NPCOL, NPROW
4134 EXTERNAL BLACS_GRIDINFO
4137 INTRINSIC dble, dimag
4148 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4150 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
4152 WRITE( nout, fmt = * )
4153 DO 10 i = 1, 1 + ( n-1 )*incx, incx
4155 WRITE( nout, fmt = 9999 ) cvecnm, i, dble( x( i ) ),
4162 9999
FORMAT( 1x, a,
'(', i6,
')=', d30.18,
'+i*(', d30.18,
')' )
4169 SUBROUTINE pzmvch( ICTXT, TRANS, M, N, ALPHA, A, IA, JA, DESCA,
4170 $ X, IX, JX, DESCX, INCX, BETA, Y, PY, IY, JY,
4171 $ DESCY, INCY, G, ERR, INFO )
4180 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4182 DOUBLE PRECISION ERR
4183 COMPLEX*16 ALPHA, BETA
4186 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4187 DOUBLE PRECISION G( * )
4188 COMPLEX*16 A( * ), PY( * ), X( * ), Y( * )
4369 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
4370 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
4372 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
4373 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
4374 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
4375 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
4376 DOUBLE PRECISION RZERO, RONE
4377 parameter( rzero = 0.0d+0, rone = 1.0d+0 )
4378 COMPLEX*16 ZERO, ONE
4379 PARAMETER ( ZERO = ( 0.0d+0, 0.0d+0 ),
4380 $ one = ( 1.0d+0, 0.0d+0 ) )
4383 LOGICAL COLREP, CTRAN, ROWREP, TRAN
4384 INTEGER I, IB, ICURCOL, ICURROW, IIY, IN, IOFFA, IOFFX,
4385 $ ioffy, iycol, iyrow, j, jb, jjy, jn, kk, lda,
4386 $ ldpy, ldx, ldy, ml, mycol, myrow, nl, npcol,
4388 DOUBLE PRECISION EPS, ERRI, GTMP
4389 COMPLEX*16 C, TBETA, YTMP
4392 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
4396 DOUBLE PRECISION PDLAMCH
4397 EXTERNAL lsame, pdlamch
4400 INTRINSIC abs, dble, dconjg, dimag,
max,
min, mod, sqrt
4403 DOUBLE PRECISION ABS1
4404 abs1( c ) = abs( dble( c ) ) + abs( dimag( c ) )
4408 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4410 eps = pdlamch( ictxt,
'eps' )
4412 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
4418 tran = lsame( trans,
'T' )
4419 ctran = lsame( trans,
'C' )
4420 IF( tran.OR.ctran )
THEN
4428 lda =
max( 1, desca( m_ ) )
4429 ldx =
max( 1, descx( m_ ) )
4430 ldy =
max( 1, descy( m_ ) )
4436 ioffy = iy + ( jy - 1 ) * ldy
4440 ioffx = ix + ( jx - 1 ) * ldx
4442 ioffa = ia + ( ja + i - 2 ) * lda
4444 ytmp = ytmp + a( ioffa ) * x( ioffx )
4445 gtmp = gtmp + abs1( a( ioffa ) ) * abs1( x( ioffx ) )
4447 ioffx = ioffx + incx
4449 ELSE IF( ctran )
THEN
4450 ioffa = ia + ( ja + i - 2 ) * lda
4452 ytmp = ytmp + dconjg( a( ioffa ) ) * x( ioffx )
4453 gtmp = gtmp + abs1( a( ioffa ) ) * abs1( x( ioffx ) )
4455 ioffx = ioffx + incx
4458 ioffa = ia + i - 1 + ( ja - 1 ) * lda
4460 ytmp = ytmp + a( ioffa ) * x( ioffx )
4461 gtmp = gtmp + abs1( a( ioffa ) ) * abs1( x( ioffx ) )
4463 ioffx = ioffx + incx
4466 g( i ) = abs1( alpha )*gtmp + abs1( tbeta )*abs1( y( ioffy ) )
4467 y( ioffy ) = alpha * ytmp + tbeta * y( ioffy )
4468 ioffy = ioffy + incy
4475 ldpy = descy( lld_ )
4476 ioffy = iy + ( jy - 1 ) * ldy
4477 CALL pb_infog2l( iy, jy, descy, nprow, npcol, myrow, mycol, iiy,
4478 $ jjy, iyrow, iycol )
4481 rowrep = ( iyrow.EQ.-1 )
4482 colrep = ( iycol.EQ.-1 )
4484 IF( incy.EQ.descy( m_ ) )
THEN
4488 jb = descy( inb_ ) - jy + 1
4490 $ jb = ( ( -jb ) / descy( nb_ ) + 1 ) * descy( nb_ ) + jb
4496 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4497 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4498 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) ) / eps
4499 IF( g( j-jy+1 ).NE.rzero )
4500 $ erri = erri / g( j-jy+1 )
4501 err =
max( err, erri )
4502 IF( err*sqrt( eps ).GE.rone )
4507 ioffy = ioffy + incy
4511 icurcol = mod( icurcol+1, npcol )
4513 DO 70 j = jn+1, jy+ml-1, descy( nb_ )
4514 jb =
min( jy+ml-j, descy( nb_ ) )
4518 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4519 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4520 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) )/eps
4521 IF( g( j+kk-jy+1 ).NE.rzero )
4522 $ erri = erri / g( j+kk-jy+1 )
4523 err =
max( err, erri )
4524 IF( err*sqrt( eps ).GE.rone )
4529 ioffy = ioffy + incy
4533 icurcol = mod( icurcol+1, npcol )
4541 ib = descy( imb_ ) - iy + 1
4543 $ ib = ( ( -ib ) / descy( mb_ ) + 1 ) * descy( mb_ ) + ib
4549 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4550 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4551 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) ) / eps
4552 IF( g( i-iy+1 ).NE.rzero )
4553 $ erri = erri / g( i-iy+1 )
4554 err =
max( err, erri )
4555 IF( err*sqrt( eps ).GE.rone )
4560 ioffy = ioffy + incy
4564 icurrow = mod( icurrow+1, nprow )
4566 DO 100 i = in+1, iy+ml-1, descy( mb_ )
4567 ib =
min( iy+ml-i, descy( mb_ ) )
4571 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4572 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4573 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) )/eps
4574 IF( g( i+kk-iy+1 ).NE.rzero )
4575 $ erri = erri / g( i+kk-iy+1 )
4576 err =
max( err, erri )
4577 IF( err*sqrt( eps ).GE.rone )
4582 ioffy = ioffy + incy
4586 icurrow = mod( icurrow+1, nprow )
4594 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
4595 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
4603 SUBROUTINE pzvmch( ICTXT, TRANS, UPLO, M, N, ALPHA, X, IX, JX,
4604 $ DESCX, INCX, Y, IY, JY, DESCY, INCY, A, PA,
4605 $ IA, JA, DESCA, G, ERR, INFO )
4613 CHARACTER*1 TRANS, UPLO
4614 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4616 DOUBLE PRECISION ERR
4620 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4621 DOUBLE PRECISION G( * )
4622 COMPLEX*16 A( * ), PA( * ), X( * ), Y( * )
4805 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
4806 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
4808 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
4809 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
4810 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
4811 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
4812 DOUBLE PRECISION ZERO, ONE
4813 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
4816 LOGICAL COLREP, CTRAN, LOWER, ROWREP, UPPER
4817 INTEGER I, IACOL, IAROW, IB, IBEG, ICURROW, IEND, IIA,
4818 $ in, ioffa, ioffx, ioffy, j, jja, kk, lda, ldpa,
4819 $ ldx, ldy, mycol, myrow, npcol, nprow
4820 DOUBLE PRECISION EPS, ERRI, GTMP
4824 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
4828 DOUBLE PRECISION PDLAMCH
4829 EXTERNAL LSAME, PDLAMCH
4832 INTRINSIC abs, dble, dconjg, dimag,
max,
min, mod, sqrt
4835 DOUBLE PRECISION ABS1
4836 ABS1( C ) = abs( dble( c ) ) + abs( dimag( c ) )
4840 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4842 eps = pdlamch( ictxt,
'eps' )
4844 ctran = lsame( trans,
'C' )
4845 upper = lsame( uplo,
'U' )
4846 lower = lsame( uplo,
'L' )
4848 lda =
max( 1, desca( m_ ) )
4849 ldx =
max( 1, descx( m_ ) )
4850 ldy =
max( 1, descy( m_ ) )
4858 ioffy = iy + ( jy - 1 ) * ldy + ( j - 1 ) * incy
4866 ELSE IF( upper )
THEN
4877 DO 30 i = ibeg, iend
4879 ioffx = ix + ( jx - 1 ) * ldx + ( i - 1 ) * incx
4880 ioffa = ia + i - 1 + ( ja + j - 2 ) * lda
4882 atmp = x( ioffx ) * dconjg( y( ioffy ) )
4884 atmp = x( ioffx ) * y( ioffy )
4886 gtmp = abs1( x( ioffx ) ) * abs1( y( ioffy ) )
4887 g( i ) = abs1( alpha ) * gtmp + abs1( a( ioffa ) )
4888 a( ioffa ) = alpha * atmp + a( ioffa )
4896 ldpa = desca( lld_ )
4897 ioffa = ia + ( ja + j - 2 ) * lda
4898 CALL pb_infog2l( ia, ja+j-1, desca, nprow, npcol, myrow, mycol,
4899 $ iia, jja, iarow, iacol )
4900 rowrep = ( iarow.EQ.-1 )
4901 colrep = ( iacol.EQ.-1 )
4903 IF( mycol.EQ.iacol .OR. colrep )
THEN
4906 ib = desca( imb_ ) - ia + 1
4908 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
4914 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
4915 erri = abs( pa( iia+(jja-1)*ldpa ) - a( ioffa ) )/eps
4916 IF( g( i-ia+1 ).NE.zero )
4917 $ erri = erri / g( i-ia+1 )
4918 err =
max( err, erri )
4919 IF( err*sqrt( eps ).GE.one )
4928 icurrow = mod( icurrow+1, nprow )
4930 DO 60 i = in+1, ia+m-1, desca( mb_ )
4931 ib =
min( ia+m-i, desca( mb_ ) )
4935 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
4936 erri = abs( pa( iia+(jja-1)*ldpa )-a( ioffa ) )/eps
4937 IF( g( i+kk-ia+1 ).NE.zero )
4938 $ erri = erri / g( i+kk-ia+1 )
4939 err =
max( err, erri )
4940 IF( err*sqrt( eps ).GE.one )
4949 icurrow = mod( icurrow+1, nprow )
4957 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
4958 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
4972 SUBROUTINE pzvmch2( ICTXT, UPLO, M, N, ALPHA, X, IX, JX, DESCX,
4973 $ INCX, Y, IY, JY, DESCY, INCY, A, PA, IA,
4974 $ JA, DESCA, G, ERR, INFO )
4983 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4985 DOUBLE PRECISION ERR
4989 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4990 DOUBLE PRECISION G( * )
4991 COMPLEX*16 A( * ), PA( * ), X( * ), Y( * )
5166 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5167 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5169 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5170 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5171 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5172 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5173 DOUBLE PRECISION ZERO, ONE
5174 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
5177 LOGICAL COLREP, LOWER, ROWREP, UPPER
5178 INTEGER I, IACOL, IAROW, IB, IBEG, ICURROW, IEND, IIA,
5179 $ IN, IOFFA, IOFFXI, IOFFXJ, IOFFYI, IOFFYJ, J,
5180 $ JJA, KK, LDA, LDPA, LDX, LDY, MYCOL, MYROW,
5182 DOUBLE PRECISION EPS, ERRI, GTMP
5186 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
5190 DOUBLE PRECISION PDLAMCH
5191 EXTERNAL LSAME, PDLAMCH
5194 INTRINSIC abs, dble, dconjg, dimag,
max,
min, mod, sqrt
5197 DOUBLE PRECISION ABS1
5198 abs1( c ) = abs( dble( c ) ) + abs( dimag( c ) )
5202 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5204 eps = pdlamch( ictxt,
'eps' )
5206 upper = lsame( uplo,
'U' )
5207 lower = lsame( uplo,
'L' )
5209 lda =
max( 1, desca( m_ ) )
5210 ldx =
max( 1, descx( m_ ) )
5211 ldy =
max( 1, descy( m_ ) )
5219 ioffxj = ix + ( jx - 1 ) * ldx + ( j - 1 ) * incx
5220 ioffyj = iy + ( jy - 1 ) * ldy + ( j - 1 ) * incy
5228 ELSE IF( upper )
THEN
5239 DO 30 i = ibeg, iend
5240 ioffa = ia + i - 1 + ( ja + j - 2 ) * lda
5241 ioffxi = ix + ( jx - 1 ) * ldx + ( i - 1 ) * incx
5242 ioffyi = iy + ( jy - 1 ) * ldy + ( i - 1 ) * incy
5243 atmp = alpha * x( ioffxi ) * dconjg( y( ioffyj ) )
5244 atmp = atmp + y( ioffyi ) * dconjg( alpha * x( ioffxj ) )
5245 gtmp = abs1( alpha * x( ioffxi ) ) * abs1( y( ioffyj ) )
5246 gtmp = gtmp + abs1( y( ioffyi ) ) *
5247 $ abs1( dconjg( alpha * x( ioffxj ) ) )
5248 g( i ) = gtmp + abs1( a( ioffa ) )
5249 a( ioffa ) = a( ioffa ) + atmp
5257 ldpa = desca( lld_ )
5258 ioffa = ia + ( ja + j - 2 ) * lda
5259 CALL pb_infog2l( ia, ja+j-1, desca, nprow, npcol, myrow, mycol,
5260 $ iia, jja, iarow, iacol )
5261 rowrep = ( iarow.EQ.-1 )
5262 colrep = ( iacol.EQ.-1 )
5264 IF( mycol.EQ.iacol .OR. colrep )
THEN
5267 ib = desca( imb_ ) - ia + 1
5269 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
5275 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5276 erri = abs( pa( iia+(jja-1)*ldpa ) - a( ioffa ) )/eps
5277 IF( g( i-ia+1 ).NE.zero )
5278 $ erri = erri / g( i-ia+1 )
5279 err =
max( err, erri )
5280 IF( err*sqrt( eps ).GE.one )
5289 icurrow = mod( icurrow+1, nprow )
5291 DO 60 i = in+1, ia+m-1, desca( mb_ )
5292 ib =
min( ia+m-i, desca( mb_ ) )
5296 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5297 erri = abs( pa( iia+(jja-1)*ldpa )-a( ioffa ) )/eps
5298 IF( g( i+kk-ia+1 ).NE.zero )
5299 $ erri = erri / g( i+kk-ia+1 )
5300 err =
max( err, erri )
5301 IF( err*sqrt( eps ).GE.one )
5310 icurrow = mod( icurrow+1, nprow )
5318 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
5319 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5333 SUBROUTINE pzmmch( ICTXT, TRANSA, TRANSB, M, N, K, ALPHA, A, IA,
5334 $ JA, DESCA, B, IB, JB, DESCB, BETA, C, PC, IC,
5335 $ JC, DESCC, CT, G, ERR, INFO )
5343 CHARACTER*1 TRANSA, TRANSB
5344 INTEGER IA, IB, IC, ICTXT, INFO, JA, JB, JC, K, M, N
5345 DOUBLE PRECISION ERR
5346 COMPLEX*16 ALPHA, BETA
5349 INTEGER DESCA( * ), DESCB( * ), DESCC( * )
5350 DOUBLE PRECISION G( * )
5351 COMPLEX*16 A( * ), B( * ), C( * ), CT( * ), PC( * )
5527 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5528 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5530 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5531 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5532 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5533 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5534 DOUBLE PRECISION RZERO, RONE
5535 PARAMETER ( RZERO = 0.0d+0, rone = 1.0d+0 )
5537 PARAMETER ( ZERO = ( 0.0d+0, 0.0d+0 ) )
5540 LOGICAL COLREP, CTRANA, CTRANB, ROWREP, TRANA, TRANB
5541 INTEGER I, IBB, ICCOL, ICROW, ICURROW, IIC, IN, IOFFA,
5542 $ IOFFB, IOFFC, J, JJC, KK, LDA, LDB, LDC, LDPC,
5543 $ MYCOL, MYROW, NPCOL, NPROW
5544 DOUBLE PRECISION EPS, ERRI
5548 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
5552 DOUBLE PRECISION PDLAMCH
5553 EXTERNAL LSAME, PDLAMCH
5556 INTRINSIC abs, dble, dconjg, dimag,
max,
min, mod, sqrt
5559 DOUBLE PRECISION ABS1
5560 ABS1( Z ) = abs( dble( z ) ) + abs( dimag( z ) )
5564 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5566 eps = pdlamch( ictxt,
'eps' )
5568 trana = lsame( transa,
'T' ).OR.lsame( transa,
'C' )
5569 tranb = lsame( transb,
'T' ).OR.lsame( transb,
'C' )
5570 ctrana = lsame( transa,
'C' )
5571 ctranb = lsame( transb,
'C' )
5573 lda =
max( 1, desca( m_ ) )
5574 ldb =
max( 1, descb( m_ ) )
5575 ldc =
max( 1, descc( m_ ) )
5583 ioffc = ic + ( jc + j - 2 ) * ldc
5589 IF( .NOT.trana .AND. .NOT.tranb )
THEN
5591 ioffb = ib + kk - 1 + ( jb + j - 2 ) * ldb
5593 ioffa = ia + i - 1 + ( ja + kk - 2 ) * lda
5594 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5595 g( i ) = g( i ) + abs( a( ioffa ) ) *
5599 ELSE IF( trana .AND. .NOT.tranb )
THEN
5602 ioffb = ib + kk - 1 + ( jb + j - 2 ) * ldb
5604 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5605 ct( i ) = ct( i ) + dconjg( a( ioffa ) ) *
5607 g( i ) = g( i ) + abs1( a( ioffa ) ) *
5608 $ abs1( b( ioffb ) )
5613 ioffb = ib + kk - 1 + ( jb + j - 2 ) * ldb
5615 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5616 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5617 g( i ) = g( i ) + abs1( a( ioffa ) ) *
5618 $ abs1( b( ioffb ) )
5622 ELSE IF( .NOT.trana .AND. tranb )
THEN
5625 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5627 ioffa = ia + i - 1 + ( ja + kk - 2 ) * lda
5628 ct( i ) = ct( i ) + a( ioffa ) *
5629 $ dconjg( b( ioffb ) )
5630 g( i ) = g( i ) + abs1( a( ioffa ) ) *
5631 $ abs1( b( ioffb ) )
5636 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5638 ioffa = ia + i - 1 + ( ja + kk - 2 ) * lda
5639 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5640 g( i ) = g( i ) + abs1( a( ioffa ) ) *
5641 $ abs1( b( ioffb ) )
5645 ELSE IF( trana .AND. tranb )
THEN
5649 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5651 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5652 ct( i ) = ct( i ) + dconjg( a( ioffa ) ) *
5653 $ dconjg( b( ioffb ) )
5654 g( i ) = g( i ) + abs1( a( ioffa ) ) *
5655 $ abs1( b( ioffb ) )
5660 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5662 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5663 ct( i ) = ct( i ) + dconjg( a( ioffa ) ) *
5665 g( i ) = g( i ) + abs1( a( ioffa ) ) *
5666 $ abs1( b( ioffb ) )
5673 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5675 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5676 ct( i ) = ct( i ) + a( ioffa ) *
5677 $ dconjg( b( ioffb ) )
5678 g( i ) = g( i ) + abs1( a( ioffa ) ) *
5679 $ abs1( b( ioffb ) )
5684 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5686 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5687 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5688 g( i ) = g( i ) + abs1( a( ioffa ) ) *
5689 $ abs1( b( ioffb ) )
5697 ct( i ) = alpha*ct( i ) + beta * c( ioffc )
5698 g( i ) = abs1( alpha )*g( i ) +
5699 $ abs1( beta )*abs1( c( ioffc ) )
5700 c( ioffc ) = ct( i )
5708 ldpc = descc( lld_ )
5709 ioffc = ic + ( jc + j - 2 ) * ldc
5710 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
5711 $ iic, jjc, icrow, iccol )
5713 rowrep = ( icrow.EQ.-1 )
5714 colrep = ( iccol.EQ.-1 )
5716 IF( mycol.EQ.iccol .OR. colrep )
THEN
5718 ibb = descc( imb_ ) - ic + 1
5720 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
5726 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5727 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5728 $ c( ioffc ) ) / eps
5729 IF( g( i-ic+1 ).NE.rzero )
5730 $ erri = erri / g( i-ic+1 )
5731 err =
max( err, erri )
5732 IF( err*sqrt( eps ).GE.rone )
5741 icurrow = mod( icurrow+1, nprow )
5743 DO 230 i = in+1, ic+m-1, descc( mb_ )
5744 ibb =
min( ic+m-i, descc( mb_ ) )
5746 DO 220 kk = 0, ibb-1
5748 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5749 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5751 IF( g( i+kk-ic+1 ).NE.rzero )
5752 $ erri = erri / g( i+kk-ic+1 )
5753 err =
max( err, erri )
5754 IF( err*sqrt( eps ).GE.rone )
5763 icurrow = mod( icurrow+1, nprow )
5771 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
5772 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5786 SUBROUTINE pzmmch1( ICTXT, UPLO, TRANS, N, K, ALPHA, A, IA, JA,
5787 $ DESCA, BETA, C, PC, IC, JC, DESCC, CT, G,
5796 CHARACTER*1 TRANS, UPLO
5797 INTEGER IA, IC, ICTXT, INFO, JA, JC, K, N
5798 DOUBLE PRECISION ERR
5799 COMPLEX*16 ALPHA, BETA
5802 INTEGER DESCA( * ), DESCC( * )
5803 DOUBLE PRECISION G( * )
5804 COMPLEX*16 A( * ), C( * ), CT( * ), PC( * )
5962 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5963 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5965 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5966 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5967 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5968 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5969 DOUBLE PRECISION RZERO, RONE
5970 PARAMETER ( RZERO = 0.0d+0, rone = 1.0d+0 )
5972 PARAMETER ( ZERO = ( 0.0d+0, 0.0d+0 ) )
5975 LOGICAL COLREP, HTRAN, NOTRAN, ROWREP, TRAN, UPPER
5976 INTEGER I, IBB, IBEG, ICCOL, ICROW, ICURROW, IEND, IIC,
5977 $ IN, IOFFAK, IOFFAN, IOFFC, J, JJC, KK, LDA,
5978 $ ldc, ldpc, mycol, myrow, npcol, nprow
5979 DOUBLE PRECISION EPS, ERRI
5983 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
5987 DOUBLE PRECISION PDLAMCH
5988 EXTERNAL lsame, pdlamch
5991 INTRINSIC abs, dble, dconjg, dimag,
max,
min, mod, sqrt
5994 DOUBLE PRECISION ABS1
5995 abs1( z ) = abs( dble( z ) ) + abs( dimag( z ) )
5999 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6001 eps = pdlamch( ictxt,
'eps' )
6003 upper = lsame( uplo,
'U' )
6004 notran = lsame( trans,
'N' )
6005 tran = lsame( trans,
'T' )
6006 htran = lsame( trans,
'H' )
6008 lda =
max( 1, desca( m_ ) )
6009 ldc =
max( 1, descc( m_ ) )
6032 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
6033 DO 20 i = ibeg, iend
6034 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
6035 ct( i ) = ct( i ) + a( ioffak ) * a( ioffan )
6036 g( i ) = g( i ) + abs1( a( ioffak ) ) *
6037 $ abs1( a( ioffan ) )
6040 ELSE IF( tran )
THEN
6042 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
6043 DO 40 i = ibeg, iend
6044 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
6045 ct( i ) = ct( i ) + a( ioffak ) * a( ioffan )
6046 g( i ) = g( i ) + abs1( a( ioffak ) ) *
6047 $ abs1( a( ioffan ) )
6050 ELSE IF( htran )
THEN
6052 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
6053 DO 60 i = ibeg, iend
6054 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
6055 ct( i ) = ct( i ) + a( ioffan ) *
6056 $ dconjg( a( ioffak ) )
6057 g( i ) = g( i ) + abs1( a( ioffak ) ) *
6058 $ abs1( a( ioffan ) )
6063 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
6064 DO 80 i = ibeg, iend
6065 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
6066 ct( i ) = ct( i ) + dconjg( a( ioffan ) ) *
6068 g( i ) = g( i ) + abs1( dconjg( a( ioffan ) ) ) *
6069 $ abs1( a( ioffak ) )
6074 ioffc = ic + ibeg - 1 + ( jc + j - 2 ) * ldc
6076 DO 100 i = ibeg, iend
6077 ct( i ) = alpha*ct( i ) + beta * c( ioffc )
6078 g( i ) = abs1( alpha )*g( i ) +
6079 $ abs1( beta )*abs1( c( ioffc ) )
6080 c( ioffc ) = ct( i )
6088 ldpc = descc( lld_ )
6089 ioffc = ic + ( jc + j - 2 ) * ldc
6090 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
6091 $ iic, jjc, icrow, iccol )
6093 rowrep = ( icrow.EQ.-1 )
6094 colrep = ( iccol.EQ.-1 )
6096 IF( mycol.EQ.iccol .OR. colrep )
THEN
6098 ibb = descc( imb_ ) - ic + 1
6100 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
6106 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6107 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6108 $ c( ioffc ) ) / eps
6109 IF( g( i-ic+1 ).NE.rzero )
6110 $ erri = erri / g( i-ic+1 )
6111 err =
max( err, erri )
6112 IF( err*sqrt( eps ).GE.rone )
6121 icurrow = mod( icurrow+1, nprow )
6123 DO 130 i = in+1, ic+n-1, descc( mb_ )
6124 ibb =
min( ic+n-i, descc( mb_ ) )
6126 DO 120 kk = 0, ibb-1
6128 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6129 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6131 IF( g( i+kk-ic+1 ).NE.rzero )
6132 $ erri = erri / g( i+kk-ic+1 )
6133 err =
max( err, erri )
6134 IF( err*sqrt( eps ).GE.rone )
6143 icurrow = mod( icurrow+1, nprow )
6151 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6152 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6166 SUBROUTINE pzmmch2( ICTXT, UPLO, TRANS, N, K, ALPHA, A, IA, JA,
6167 $ DESCA, B, IB, JB, DESCB, BETA, C, PC, IC,
6168 $ JC, DESCC, CT, G, ERR, INFO )
6176 CHARACTER*1 TRANS, UPLO
6177 INTEGER IA, IB, IC, ICTXT, INFO, JA, JB, JC, K, N
6178 DOUBLE PRECISION ERR
6179 COMPLEX*16 ALPHA, BETA
6182 INTEGER DESCA( * ), DESCB( * ), DESCC( * )
6183 DOUBLE PRECISION G( * )
6184 COMPLEX*16 A( * ), B( * ), C( * ), CT( * ),
6360 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
6361 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
6363 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
6364 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
6365 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
6366 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
6367 DOUBLE PRECISION RZERO, RONE
6368 PARAMETER ( RZERO = 0.0d+0, rone = 1.0d+0 )
6370 PARAMETER ( ZERO = ( 0.0d+0, 0.0d+0 ) )
6373 LOGICAL COLREP, HTRAN, NOTRAN, ROWREP, TRAN, UPPER
6374 INTEGER I, IBB, IBEG, ICCOL, ICROW, ICURROW, IEND, IIC,
6375 $ IN, IOFFAK, IOFFAN, IOFFBK, IOFFBN, IOFFC, J,
6376 $ JJC, KK, LDA, LDB, LDC, LDPC, MYCOL, MYROW,
6378 DOUBLE PRECISION EPS, ERRI
6382 EXTERNAL blacs_gridinfo, dgamx2d, igsum2d,
pb_infog2l
6386 DOUBLE PRECISION PDLAMCH
6387 EXTERNAL lsame, pdlamch
6390 INTRINSIC abs, dble, dconjg, dimag,
max,
min, mod, sqrt
6393 DOUBLE PRECISION ABS1
6394 ABS1( Z ) = abs( dble( z ) ) + abs( dimag( z ) )
6398 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6400 eps = pdlamch( ictxt,
'eps' )
6402 upper = lsame( uplo,
'U' )
6403 htran = lsame( trans,
'H' )
6404 notran = lsame( trans,
'N' )
6405 tran = lsame( trans,
'T' )
6407 lda =
max( 1, desca( m_ ) )
6408 ldb =
max( 1, descb( m_ ) )
6409 ldc =
max( 1, descc( m_ ) )
6432 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
6433 ioffbk = ib + j - 1 + ( jb + kk - 2 ) * ldb
6434 DO 20 i = ibeg, iend
6435 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
6436 ioffbn = ib + i - 1 + ( jb + kk - 2 ) * ldb
6437 ct( i ) = ct( i ) + alpha * (
6438 $ a( ioffan ) * b( ioffbk ) +
6439 $ b( ioffbn ) * a( ioffak ) )
6440 g( i ) = g( i ) + abs( alpha ) * (
6441 $ abs1( a( ioffan ) ) * abs1( b( ioffbk ) ) +
6442 $ abs1( b( ioffbn ) ) * abs1( a( ioffak ) ) )
6445 ELSE IF( tran )
THEN
6447 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
6448 ioffbk = ib + kk - 1 + ( jb + j - 2 ) * ldb
6449 DO 40 i = ibeg, iend
6450 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
6451 ioffbn = ib + kk - 1 + ( jb + i - 2 ) * ldb
6452 ct( i ) = ct( i ) + alpha * (
6453 $ a( ioffan ) * b( ioffbk ) +
6454 $ b( ioffbn ) * a( ioffak ) )
6455 g( i ) = g( i ) + abs( alpha ) * (
6456 $ abs1( a( ioffan ) ) * abs1( b( ioffbk ) ) +
6457 $ abs1( b( ioffbn ) ) * abs1( a( ioffak ) ) )
6460 ELSE IF( htran )
THEN
6462 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
6463 ioffbk = ib + j - 1 + ( jb + kk - 2 ) * ldb
6464 DO 60 i = ibeg, iend
6465 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
6466 ioffbn = ib + i - 1 + ( jb + kk - 2 ) * ldb
6468 $ alpha * a( ioffan ) * dconjg( b( ioffbk ) ) +
6469 $ b( ioffbn ) * dconjg( alpha * a( ioffak ) )
6470 g( i ) = g( i ) + abs1( alpha ) * (
6471 $ abs1( a( ioffan ) ) * abs1( b( ioffbk ) ) +
6472 $ abs1( b( ioffbn ) ) * abs1( a( ioffak ) ) )
6477 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
6478 ioffbk = ib + kk - 1 + ( jb + j - 2 ) * ldb
6479 DO 80 i = ibeg, iend
6480 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
6481 ioffbn = ib + kk - 1 + ( jb + i - 2 ) * ldb
6483 $ alpha * dconjg( a( ioffan ) ) * b( ioffbk ) +
6484 $ dconjg( alpha * b( ioffbn ) ) * a( ioffak )
6485 g( i ) = g( i ) + abs1( alpha ) * (
6486 $ abs1( dconjg( a( ioffan ) ) * b( ioffbk ) ) +
6487 $ abs1( dconjg( b( ioffbn ) ) * a( ioffak ) ) )
6492 ioffc = ic + ibeg - 1 + ( jc + j - 2 ) * ldc
6494 DO 100 i = ibeg, iend
6495 ct( i ) = ct( i ) + beta * c( ioffc )
6496 g( i ) = g( i ) + abs1( beta )*abs1( c( ioffc ) )
6497 c( ioffc ) = ct( i )
6505 ldpc = descc( lld_ )
6506 ioffc = ic + ( jc + j - 2 ) * ldc
6507 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
6508 $ iic, jjc, icrow, iccol )
6510 rowrep = ( icrow.EQ.-1 )
6511 colrep = ( iccol.EQ.-1 )
6513 IF( mycol.EQ.iccol .OR. colrep )
THEN
6515 ibb = descc( imb_ ) - ic + 1
6517 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
6523 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6524 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6525 $ c( ioffc ) ) / eps
6526 IF( g( i-ic+1 ).NE.rzero )
6527 $ erri = erri / g( i-ic+1 )
6528 err =
max( err, erri )
6529 IF( err*sqrt( eps ).GE.rone )
6538 icurrow = mod( icurrow+1, nprow )
6540 DO 130 i = in+1, ic+n-1, descc( mb_ )
6541 ibb =
min( ic+n-i, descc( mb_ ) )
6543 DO 120 kk = 0, ibb-1
6545 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6546 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6548 IF( g( i+kk-ic+1 ).NE.rzero )
6549 $ erri = erri / g( i+kk-ic+1 )
6550 err =
max( err, erri )
6551 IF( err*sqrt( eps ).GE.rone )
6560 icurrow = mod( icurrow+1, nprow )
6568 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6569 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6583 SUBROUTINE pzmmch3( UPLO, TRANS, M, N, ALPHA, A, IA, JA, DESCA,
6584 $ BETA, C, PC, IC, JC, DESCC, ERR, INFO )
6592 CHARACTER*1 TRANS, UPLO
6593 INTEGER IA, IC, INFO, JA, JC, M, N
6594 DOUBLE PRECISION ERR
6595 COMPLEX*16 ALPHA, BETA
6598 INTEGER DESCA( * ), DESCC( * )
6599 COMPLEX*16 A( * ), C( * ), PC( * )
6742 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
6743 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
6745 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
6746 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
6747 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
6748 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
6749 DOUBLE PRECISION ZERO
6750 PARAMETER ( ZERO = 0.0d+0 )
6753 LOGICAL COLREP, CTRAN, LOWER, NOTRAN, ROWREP, UPPER
6754 INTEGER I, ICCOL, ICROW, ICTXT, IIC, IOFFA, IOFFC, J,
6755 $ JJC, LDA, LDC, LDPC, MYCOL, MYROW, NPCOL,
6757 DOUBLE PRECISION ERR0, ERRI, PREC
6760 EXTERNAL BLACS_GRIDINFO, DGAMX2D, IGSUM2D, PB_INFOG2L,
6765 DOUBLE PRECISION PDLAMCH
6766 EXTERNAL LSAME, PDLAMCH
6769 INTRINSIC abs, dconjg,
max
6773 ictxt = descc( ctxt_ )
6774 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6776 prec = pdlamch( ictxt,
'eps' )
6778 upper = lsame( uplo,
'U' )
6779 lower = lsame( uplo,
'L' )
6780 notran = lsame( trans,
'N' )
6781 ctran = lsame( trans,
'C' )
6789 lda =
max( 1, desca( m_ ) )
6790 ldc =
max( 1, descc( m_ ) )
6791 ldpc =
max( 1, descc( lld_ ) )
6792 rowrep = ( descc( rsrc_ ).EQ.-1 )
6793 colrep = ( descc( csrc_ ).EQ.-1 )
6797 DO 20 j = jc, jc + n - 1
6799 ioffc = ic + ( j - 1 ) * ldc
6800 ioffa = ia + ( ja - 1 + j - jc ) * lda
6802 DO 10 i = ic, ic + m - 1
6805 IF( ( j - jc ).GE.( i - ic ) )
THEN
6806 CALL pzerraxpby( erri, alpha, a( ioffa ), beta,
6807 $ c( ioffc ), prec )
6811 ELSE IF( lower )
THEN
6812 IF( ( j - jc ).LE.( i - ic ) )
THEN
6813 CALL pzerraxpby( erri, alpha, a( ioffa ), beta,
6814 $ c( ioffc ), prec )
6819 CALL pzerraxpby( erri, alpha, a( ioffa ), beta,
6820 $ c( ioffc ), prec )
6823 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6824 $ iic, jjc, icrow, iccol )
6825 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6826 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6827 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6830 err =
max( err, err0 )
6840 ELSE IF( ctran )
THEN
6842 DO 40 j = jc, jc + n - 1
6844 ioffc = ic + ( j - 1 ) * ldc
6845 ioffa = ia + ( j - jc ) + ( ja - 1 ) * lda
6847 DO 30 i = ic, ic + m - 1
6850 IF( ( j - jc ).GE.( i - ic ) )
THEN
6851 CALL pzerraxpby( erri, alpha, dconjg( a( ioffa ) ),
6852 $ beta, c( ioffc ), prec )
6856 ELSE IF( lower )
THEN
6857 IF( ( j - jc ).LE.( i - ic ) )
THEN
6858 CALL pzerraxpby( erri, alpha, dconjg( a( ioffa ) ),
6859 $ beta, c( ioffc ), prec )
6864 CALL pzerraxpby( erri, alpha, dconjg( a( ioffa ) ),
6865 $ beta, c( ioffc ), prec )
6868 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6869 $ iic, jjc, icrow, iccol )
6870 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6871 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6872 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6875 err =
max( err, err0 )
6887 DO 60 j = jc, jc + n - 1
6889 ioffc = ic + ( j - 1 ) * ldc
6890 ioffa = ia + ( j - jc ) + ( ja - 1 ) * lda
6892 DO 50 i = ic, ic + m - 1
6895 IF( ( j - jc ).GE.( i - ic ) )
THEN
6896 CALL pzerraxpby( erri, alpha, a( ioffa ), beta,
6897 $ c( ioffc ), prec )
6901 ELSE IF( lower )
THEN
6902 IF( ( j - jc ).LE.( i - ic ) )
THEN
6903 CALL pzerraxpby( erri, alpha, a( ioffa ), beta,
6904 $ c( ioffc ), prec )
6909 CALL pzerraxpby( erri, alpha, a( ioffa ), beta,
6910 $ c( ioffc ), prec )
6913 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6914 $ iic, jjc, icrow, iccol )
6915 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6916 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6917 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6920 err =
max( err, err0 )
6934 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6935 CALL dgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6943 SUBROUTINE pzerraxpby( ERRBND, ALPHA, X, BETA, Y, PREC )
6951 DOUBLE PRECISION ERRBND, PREC
6952 COMPLEX*16 ALPHA, BETA, X, Y
6990 DOUBLE PRECISION ONE, TWO, ZERO
6991 PARAMETER ( ONE = 1.0d+0, two = 2.0d+0,
6995 DOUBLE PRECISION ADDBND, FACT, SUMINEG, SUMIPOS, SUMRNEG,
7007 fact = one + two * prec
7008 addbnd = two * two * two * prec
7011 IF( dble( tmp ).GE.zero )
THEN
7012 sumrpos = sumrpos + dble( tmp ) * fact
7014 sumrneg = sumrneg - dble( tmp ) * fact
7016 IF( dimag( tmp ).GE.zero )
THEN
7017 sumipos = sumipos + dimag( tmp ) * fact
7019 sumineg = sumineg - dimag( tmp ) * fact
7023 IF( dble( tmp ).GE.zero )
THEN
7024 sumrpos = sumrpos + dble( tmp ) * fact
7026 sumrneg = sumrneg - dble( tmp ) * fact
7028 IF( dimag( tmp ).GE.zero )
THEN
7029 sumipos = sumipos + dimag( tmp ) * fact
7031 sumineg = sumineg - dimag( tmp ) * fact
7034 y = ( beta * y ) + ( alpha * x )
7036 errbnd = addbnd *
max(
max( sumrpos, sumrneg ),
7037 $
max( sumipos, sumineg ) )
7044 SUBROUTINE pzipset( TOGGLE, N, A, IA, JA, DESCA )
7172 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
7173 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
7175 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
7176 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
7177 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
7178 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
7179 DOUBLE PRECISION ZERO
7180 PARAMETER ( ZERO = 0.0d+0 )
7183 LOGICAL COLREP, GODOWN, GOLEFT, ROWREP
7184 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
7185 $ IMB1, IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP,
7186 $ JJA, JOFFA, JOFFD, LCMT, LCMT00, LDA, LDAP1,
7187 $ LMBLOC, LNBLOC, LOW, MB, MBLKD, MBLKS, MBLOC,
7188 $ MRCOL, MRROW, MYCOL, MYROW, NB, NBLKD, NBLKS,
7189 $ NBLOC, NP, NPCOL, NPROW, NQ, PMB, QNB, UPP
7190 DOUBLE PRECISION ALPHA, ATMP
7193 INTEGER DESCA2( DLEN_ )
7201 DOUBLE PRECISION PDLAMCH
7202 EXTERNAL lsame, pdlamch
7205 INTRINSIC dble, dcmplx,
max,
min
7215 ictxt = desca2( ctxt_ )
7216 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
7221 IF( lsame( toggle,
'Z' ) )
THEN
7223 ELSE IF( lsame( toggle,
'B' ) )
THEN
7224 alpha = pdlamch( ictxt,
'Epsilon' )
7225 alpha = alpha / pdlamch( ictxt,
'Safe minimum' )
7228 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
7229 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
7230 $ iacol, mrrow, mrcol )
7232 IF( np.LE.0 .OR. nq.LE.0 )
7240 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
7241 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
7242 $ lnbloc, ilow, low, iupp, upp )
7246 rowrep = ( desca2( rsrc_ ).EQ.-1 )
7247 colrep = ( desca2( csrc_ ).EQ.-1 )
7248 lda = desca2( lld_ )
7265 godown = ( lcmt00.GT.iupp )
7266 goleft = ( lcmt00.LT.ilow )
7268 IF( .NOT.godown .AND. .NOT.goleft )
THEN
7272 IF( lcmt00.GE.0 )
THEN
7273 ijoffa = ioffa + lcmt00 + ( joffa - 1 ) * lda
7274 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
7275 atmp = dble( a( ijoffa + i*ldap1 ) )
7276 a( ijoffa + i*ldap1 ) = dcmplx( atmp, alpha )
7279 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
7280 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
7281 atmp = dble( a( ijoffa + i*ldap1 ) )
7282 a( ijoffa + i*ldap1 ) = dcmplx( atmp, alpha )
7285 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
7286 godown = .NOT.goleft
7292 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7294 ioffa = ioffa + imbloc
7297 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7298 lcmt00 = lcmt00 - pmb
7313 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
7316 IF( lcmt.GE.0 )
THEN
7317 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
7318 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
7319 atmp = dble( a( ijoffa + i*ldap1 ) )
7320 a( ijoffa + i*ldap1 ) = dcmplx( atmp, alpha )
7323 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
7324 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
7325 atmp = dble( a( ijoffa + i*ldap1 ) )
7326 a( ijoffa + i*ldap1 ) = dcmplx( atmp, alpha )
7334 ioffd = ioffd + mbloc
7338 lcmt00 = lcmt00 + low - ilow + qnb
7340 joffa = joffa + inbloc
7342 ELSE IF( goleft )
THEN
7344 lcmt00 = lcmt00 + low - ilow + qnb
7346 joffa = joffa + inbloc
7349 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
7350 lcmt00 = lcmt00 + qnb
7365 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
7368 IF( lcmt.GE.0 )
THEN
7369 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
7370 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
7371 atmp = dble( a( ijoffa + i*ldap1 ) )
7372 a( ijoffa + i*ldap1 ) = dcmplx( atmp, alpha )
7375 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
7376 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
7377 atmp = dble( a( ijoffa + i*ldap1 ) )
7378 a( ijoffa + i*ldap1 ) = dcmplx( atmp, alpha )
7386 joffd = joffd + nbloc
7390 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7392 ioffa = ioffa + imbloc
7398 IF( nblks.GT.0 )
THEN
7402 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7403 lcmt00 = lcmt00 - pmb
7418 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
7421 IF( lcmt.GE.0 )
THEN
7422 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
7423 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
7424 atmp = dble( a( ijoffa + i*ldap1 ) )
7425 a( ijoffa + i*ldap1 ) = dcmplx( atmp, alpha )
7428 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
7429 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
7430 atmp = dble( a( ijoffa + i*ldap1 ) )
7431 a( ijoffa + i*ldap1 ) = dcmplx( atmp, alpha )
7439 ioffd = ioffd + mbloc
7443 lcmt00 = lcmt00 + qnb
7445 joffa = joffa + nbloc
7455 DOUBLE PRECISION FUNCTION pdlamch( ICTXT, CMACH )
7474 DOUBLE PRECISION temp
7477 EXTERNAL dgamn2d, dgamx2d, pb_topget
7488 IF(
lsame( cmach,
'E' ).OR.
lsame( cmach,
'S' ).OR.
7489 $
lsame( cmach,
'M' ).OR.
lsame( cmach,
'U' ) )
THEN
7490 CALL pb_topget( ictxt,
'Combine',
'All', top )
7492 CALL dgamx2d( ictxt,
'All', top, 1, 1, temp, 1, idumm,
7493 $ idumm, -1, -1, idumm )
7494 ELSE IF(
lsame( cmach,
'L' ).OR.
lsame( cmach,
'O' ) )
THEN
7495 CALL pb_topget( ictxt,
'Combine',
'All', top )
7497 CALL dgamn2d( ictxt,
'All', top, 1, 1, temp, 1, idumm,
7498 $ idumm, -1, -1, idumm )
7508 SUBROUTINE pzlaset( UPLO, M, N, ALPHA, BETA, A, IA, JA, DESCA )
7517 INTEGER IA, JA, M, N
7518 COMPLEX*16 ALPHA, BETA
7653 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
7654 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
7656 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
7657 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
7658 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
7659 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
7662 LOGICAL GODOWN, GOLEFT, ISCOLREP, ISROWREP, LOWER,
7664 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
7665 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP, JJA,
7666 $ JJMAX, JOFFA, JOFFD, LCMT, LCMT00, LDA, LMBLOC,
7667 $ LNBLOC, LOW, M1, MB, MBLKD, MBLKS, MBLOC, MP,
7668 $ MRCOL, MRROW, MYCOL, MYROW, N1, NB, NBLKD,
7669 $ NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB, QNB, TMP1,
7673 INTEGER DESCA2( DLEN_ )
7688 IF( m.EQ.0 .OR. n.EQ.0 )
7697 ictxt = desca2( ctxt_ )
7698 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
7700 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
7701 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
7702 $ iacol, mrrow, mrcol )
7704 IF( mp.LE.0 .OR. nq.LE.0 )
7707 isrowrep = ( desca2( rsrc_ ).LT.0 )
7708 iscolrep = ( desca2( csrc_ ).LT.0 )
7709 lda = desca2( lld_ )
7711 upper = .NOT.( lsame( uplo,
'L' ) )
7712 lower = .NOT.( lsame( uplo,
'U' ) )
7714 IF( ( ( lower.AND.upper ).AND.( alpha.EQ.beta ) ).OR.
7715 $ ( isrowrep .AND. iscolrep ) )
THEN
7716 IF( ( mp.GT.0 ).AND.( nq.GT.0 ) )
7717 $
CALL pb_zlaset( uplo, mp, nq, 0, alpha, beta,
7718 $ a( iia + ( jja - 1 ) * lda ), lda )
7727 CALL pb_binfo( 0, mp, nq, imb1, inb1, mb, nb, mrrow, mrcol,
7728 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
7729 $ lnbloc, ilow, low, iupp, upp )
7753 godown = ( lcmt00.GT.iupp )
7754 goleft = ( lcmt00.LT.ilow )
7756 IF( .NOT.godown .AND. .NOT.goleft )
THEN
7760 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
7761 godown = .NOT.goleft
7763 CALL pb_zlaset( uplo, imbloc, inbloc, lcmt00, alpha, beta,
7764 $ a( iia+joffa*lda ), lda )
7766 IF( upper .AND. nq.GT.inbloc )
7767 $
CALL pb_zlaset(
'All', imbloc, nq-inbloc, 0, alpha,
7768 $ alpha, a( iia+(joffa+inbloc)*lda ), lda )
7772 IF( lower .AND. mp.GT.imbloc )
7773 $
CALL pb_zlaset(
'All', mp-imbloc, inbloc, 0, alpha,
7774 $ alpha, a( iia+imbloc+joffa*lda ), lda )
7783 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7785 ioffa = ioffa + imbloc
7788 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7789 lcmt00 = lcmt00 - pmb
7795 tmp1 =
min( ioffa, iimax ) - iia + 1
7796 IF( upper .AND. tmp1.GT.0 )
THEN
7797 CALL pb_zlaset(
'All', tmp1, n1, 0, alpha, alpha,
7798 $ a( iia+joffa*lda ), lda )
7812 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
7815 CALL pb_zlaset( uplo, mbloc, inbloc, lcmt, alpha, beta,
7816 $ a( ioffd+1+joffa*lda ), lda )
7822 ioffd = ioffd + mbloc
7826 tmp1 = m1 - ioffd + iia - 1
7827 IF( lower .AND. tmp1.GT.0 )
7828 $
CALL pb_zlaset(
'ALL', tmp1, inbloc, 0, alpha, alpha,
7829 $ a( ioffd+1+joffa*lda ), lda )
7831 tmp1 = ioffa - iia + 1
7834 lcmt00 = lcmt00 + low - ilow + qnb
7836 joffa = joffa + inbloc
7838 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7839 $
CALL pb_zlaset(
'ALL', tmp1, n1, 0, alpha, alpha,
7840 $ a( iia+joffa*lda ), lda )
7845 ELSE IF( goleft )
THEN
7847 lcmt00 = lcmt00 + low - ilow + qnb
7849 joffa = joffa + inbloc
7852 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
7853 lcmt00 = lcmt00 + qnb
7859 tmp1 =
min( joffa, jjmax ) - jja + 1
7860 IF( lower .AND. tmp1.GT.0 )
THEN
7861 CALL pb_zlaset(
'All', m1, tmp1, 0, alpha, alpha,
7862 $ a( iia+(jja-1)*lda ), lda )
7876 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
7879 CALL pb_zlaset( uplo, imbloc, nbloc, lcmt, alpha, beta,
7880 $ a( iia+joffd*lda ), lda )
7886 joffd = joffd + nbloc
7890 tmp1 = n1 - joffd + jja - 1
7891 IF( upper .AND. tmp1.GT.0 )
7892 $
CALL pb_zlaset(
'All', imbloc, tmp1, 0, alpha, alpha,
7893 $ a( iia+joffd*lda ), lda )
7895 tmp1 = joffa - jja + 1
7898 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7900 ioffa = ioffa + imbloc
7902 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
7903 $
CALL pb_zlaset(
'All', m1, tmp1, 0, alpha, alpha,
7904 $ a( ioffa+1+(jja-1)*lda ), lda )
7913 IF( nblks.GT.0 )
THEN
7917 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7918 lcmt00 = lcmt00 - pmb
7924 tmp1 =
min( ioffa, iimax ) - iia + 1
7925 IF( upper .AND. tmp1.GT.0 )
THEN
7926 CALL pb_zlaset(
'All', tmp1, n1, 0, alpha, alpha,
7927 $ a( iia+joffa*lda ), lda )
7941 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
7944 CALL pb_zlaset( uplo, mbloc, nbloc, lcmt, alpha, beta,
7945 $ a( ioffd+1+joffa*lda ), lda )
7951 ioffd = ioffd + mbloc
7955 tmp1 = m1 - ioffd + iia - 1
7956 IF( lower .AND. tmp1.GT.0 )
7957 $
CALL pb_zlaset(
'All', tmp1, nbloc, 0, alpha, alpha,
7958 $ a( ioffd+1+joffa*lda ), lda )
7960 tmp1 =
min( ioffa, iimax ) - iia + 1
7963 lcmt00 = lcmt00 + qnb
7965 joffa = joffa + nbloc
7967 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7968 $
CALL pb_zlaset(
'All', tmp1, n1, 0, alpha, alpha,
7969 $ a( iia+joffa*lda ), lda )
7983 SUBROUTINE pzlascal( TYPE, M, N, ALPHA, A, IA, JA, DESCA )
7992 INTEGER IA, JA, M, N
8118 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8119 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8121 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8122 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8123 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8124 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8128 LOGICAL GODOWN, GOLEFT, LOWER, UPPER
8129 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
8130 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, ITYPE,
8131 $ IUPP, JJA, JJMAX, JOFFA, JOFFD, LCMT, LCMT00,
8132 $ LDA, LMBLOC, LNBLOC, LOW, M1, MB, MBLKD, MBLKS,
8133 $ MBLOC, MP, MRCOL, MRROW, MYCOL, MYROW, N1, NB,
8134 $ NBLKD, NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB,
8138 INTEGER DESCA2( DLEN_ )
8147 EXTERNAL lsame, pb_numroc
8160 ictxt = desca2( ctxt_ )
8161 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8165 IF( m.EQ.0 .OR. n.EQ.0 )
8168 IF( lsame(
TYPE,
'L' ) ) then
8174 ELSE IF( lsame(
TYPE,
'U' ) ) then
8180 ELSE IF( lsame(
TYPE,
'H' ) ) then
8196 IF( itype.EQ.0 )
THEN
8200 CALL pb_infog2l( ia, ja, desca2, nprow, npcol, myrow, mycol,
8201 $ iia, jja, iarow, iacol )
8202 mp = pb_numroc( m, ia, desca2( imb_ ), desca2( mb_ ), myrow,
8203 $ desca2( rsrc_ ), nprow )
8204 nq = pb_numroc( n, ja, desca2( inb_ ), desca2( nb_ ), mycol,
8205 $ desca2( csrc_ ), npcol )
8207 IF( mp.LE.0 .OR. nq.LE.0 )
8210 lda = desca2( lld_ )
8211 ioffa = iia + ( jja - 1 ) * lda
8213 CALL pb_zlascal(
'All', mp, nq, 0, alpha, a( ioffa ), lda )
8219 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
8220 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
8221 $ iacol, mrrow, mrcol )
8223 IF( mp.LE.0 .OR. nq.LE.0 )
8231 lda = desca2( lld_ )
8233 CALL pb_binfo( ioffd, mp, nq, imb1, inb1, mb, nb, mrrow,
8234 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
8235 $ lmbloc, lnbloc, ilow, low, iupp, upp )
8244 IF( desca2( rsrc_ ).LT.0 )
THEN
8249 IF( desca2( csrc_ ).LT.0 )
THEN
8258 godown = ( lcmt00.GT.iupp )
8259 goleft = ( lcmt00.LT.ilow )
8261 IF( .NOT.godown .AND. .NOT.goleft )
THEN
8265 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
8266 godown = .NOT.goleft
8268 CALL pb_zlascal( uplo, imbloc, inbloc, lcmt00, alpha,
8269 $ a( iia+joffa*lda ), lda )
8271 IF( upper .AND. nq.GT.inbloc )
8272 $
CALL pb_zlascal(
'All', imbloc, nq-inbloc, 0, alpha,
8273 $ a( iia+(joffa+inbloc)*lda ), lda )
8277 IF( lower .AND. mp.GT.imbloc )
8278 $
CALL pb_zlascal(
'All', mp-imbloc, inbloc, 0, alpha,
8279 $ a( iia+imbloc+joffa*lda ), lda )
8288 lcmt00 = lcmt00 - ( iupp - upp + pmb )
8290 ioffa = ioffa + imbloc
8293 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
8294 lcmt00 = lcmt00 - pmb
8300 tmp1 =
min( ioffa, iimax ) - iia + 1
8301 IF( upper .AND. tmp1.GT.0 )
THEN
8303 $ a( iia+joffa*lda ), lda )
8317 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
8320 CALL pb_zlascal( uplo, mbloc, inbloc, lcmt, alpha,
8321 $ a( ioffd+1+joffa*lda ), lda )
8327 ioffd = ioffd + mbloc
8331 tmp1 = m1 - ioffd + iia - 1
8332 IF( lower .AND. tmp1.GT.0 )
8333 $
CALL pb_zlascal(
'All', tmp1, inbloc, 0, alpha,
8334 $ a( ioffd+1+joffa*lda ), lda )
8336 tmp1 = ioffa - iia + 1
8339 lcmt00 = lcmt00 + low - ilow + qnb
8341 joffa = joffa + inbloc
8343 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
8344 $
CALL pb_zlascal(
'All', tmp1, n1, 0, alpha,
8345 $ a( iia+joffa*lda ), lda )
8350 ELSE IF( goleft )
THEN
8352 lcmt00 = lcmt00 + low - ilow + qnb
8354 joffa = joffa + inbloc
8357 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
8358 lcmt00 = lcmt00 + qnb
8364 tmp1 =
min( joffa, jjmax ) - jja + 1
8365 IF( lower .AND. tmp1.GT.0 )
THEN
8367 $ a( iia+(jja-1)*lda ), lda )
8381 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
8384 CALL pb_zlascal( uplo, imbloc, nbloc, lcmt, alpha,
8385 $ a( iia+joffd*lda ), lda )
8391 joffd = joffd + nbloc
8395 tmp1 = n1 - joffd + jja - 1
8396 IF( upper .AND. tmp1.GT.0 )
8397 $
CALL pb_zlascal(
'All', imbloc, tmp1, 0, alpha,
8398 $ a( iia+joffd*lda ), lda )
8400 tmp1 = joffa - jja + 1
8403 lcmt00 = lcmt00 - ( iupp - upp + pmb )
8405 ioffa = ioffa + imbloc
8407 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
8408 $
CALL pb_zlascal(
'All', m1, tmp1, 0, alpha,
8409 $ a( ioffa+1+(jja-1)*lda ), lda )
8418 IF( nblks.GT.0 )
THEN
8422 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
8423 lcmt00 = lcmt00 - pmb
8429 tmp1 =
min( ioffa, iimax ) - iia + 1
8430 IF( upper .AND. tmp1.GT.0 )
THEN
8432 $ a( iia+joffa*lda ), lda )
8446 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
8449 CALL pb_zlascal( uplo, mbloc, nbloc, lcmt, alpha,
8450 $ a( ioffd+1+joffa*lda ), lda )
8456 ioffd = ioffd + mbloc
8460 tmp1 = m1 - ioffd + iia - 1
8461 IF( lower .AND. tmp1.GT.0 )
8462 $
CALL pb_zlascal(
'All', tmp1, nbloc, 0, alpha,
8463 $ a( ioffd+1+joffa*lda ), lda )
8465 tmp1 =
min( ioffa, iimax ) - iia + 1
8468 lcmt00 = lcmt00 + qnb
8470 joffa = joffa + nbloc
8472 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
8473 $
CALL pb_zlascal(
'All', tmp1, n1, 0, alpha,
8474 $ a( iia+joffa*lda ), lda )
8490 SUBROUTINE pzlagen( INPLACE, AFORM, DIAG, OFFA, M, N, IA, JA,
8491 $ DESCA, IASEED, A, LDA )
8500 CHARACTER*1 aform, diag
8501 INTEGER ia, iaseed, ja, lda, m, n, offa
8505 COMPLEX*16 A( LDA, * )
8683 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8684 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8686 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8687 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8688 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8689 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8690 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
8691 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
8692 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
8693 PARAMETER ( JMP_1 = 1, jmp_row = 2, jmp_col = 3,
8694 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
8695 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
8696 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
8698 DOUBLE PRECISION ZERO
8699 PARAMETER ( ZERO = 0.0d+0 )
8702 LOGICAL DIAGDO, SYMM, HERM, NOTRAN
8703 INTEGER CSRC, I, IACOL, IAROW, ICTXT, IIA, ILOCBLK,
8704 $ ILOCOFF, ILOW, IMB, IMB1, IMBLOC, IMBVIR, INB,
8705 $ INB1, INBLOC, INBVIR, INFO, IOFFDA, ITMP, IUPP,
8706 $ ivir, jja, jlocblk, jlocoff, jvir, lcmt00,
8707 $ lmbloc, lnbloc, low, maxmn, mb, mblks, mp,
8708 $ mrcol, mrrow, mycdist, mycol, myrdist, myrow,
8709 $ nb, nblks, npcol, nprow, nq, nvir, rsrc, upp
8713 INTEGER DESCA2( DLEN_ ), IMULADD( 4, JMP_LEN ),
8714 $ IRAN( 2 ), JMP( JMP_LEN ), MULADD0( 4 )
8717 EXTERNAL BLACS_GRIDINFO, PB_AINFOG2L, PB_BINFO,
8728 INTRINSIC DBLE, DCMPLX, MAX, MIN
8731 DATA ( muladd0( i ), i = 1, 4 ) / 20077, 16838,
8742 ictxt = desca2( ctxt_ )
8743 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8748 IF( nprow.EQ.-1 )
THEN
8749 info = -( 1000 + ctxt_ )
8751 symm = lsame( aform,
'S' )
8752 herm = lsame( aform,
'H' )
8753 notran = lsame( aform,
'N' )
8754 diagdo = lsame( diag,
'D' )
8755 IF( .NOT.( symm.OR.herm.OR.notran ) .AND.
8756 $ .NOT.( lsame( aform,
'T' ) ) .AND.
8757 $ .NOT.( lsame( aform,
'C' ) ) )
THEN
8759 ELSE IF( ( .NOT.diagdo ) .AND.
8760 $ ( .NOT.lsame( diag,
'N' ) ) )
THEN
8763 CALL pb_chkmat( ictxt, m, 5, n, 6, ia, ja, desca2, 10, info )
8766 IF( info.NE.0 )
THEN
8767 CALL pxerbla( ictxt,
'PZLAGEN', -info )
8773 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
8780 imb = desca2( imb_ )
8781 inb = desca2( inb_ )
8782 rsrc = desca2( rsrc_ )
8783 csrc = desca2( csrc_ )
8787 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
8788 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
8789 $ iacol, mrrow, mrcol )
8801 ioffda = ja + offa - ia
8802 CALL pb_binfo( ioffda, mp, nq, imb1, inb1, mb, nb, mrrow,
8803 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
8804 $ lmbloc, lnbloc, ilow, low, iupp, upp )
8812 itmp = max( 0, -offa )
8815 nvir = desca2( m_ ) + itmp
8817 CALL pb_locinfo( ivir, imbvir, mb, myrow, rsrc, nprow, ilocblk,
8818 $ ilocoff, myrdist )
8820 itmp = max( 0, offa )
8823 nvir = max( max( nvir, desca2( n_ ) + itmp ),
8824 $ desca2( m_ ) + desca2( n_ ) - 1 )
8826 CALL pb_locinfo( jvir, inbvir, nb, mycol, csrc, npcol, jlocblk,
8827 $ jlocoff, mycdist )
8829 IF( symm .OR. herm .OR. notran )
THEN
8831 CALL pb_initjmp( .true., nvir, imbvir, inbvir, imbloc, inbloc,
8832 $ mb, nb, rsrc, csrc, nprow, npcol, 2, jmp )
8840 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
8841 $ myrdist, mycdist, nprow, npcol, jmp,
8844 CALL pb_zlagen(
'Lower', aform, a( iia, jja ), lda, lcmt00,
8845 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
8846 $ nb, lnbloc, jmp, imuladd )
8850 IF( symm .OR. herm .OR. ( .NOT. notran ) )
THEN
8852 CALL pb_initjmp( .false., nvir, imbvir, inbvir, imbloc, inbloc,
8853 $ mb, nb, rsrc, csrc, nprow, npcol, 2, jmp )
8861 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
8862 $ myrdist, mycdist, nprow, npcol, jmp,
8865 CALL pb_zlagen(
'Upper', aform, a( iia, jja ), lda, lcmt00,
8866 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
8867 $ nb, lnbloc, jmp, imuladd )
8873 maxmn = max( desca2( m_ ), desca2( n_ ) )
8875 alpha = dcmplx( dble( 2 * maxmn ), zero )
8877 alpha = dcmplx( dble( nvir ), dble( maxmn ) )
8880 IF( ioffda.GE.0 )
THEN
8881 CALL pzladom( inplace, min( max( 0, m-ioffda ), n ), alpha,
8882 $ a, min( ia+ioffda, ia+m-1 ), ja, desca )
8884 CALL pzladom( inplace, min( m, max( 0, n+ioffda ) ), alpha,
8885 $ a, ia, min( ja-ioffda, ja+n-1 ), desca )
8895 SUBROUTINE pzladom( INPLACE, N, ALPHA, A, IA, JA, DESCA )
9023 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
9024 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
9026 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
9027 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
9028 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
9029 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
9032 LOGICAL GODOWN, GOLEFT
9033 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
9034 $ IMB1, IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP,
9035 $ JJA, JOFFA, JOFFD, LCMT, LCMT00, LDA, LDAP1,
9036 $ LMBLOC, LNBLOC, LOW, MB, MBLKD, MBLKS, MBLOC,
9037 $ MRCOL, MRROW, MYCOL, MYROW, NB, NBLKD, NBLKS,
9038 $ NBLOC, NP, NPCOL, NPROW, NQ, PMB, QNB, UPP
9042 INTEGER DESCA2( DLEN_ )
9049 INTRINSIC abs, dble, dcmplx, dimag,
max,
min
9059 ictxt = desca2( ctxt_ )
9060 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
9065 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
9066 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
9067 $ iacol, mrrow, mrcol )
9082 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
9083 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
9084 $ lnbloc, ilow, low, iupp, upp )
9088 lda = desca2( lld_ )
9091 IF( desca2( rsrc_ ).LT.0 )
THEN
9096 IF( desca2( csrc_ ).LT.0 )
THEN
9105 godown = ( lcmt00.GT.iupp )
9106 goleft = ( lcmt00.LT.ilow )
9108 IF( .NOT.godown .AND. .NOT.goleft )
THEN
9112 IF( lcmt00.GE.0 )
THEN
9113 ijoffa = ioffa+lcmt00 + ( joffa - 1 ) * lda
9114 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
9115 atmp = a( ijoffa + i*ldap1 )
9116 a( ijoffa + i*ldap1 ) = alpha +
9117 $ dcmplx( abs( dble( atmp ) ),
9118 $ abs( dimag( atmp ) ) )
9121 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
9122 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
9123 atmp = a( ijoffa + i*ldap1 )
9124 a( ijoffa + i*ldap1 ) = alpha +
9125 $ dcmplx( abs( dble( atmp ) ),
9126 $ abs( dimag( atmp ) ) )
9129 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
9130 godown = .NOT.goleft
9136 lcmt00 = lcmt00 - ( iupp - upp + pmb )
9138 ioffa = ioffa + imbloc
9141 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
9142 lcmt00 = lcmt00 - pmb
9154 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
9157 IF( lcmt.GE.0 )
THEN
9158 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
9159 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
9160 atmp = a( ijoffa + i*ldap1 )
9161 a( ijoffa + i*ldap1 ) = alpha +
9162 $ dcmplx( abs( dble( atmp ) ),
9163 $ abs( dimag( atmp ) ) )
9166 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
9167 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
9168 atmp = a( ijoffa + i*ldap1 )
9169 a( ijoffa + i*ldap1 ) = alpha +
9170 $ dcmplx( abs( dble( atmp ) ),
9171 $ abs( dimag( atmp ) ) )
9179 ioffd = ioffd + mbloc
9183 lcmt00 = lcmt00 + low - ilow + qnb
9185 joffa = joffa + inbloc
9187 ELSE IF( goleft )
THEN
9189 lcmt00 = lcmt00 + low - ilow + qnb
9191 joffa = joffa + inbloc
9194 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
9195 lcmt00 = lcmt00 + qnb
9207 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
9210 IF( lcmt.GE.0 )
THEN
9211 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
9212 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
9213 atmp = a( ijoffa + i*ldap1 )
9214 a( ijoffa + i*ldap1 ) = alpha +
9215 $ dcmplx( abs( dble( atmp ) ),
9216 $ abs( dimag( atmp ) ) )
9219 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
9220 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
9221 atmp = a( ijoffa + i*ldap1 )
9222 a( ijoffa + i*ldap1 ) = alpha +
9223 $ dcmplx( abs( dble( atmp ) ),
9224 $ abs( dimag( atmp ) ) )
9232 joffd = joffd + nbloc
9236 lcmt00 = lcmt00 - ( iupp - upp + pmb )
9238 ioffa = ioffa + imbloc
9244 IF( nblks.GT.0 )
THEN
9248 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
9249 lcmt00 = lcmt00 - pmb
9261 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
9264 IF( lcmt.GE.0 )
THEN
9265 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
9266 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
9267 atmp = a( ijoffa + i*ldap1 )
9268 a( ijoffa + i*ldap1 ) = alpha +
9269 $ dcmplx( abs( dble( atmp ) ),
9270 $ abs( dimag( atmp ) ) )
9273 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
9274 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
9275 atmp = a( ijoffa + i*ldap1 )
9276 a( ijoffa + i*ldap1 ) = alpha +
9277 $ dcmplx( abs( dble( atmp ) ),
9278 $ abs( dimag( atmp ) ) )
9286 ioffd = ioffd + mbloc
9290 lcmt00 = lcmt00 + qnb
9292 joffa = joffa + nbloc
9302 SUBROUTINE pb_pzlaprnt( M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT,
9303 $ CMATNM, NOUT, WORK )
9311 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT
9314 CHARACTER*(*) CMATNM
9316 COMPLEX*16 A( * ), WORK( * )
9442 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
9443 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
9445 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
9446 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
9447 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
9448 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
9451 INTEGER MYCOL, MYROW, NPCOL, NPROW, PCOL, PROW
9454 INTEGER DESCA2( DLEN_ )
9457 EXTERNAL BLACS_GRIDINFO, PB_DESCTRANS, PB_PZLAPRN2
9463 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
9468 CALL pb_desctrans( desca, desca2 )
9470 CALL blacs_gridinfo( desca2( ctxt_ ), nprow, npcol, myrow, mycol )
9472 IF( desca2( rsrc_ ).GE.0 )
THEN
9473 IF( desca2( csrc_ ).GE.0 )
THEN
9474 CALL pb_pzlaprn2( m, n, a, ia, ja, desca2, irprnt, icprnt,
9475 $ cmatnm, nout, desca2( rsrc_ ),
9476 $ desca2( csrc_ ), work )
9478 DO 10 pcol = 0, npcol - 1
9479 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9480 $
WRITE( nout, * )
'Colum-replicated array -- ' ,
9481 $
'copy in process column: ', pcol
9482 CALL pb_pzlaprn2( m, n, a, ia, ja, desca2, irprnt,
9483 $ icprnt, cmatnm, nout, desca2( rsrc_ ),
9488 IF( desca2( csrc_ ).GE.0 )
THEN
9489 DO 20 prow = 0, nprow - 1
9490 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9491 $
WRITE( nout, * )
'Row-replicated array -- ' ,
9492 $
'copy in process row: ', prow
9493 CALL pb_pzlaprn2( m, n, a, ia, ja, desca2, irprnt,
9494 $ icprnt, cmatnm, nout, prow,
9495 $ desca2( csrc_ ), work )
9498 DO 40 prow = 0, nprow - 1
9499 DO 30 pcol = 0, npcol - 1
9500 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9501 $
WRITE( nout, * )
'Replicated array -- ' ,
9502 $
'copy in process (', prow,
',', pcol,
')'
9503 CALL pb_pzlaprn2( m, n, a, ia, ja, desca2, irprnt,
9504 $ icprnt, cmatnm, nout, prow, pcol,
9516 SUBROUTINE pb_pzlaprn2( M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT,
9517 $ CMATNM, NOUT, PROW, PCOL, WORK )
9525 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT, PCOL, PROW
9528 CHARACTER*(*) CMATNM
9530 COMPLEX*16 A( * ), WORK( * )
9534 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
9535 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
9537 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
9538 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
9539 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
9540 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
9543 LOGICAL AISCOLREP, AISROWREP
9544 INTEGER H, I, IACOL, IAROW, IB, ICTXT, ICURCOL,
9545 $ ICURROW, II, IIA, IN, J, JB, JJ, JJA, JN, K,
9546 $ LDA, LDW, MYCOL, MYROW, NPCOL, NPROW
9549 EXTERNAL blacs_barrier, blacs_gridinfo,
pb_infog2l,
9553 INTRINSIC dble, dimag,
min
9559 ictxt = desca( ctxt_ )
9560 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
9561 CALL pb_infog2l( ia, ja, desca, nprow, npcol, myrow, mycol,
9562 $ iia, jja, iarow, iacol )
9565 IF( desca( rsrc_ ).LT.0 )
THEN
9573 IF( desca( csrc_ ).LT.0 )
THEN
9582 ldw =
max( desca( imb_ ), desca( mb_ ) )
9586 jb = desca( inb_ ) - ja + 1
9588 $ jb = ( (-jb) / desca( nb_ ) + 1 ) * desca( nb_ ) + jb
9592 ib = desca( imb_ ) - ia + 1
9594 $ ib = ( (-ib) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
9597 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9598 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9600 WRITE( nout, fmt = 9999 )
9601 $ cmatnm, ia+k, ja+h,
9602 $ dble( a( ii+k+(jj+h-1)*lda ) ),
9603 $ dimag( a( ii+k+(jj+h-1)*lda ) )
9607 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9608 CALL zgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ), lda,
9610 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9611 CALL zgerv2d( ictxt, ib, 1, work, ldw, icurrow, icurcol )
9613 WRITE( nout, fmt = 9999 )
9614 $ cmatnm, ia+k-1, ja+h, dble( work( k ) ),
9615 $ dimag( work( k ) )
9619 IF( myrow.EQ.icurrow )
9621 IF( .NOT.aisrowrep )
9622 $ icurrow = mod( icurrow+1, nprow )
9623 CALL blacs_barrier( ictxt,
'All' )
9627 DO 50 i = in+1, ia+m-1, desca( mb_ )
9628 ib =
min( desca( mb_ ), ia+m-i )
9629 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9630 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9632 WRITE( nout, fmt = 9999 )
9633 $ cmatnm, i+k, ja+h,
9634 $ dble( a( ii+k+(jj+h-1)*lda ) ),
9635 $ dimag( a( ii+k+(jj+h-1)*lda ) )
9639 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9640 CALL zgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9641 $ lda, irprnt, icprnt )
9642 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9643 CALL zgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9646 WRITE( nout, fmt = 9999 )
9647 $ cmatnm, i+k-1, ja+h, dble( work( k ) ),
9648 $ dimag( work( k ) )
9652 IF( myrow.EQ.icurrow )
9654 IF( .NOT.aisrowrep )
9655 $ icurrow = mod( icurrow+1, nprow )
9656 CALL blacs_barrier( ictxt,
'All' )
9663 IF( mycol.EQ.icurcol )
9665 IF( .NOT.aiscolrep )
9666 $ icurcol = mod( icurcol+1, npcol )
9667 CALL blacs_barrier( ictxt,
'All' )
9671 DO 130 j = jn+1, ja+n-1, desca( nb_ )
9672 jb =
min( desca( nb_ ), ja+n-j )
9674 ib = desca( imb_ )-ia+1
9676 $ ib = ( (-ib) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
9679 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9680 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9682 WRITE( nout, fmt = 9999 )
9683 $ cmatnm, ia+k, j+h,
9684 $ dble( a( ii+k+(jj+h-1)*lda ) ),
9685 $ dimag( a( ii+k+(jj+h-1)*lda ) )
9689 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9690 CALL zgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9691 $ lda, irprnt, icprnt )
9692 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9693 CALL zgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9696 WRITE( nout, fmt = 9999 )
9697 $ cmatnm, ia+k-1, j+h, dble( work( k ) ),
9698 $ dimag( work( k ) )
9702 IF( myrow.EQ.icurrow )
9704 icurrow = mod( icurrow+1, nprow )
9705 CALL blacs_barrier( ictxt,
'All' )
9709 DO 110 i = in+1, ia+m-1, desca( mb_ )
9710 ib =
min( desca( mb_ ), ia+m-i )
9711 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9712 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9714 WRITE( nout, fmt = 9999 )
9716 $ dble( a( ii+k+(jj+h-1)*lda ) ),
9717 $ dimag( a( ii+k+(jj+h-1)*lda ) )
9721 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9722 CALL zgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9723 $ lda, irprnt, icprnt )
9724 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9725 CALL zgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9728 WRITE( nout, fmt = 9999 )
9729 $ cmatnm, i+k-1, j+h, dble( work( k ) ),
9730 $ dimag( work( k ) )
9734 IF( myrow.EQ.icurrow )
9736 IF( .NOT.aisrowrep )
9737 $ icurrow = mod( icurrow+1, nprow )
9738 CALL blacs_barrier( ictxt,
'All' )
9745 IF( mycol.EQ.icurcol )
9747 IF( .NOT.aiscolrep )
9748 $ icurcol = mod( icurcol+1, npcol )
9749 CALL blacs_barrier( ictxt,
'All' )
9753 9999
FORMAT( 1x, a,
'(', i6,
',', i6,
')=', d30.18,
'+i*(',
9761 SUBROUTINE pb_zfillpad( ICTXT, M, N, A, LDA, IPRE, IPOST, CHKVAL )
9769 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9835 IF( IPRE.GT.0 ) THEN
9840 WRITE( *, fmt =
'(A)' )
9841 $
'WARNING no pre-guardzone in PB_ZFILLPAD'
9846 IF( ipost.GT.0 )
THEN
9848 DO 20 i = j, j+ipost-1
9852 WRITE( *, fmt =
'(A)' )
9853 $
'WARNING no post-guardzone in PB_ZFILLPAD'
9861 DO 30 i = k, k + ( lda - m ) - 1
9873 SUBROUTINE pb_zchekpad( ICTXT, MESS, M, N, A, LDA, IPRE, IPOST,
9882 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9963 INTEGER I, IAM, IDUMM, INFO, J, K, MYCOL, MYROW, NPCOL,
9967 EXTERNAL BLACS_GRIDINFO, IGAMX2D, PB_TOPGET
9970 INTRINSIC DBLE, DIMAG
9976 CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
9977 IAM = myrow*npcol + mycol
9982 IF( ipre.GT.0 )
THEN
9984 IF( a( i ).NE.chkval )
THEN
9985 WRITE( *, fmt = 9998 ) myrow, mycol, mess,
' pre', i,
9986 $ dble( a( i ) ), dimag( a( i ) )
9991 WRITE( *, fmt = * )
'WARNING no pre-guardzone in PB_ZCHEKPAD'
9996 IF( ipost.GT.0 )
THEN
9998 DO 20 i = j, j+ipost-1
9999 IF( a( i ).NE.chkval )
THEN
10000 WRITE( *, fmt = 9998 ) myrow, mycol, mess,
'post',
10001 $ i-j+1, dble( a( i ) ),
10007 WRITE( *, fmt = * )
10008 $
'WARNING no post-guardzone buffer in PB_ZCHEKPAD'
10013 IF( lda.GT.m )
THEN
10016 DO 30 i = k, k + (lda-m) - 1
10017 IF( a( i ).NE.chkval )
THEN
10018 WRITE( *, fmt = 9997 ) myrow, mycol, mess,
10019 $ i-ipre-lda*(j-1), j, dble( a( i ) ),
10028 CALL pb_topget( ictxt,
'Combine',
'All', top )
10029 CALL igamx2d( ictxt,
'All', top, 1, 1, info, 1, idumm, idumm, -1,
10031 IF( iam.EQ.0 .AND. info.GE.0 )
THEN
10032 WRITE( *, fmt = 9999 ) info / npcol, mod( info, npcol ), mess
10035 9999
FORMAT(
'{', i5,
',', i5,
'}: Memory overwrite in ', a )
10036 9998
FORMAT(
'{', i5,
',', i5,
'}: ', a,
' memory overwrite in ',
10037 $ a4,
'-guardzone: loc(', i3,
') = ', g20.7,
'+ i*',
10039 9997
FORMAT(
'{', i5,
',', i5,
'}: ', a,
' memory overwrite in ',
10040 $
'lda-m gap: loc(', i3,
',', i3,
') = ', g20.7,
10048 SUBROUTINE pb_zlaset( UPLO, M, N, IOFFD, ALPHA, BETA, A, LDA )
10057 INTEGER IOFFD, LDA, M, N
10058 COMPLEX*16 ALPHA, BETA
10061 COMPLEX*16 A( LDA, * )
10158 INTEGER I, J, JTMP, MN
10171 IF( M.LE.0 .OR. N.LE.0 )
10176 IF( LSAME( UPLO,
'L' ) ) THEN
10181 mn = max( 0, -ioffd )
10182 DO 20 j = 1, min( mn, n )
10187 DO 40 j = mn + 1, min( m - ioffd, n )
10189 a( jtmp, j ) = beta
10190 DO 30 i = jtmp + 1, m
10195 ELSE IF( lsame( uplo,
'U' ) )
THEN
10200 mn = min( m - ioffd, n )
10201 DO 60 j = max( 0, -ioffd ) + 1, mn
10203 DO 50 i = 1, jtmp - 1
10206 a( jtmp, j ) = beta
10208 DO 80 j = max( 0, mn ) + 1, n
10214 ELSE IF( lsame( uplo,
'D' ) )
THEN
10218 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10219 a( j + ioffd, j ) = beta
10232 IF( alpha.NE.beta .AND. ioffd.LT.m .AND. ioffd.GT.-n )
THEN
10233 DO 120 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10234 a( j + ioffd, j ) = beta
10245 SUBROUTINE pb_zlascal( UPLO, M, N, IOFFD, ALPHA, A, LDA )
10254 INTEGER IOFFD, LDA, M, N
10258 COMPLEX*16 A( LDA, * )
10348 INTEGER I, J, JTMP, MN
10361 IF( M.LE.0 .OR. N.LE.0 )
10366 IF( LSAME( UPLO,
'L' ) ) THEN
10370 MN = max( 0, -ioffd )
10371 DO 20 j = 1, min( mn, n )
10373 a( i, j ) = alpha * a( i, j )
10376 DO 40 j = mn + 1, min( m - ioffd, n )
10377 DO 30 i = j + ioffd, m
10378 a( i, j ) = alpha * a( i, j )
10382 ELSE IF( lsame( uplo,
'U' ) )
THEN
10386 mn = min( m - ioffd, n )
10387 DO 60 j = max( 0, -ioffd ) + 1, mn
10388 DO 50 i = 1, j + ioffd
10389 a( i, j ) = alpha * a( i, j )
10392 DO 80 j = max( 0, mn ) + 1, n
10394 a( i, j ) = alpha * a( i, j )
10398 ELSE IF( lsame( uplo,
'D' ) )
THEN
10402 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10404 a( jtmp, j ) = alpha * a( jtmp, j )
10413 a( i, j ) = alpha * a( i, j )
10424 SUBROUTINE pb_zlagen( UPLO, AFORM, A, LDA, LCMT00, IRAN, MBLKS,
10425 $ IMBLOC, MB, LMBLOC, NBLKS, INBLOC, NB,
10426 $ LNBLOC, JMP, IMULADD )
10434 CHARACTER*1 UPLO, AFORM
10435 INTEGER IMBLOC, INBLOC, LCMT00, LDA, LMBLOC, LNBLOC,
10436 $ mb, mblks, nb, nblks
10439 INTEGER IMULADD( 4, * ), IRAN( * ), JMP( * )
10440 COMPLEX*16 A( LDA, * )
10543 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
10544 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
10545 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
10546 PARAMETER ( JMP_1 = 1, jmp_row = 2, jmp_col = 3,
10547 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
10548 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
10549 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
10551 DOUBLE PRECISION ZERO
10552 PARAMETER ( ZERO = 0.0d+0 )
10555 INTEGER I, IB, IBLK, II, IK, ITMP, JB, JBLK, JJ, JK,
10556 $ JTMP, LCMTC, LCMTR, LOW, MNB, UPP
10560 INTEGER IB0( 2 ), IB1( 2 ), IB2( 2 ), IB3( 2 )
10567 DOUBLE PRECISION PB_DRAND
10568 EXTERNAL lsame, pb_drand
10571 INTRINSIC dble, dcmplx,
max,
min
10576 ib1( i ) = iran( i )
10577 ib2( i ) = iran( i )
10578 ib3( i ) = iran( i )
10581 IF( lsame( aform,
'N' ) )
THEN
10587 DO 50 jblk = 1, nblks
10589 IF( jblk.EQ.1 )
THEN
10591 ELSE IF( jblk.EQ.nblks )
THEN
10597 DO 40 jk = jj, jj + jb - 1
10601 DO 30 iblk = 1, mblks
10603 IF( iblk.EQ.1 )
THEN
10605 ELSE IF( iblk.EQ.mblks )
THEN
10613 DO 20 ik = ii, ii + ib - 1
10614 a( ik, jk ) = dcmplx( pb_drand( 0 ),
10620 IF( iblk.EQ.1 )
THEN
10624 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
10631 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1, ib0 )
10635 ib1( 1 ) = ib0( 1 )
10636 ib1( 2 ) = ib0( 2 )
10642 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
10644 ib1( 1 ) = ib0( 1 )
10645 ib1( 2 ) = ib0( 2 )
10646 ib2( 1 ) = ib0( 1 )
10647 ib2( 2 ) = ib0( 2 )
10653 IF( jblk.EQ.1 )
THEN
10657 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
10663 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
10667 ib1( 1 ) = ib0( 1 )
10668 ib1( 2 ) = ib0( 2 )
10669 ib2( 1 ) = ib0( 1 )
10670 ib2( 2 ) = ib0( 2 )
10671 ib3( 1 ) = ib0( 1 )
10672 ib3( 2 ) = ib0( 2 )
10676 ELSE IF( lsame( aform,
'T' ) )
THEN
10683 DO 90 iblk = 1, mblks
10685 IF( iblk.EQ.1 )
THEN
10687 ELSE IF( iblk.EQ.mblks )
THEN
10693 DO 80 ik = ii, ii + ib - 1
10697 DO 70 jblk = 1, nblks
10699 IF( jblk.EQ.1 )
THEN
10701 ELSE IF( jblk.EQ.nblks )
THEN
10709 DO 60 jk = jj, jj + jb - 1
10710 a( ik, jk ) = dcmplx( pb_drand( 0 ),
10716 IF( jblk.EQ.1 )
THEN
10720 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
10727 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1, ib0 )
10731 ib1( 1 ) = ib0( 1 )
10732 ib1( 2 ) = ib0( 2 )
10738 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
10740 ib1( 1 ) = ib0( 1 )
10741 ib1( 2 ) = ib0( 2 )
10742 ib2( 1 ) = ib0( 1 )
10743 ib2( 2 ) = ib0( 2 )
10749 IF( iblk.EQ.1 )
THEN
10753 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
10759 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
10763 ib1( 1 ) = ib0( 1 )
10764 ib1( 2 ) = ib0( 2 )
10765 ib2( 1 ) = ib0( 1 )
10766 ib2( 2 ) = ib0( 2 )
10767 ib3( 1 ) = ib0( 1 )
10768 ib3( 2 ) = ib0( 2 )
10772 ELSE IF( lsame( aform,
'S' ) )
THEN
10776 IF( lsame( uplo,
'L' ) )
THEN
10783 DO 170 jblk = 1, nblks
10785 IF( jblk.EQ.1 )
THEN
10788 ELSE IF( jblk.EQ.nblks )
THEN
10796 DO 160 jk = jj, jj + jb - 1
10801 DO 150 iblk = 1, mblks
10803 IF( iblk.EQ.1 )
THEN
10806 ELSE IF( iblk.EQ.mblks )
THEN
10816 IF( lcmtr.GT.upp )
THEN
10818 DO 100 ik = ii, ii + ib - 1
10819 dummy = dcmplx( pb_drand( 0 ),
10823 ELSE IF( lcmtr.GE.low )
THEN
10826 mnb =
max( 0, -lcmtr )
10828 IF( jtmp.LE.
min( mnb, jb ) )
THEN
10830 DO 110 ik = ii, ii + ib - 1
10831 a( ik, jk ) = dcmplx( pb_drand( 0 ),
10835 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
10836 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
10838 itmp = ii + jtmp + lcmtr - 1
10840 DO 120 ik = ii, itmp - 1
10841 dummy = dcmplx( pb_drand( 0 ),
10845 DO 130 ik = itmp, ii + ib - 1
10846 a( ik, jk ) = dcmplx( pb_drand( 0 ),
10854 DO 140 ik = ii, ii + ib - 1
10855 a( ik, jk ) = dcmplx( pb_drand( 0 ),
10863 IF( iblk.EQ.1 )
THEN
10867 lcmtr = lcmtr - jmp( jmp_npimbloc )
10868 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
10875 lcmtr = lcmtr - jmp( jmp_npmb )
10876 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
10881 ib1( 1 ) = ib0( 1 )
10882 ib1( 2 ) = ib0( 2 )
10888 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
10890 ib1( 1 ) = ib0( 1 )
10891 ib1( 2 ) = ib0( 2 )
10892 ib2( 1 ) = ib0( 1 )
10893 ib2( 2 ) = ib0( 2 )
10899 IF( jblk.EQ.1 )
THEN
10903 lcmtc = lcmtc + jmp( jmp_nqinbloc )
10904 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
10910 lcmtc = lcmtc + jmp( jmp_nqnb )
10911 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
10915 ib1( 1 ) = ib0( 1 )
10916 ib1( 2 ) = ib0( 2 )
10917 ib2( 1 ) = ib0( 1 )
10918 ib2( 2 ) = ib0( 2 )
10919 ib3( 1 ) = ib0( 1 )
10920 ib3( 2 ) = ib0( 2 )
10931 DO 250 iblk = 1, mblks
10933 IF( iblk.EQ.1 )
THEN
10936 ELSE IF( iblk.EQ.mblks )
THEN
10944 DO 240 ik = ii, ii + ib - 1
10949 DO 230 jblk = 1, nblks
10951 IF( jblk.EQ.1 )
THEN
10954 ELSE IF( jblk.EQ.nblks )
THEN
10964 IF( lcmtc.LT.low )
THEN
10966 DO 180 jk = jj, jj + jb - 1
10967 dummy = dcmplx( pb_drand( 0 ),
10971 ELSE IF( lcmtc.LE.upp )
THEN
10974 mnb =
max( 0, lcmtc )
10976 IF( itmp.LE.
min( mnb, ib ) )
THEN
10978 DO 190 jk = jj, jj + jb - 1
10979 a( ik, jk ) = dcmplx( pb_drand( 0 ),
10983 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
10984 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
10986 jtmp = jj + itmp - lcmtc - 1
10988 DO 200 jk = jj, jtmp - 1
10989 dummy = dcmplx( pb_drand( 0 ),
10993 DO 210 jk = jtmp, jj + jb - 1
10994 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11002 DO 220 jk = jj, jj + jb - 1
11003 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11011 IF( jblk.EQ.1 )
THEN
11015 lcmtc = lcmtc + jmp( jmp_nqinbloc )
11016 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
11023 lcmtc = lcmtc + jmp( jmp_nqnb )
11024 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
11029 ib1( 1 ) = ib0( 1 )
11030 ib1( 2 ) = ib0( 2 )
11036 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
11038 ib1( 1 ) = ib0( 1 )
11039 ib1( 2 ) = ib0( 2 )
11040 ib2( 1 ) = ib0( 1 )
11041 ib2( 2 ) = ib0( 2 )
11047 IF( iblk.EQ.1 )
THEN
11051 lcmtr = lcmtr - jmp( jmp_npimbloc )
11052 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
11058 lcmtr = lcmtr - jmp( jmp_npmb )
11059 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
11063 ib1( 1 ) = ib0( 1 )
11064 ib1( 2 ) = ib0( 2 )
11065 ib2( 1 ) = ib0( 1 )
11066 ib2( 2 ) = ib0( 2 )
11067 ib3( 1 ) = ib0( 1 )
11068 ib3( 2 ) = ib0( 2 )
11074 ELSE IF( lsame( aform,
'C' ) )
THEN
11081 DO 290 iblk = 1, mblks
11083 IF( iblk.EQ.1 )
THEN
11085 ELSE IF( iblk.EQ.mblks )
THEN
11091 DO 280 ik = ii, ii + ib - 1
11095 DO 270 jblk = 1, nblks
11097 IF( jblk.EQ.1 )
THEN
11099 ELSE IF( jblk.EQ.nblks )
THEN
11107 DO 260 jk = jj, jj + jb - 1
11108 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11114 IF( jblk.EQ.1 )
THEN
11118 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
11125 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
11130 ib1( 1 ) = ib0( 1 )
11131 ib1( 2 ) = ib0( 2 )
11137 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
11139 ib1( 1 ) = ib0( 1 )
11140 ib1( 2 ) = ib0( 2 )
11141 ib2( 1 ) = ib0( 1 )
11142 ib2( 2 ) = ib0( 2 )
11148 IF( iblk.EQ.1 )
THEN
11152 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
11158 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
11162 ib1( 1 ) = ib0( 1 )
11163 ib1( 2 ) = ib0( 2 )
11164 ib2( 1 ) = ib0( 1 )
11165 ib2( 2 ) = ib0( 2 )
11166 ib3( 1 ) = ib0( 1 )
11167 ib3( 2 ) = ib0( 2 )
11171 ELSE IF( lsame( aform,
'H' ) )
THEN
11175 IF( lsame( uplo,
'L' ) )
THEN
11182 DO 370 jblk = 1, nblks
11184 IF( jblk.EQ.1 )
THEN
11187 ELSE IF( jblk.EQ.nblks )
THEN
11195 DO 360 jk = jj, jj + jb - 1
11200 DO 350 iblk = 1, mblks
11202 IF( iblk.EQ.1 )
THEN
11205 ELSE IF( iblk.EQ.mblks )
THEN
11215 IF( lcmtr.GT.upp )
THEN
11217 DO 300 ik = ii, ii + ib - 1
11218 dummy = dcmplx( pb_drand( 0 ),
11222 ELSE IF( lcmtr.GE.low )
THEN
11225 mnb =
max( 0, -lcmtr )
11227 IF( jtmp.LE.
min( mnb, jb ) )
THEN
11229 DO 310 ik = ii, ii + ib - 1
11230 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11234 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
11235 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
11237 itmp = ii + jtmp + lcmtr - 1
11239 DO 320 ik = ii, itmp - 1
11240 dummy = dcmplx( pb_drand( 0 ),
11244 IF( itmp.LE.( ii + ib - 1 ) )
THEN
11245 dummy = dcmplx( pb_drand( 0 ),
11247 a( itmp, jk ) = dcmplx( dble( dummy ),
11251 DO 330 ik = itmp + 1, ii + ib - 1
11252 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11260 DO 340 ik = ii, ii + ib - 1
11261 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11269 IF( iblk.EQ.1 )
THEN
11273 lcmtr = lcmtr - jmp( jmp_npimbloc )
11274 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
11281 lcmtr = lcmtr - jmp( jmp_npmb )
11282 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
11287 ib1( 1 ) = ib0( 1 )
11288 ib1( 2 ) = ib0( 2 )
11294 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
11296 ib1( 1 ) = ib0( 1 )
11297 ib1( 2 ) = ib0( 2 )
11298 ib2( 1 ) = ib0( 1 )
11299 ib2( 2 ) = ib0( 2 )
11305 IF( jblk.EQ.1 )
THEN
11309 lcmtc = lcmtc + jmp( jmp_nqinbloc )
11310 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
11316 lcmtc = lcmtc + jmp( jmp_nqnb )
11317 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
11321 ib1( 1 ) = ib0( 1 )
11322 ib1( 2 ) = ib0( 2 )
11323 ib2( 1 ) = ib0( 1 )
11324 ib2( 2 ) = ib0( 2 )
11325 ib3( 1 ) = ib0( 1 )
11326 ib3( 2 ) = ib0( 2 )
11337 DO 450 iblk = 1, mblks
11339 IF( iblk.EQ.1 )
THEN
11342 ELSE IF( iblk.EQ.mblks )
THEN
11350 DO 440 ik = ii, ii + ib - 1
11355 DO 430 jblk = 1, nblks
11357 IF( jblk.EQ.1 )
THEN
11360 ELSE IF( jblk.EQ.nblks )
THEN
11370 IF( lcmtc.LT.low )
THEN
11372 DO 380 jk = jj, jj + jb - 1
11373 dummy = dcmplx( pb_drand( 0 ),
11377 ELSE IF( lcmtc.LE.upp )
THEN
11380 mnb =
max( 0, lcmtc )
11382 IF( itmp.LE.
min( mnb, ib ) )
THEN
11384 DO 390 jk = jj, jj + jb - 1
11385 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11389 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
11390 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
11392 jtmp = jj + itmp - lcmtc - 1
11394 DO 400 jk = jj, jtmp - 1
11395 dummy = dcmplx( pb_drand( 0 ),
11399 IF( jtmp.LE.( jj + jb - 1 ) )
THEN
11400 dummy = dcmplx( pb_drand( 0 ),
11402 a( ik, jtmp ) = dcmplx( dble( dummy ),
11406 DO 410 jk = jtmp + 1, jj + jb - 1
11407 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11415 DO 420 jk = jj, jj + jb - 1
11416 a( ik, jk ) = dcmplx( pb_drand( 0 ),
11424 IF( jblk.EQ.1 )
THEN
11428 lcmtc = lcmtc + jmp( jmp_nqinbloc )
11429 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
11436 lcmtc = lcmtc + jmp( jmp_nqnb )
11437 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
11442 ib1( 1 ) = ib0( 1 )
11443 ib1( 2 ) = ib0( 2 )
11449 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
11451 ib1( 1 ) = ib0( 1 )
11452 ib1( 2 ) = ib0( 2 )
11453 ib2( 1 ) = ib0( 1 )
11454 ib2( 2 ) = ib0( 2 )
11460 IF( iblk.EQ.1 )
THEN
11464 lcmtr = lcmtr - jmp( jmp_npimbloc )
11465 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
11471 lcmtr = lcmtr - jmp( jmp_npmb )
11472 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
11476 ib1( 1 ) = ib0( 1 )
11477 ib1( 2 ) = ib0( 2 )
11478 ib2( 1 ) = ib0( 1 )
11479 ib2( 2 ) = ib0( 2 )
11480 ib3( 1 ) = ib0( 1 )
11481 ib3( 2 ) = ib0( 2 )
11494 DOUBLE PRECISION FUNCTION pb_drand( IDUMM )
11540 DOUBLE PRECISION one, two
11541 PARAMETER ( one = 1.0d+0, two = 2.0d+0 )
11556 DOUBLE PRECISION FUNCTION pb_dran( IDUMM )
11601 DOUBLE PRECISION divfac, pow16
11602 PARAMETER ( divfac = 2.147483648d+9,
11603 $ pow16 = 6.5536d+4 )
11615 INTEGER iacs( 4 ), irand( 2 )
11616 common /rancom/ irand, iacs
11623 pb_dran = ( dble( irand( 1 ) ) + pow16 * dble( irand( 2 ) ) ) /
11626 CALL pb_lmul( irand, iacs, j )
11627 CALL pb_ladd( j, iacs( 3 ), irand )