1 SUBROUTINE pcoptee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
9 INTEGER ICTXT, NOUT, SCODE
156 IF( scode.EQ.21 )
THEN
161 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
163 ELSE IF( scode.EQ.22 .OR. scode.EQ.25 .OR. scode.EQ.26 .OR.
169 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
171 ELSE IF( scode.EQ.23 )
THEN
176 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
181 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
186 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'D', apos )
190 ELSE IF( scode.EQ.31 )
THEN
195 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
200 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'B', apos )
202 ELSE IF( scode.EQ.32 )
THEN
207 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'S', apos )
212 CALL pcchkopt( 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 pcchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
225 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
227 ELSE IF( scode.EQ.38 )
THEN
232 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'S', apos )
237 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
242 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
247 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'D', apos )
250 ELSE IF( scode.EQ.39 )
THEN
255 CALL pcchkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
264 SUBROUTINE pcchkopt( 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 pcdimee( 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 pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
619 ELSE IF( scode.EQ.21 )
THEN
624 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
629 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
631 ELSE IF( scode.EQ.22 .OR. scode.EQ.25 .OR. scode.EQ.26 .OR.
637 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
639 ELSE IF( scode.EQ.23 )
THEN
644 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
646 ELSE IF( scode.EQ.24 )
THEN
651 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
656 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
660 ELSE IF( scode.EQ.31 )
THEN
665 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
670 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
675 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'K', apos )
677 ELSE IF( scode.EQ.32 )
THEN
682 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
687 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
689 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 .OR. scode.EQ.35 .OR.
695 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
700 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'K', apos )
702 ELSE IF( scode.EQ.37 )
THEN
707 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
712 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
714 ELSE IF( scode.EQ.38 )
THEN
719 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
724 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
726 ELSE IF( scode.EQ.39 )
THEN
731 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
736 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
738 ELSE IF( scode.EQ.40 )
THEN
743 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
748 CALL pcchkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
757 SUBROUTINE pcchkdim( 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 pcvecee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
943 INTEGER ICTXT, NOUT, SCODE
1092 IF( scode.EQ.11 )
THEN
1097 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1102 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1104 ELSE IF( scode.EQ.12 .OR. scode.EQ.15 )
THEN
1109 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1111 ELSE IF( scode.EQ.13 )
THEN
1116 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1121 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1123 ELSE IF( scode.EQ.14 )
THEN
1128 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1132 ELSE IF( scode.EQ.21 )
THEN
1137 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1142 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1144 ELSE IF( scode.EQ.22 )
THEN
1149 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1154 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1156 ELSE IF( scode.EQ.23 )
THEN
1161 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1163 ELSE IF( scode.EQ.24 .OR. scode.EQ.27 )
THEN
1168 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1173 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1175 ELSE IF( scode.EQ.26 .OR. scode.EQ.27 )
THEN
1180 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1189 SUBROUTINE pcmatee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
1197 INTEGER ICTXT, NOUT, SCODE
1346 IF( scode.EQ.21 .OR. scode.EQ.23 )
THEN
1351 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1353 ELSE IF( scode.EQ.22 )
THEN
1358 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1360 ELSE IF( scode.EQ.24 .OR. scode.EQ.27 )
THEN
1365 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1367 ELSE IF( scode.EQ.25 .OR. scode.EQ.26 )
THEN
1372 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1376 ELSE IF( scode.EQ.31 )
THEN
1381 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1386 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1391 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1393 ELSE IF( scode.EQ.32 .OR. scode.EQ.35 .OR. scode.EQ.36 )
THEN
1398 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1403 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1408 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1410 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 )
THEN
1415 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1420 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1422 ELSE IF( scode.EQ.37 )
THEN
1427 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1432 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1434 ELSE IF( scode.EQ.38 )
THEN
1439 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1444 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1446 ELSE IF( scode.EQ.39 )
THEN
1451 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1456 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1458 ELSE IF( scode.EQ.40 )
THEN
1463 CALL pcchkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1468 CALL pcchkmat( 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 )
1579 parameter( one = ( 1.0e+0, 0.0e+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
1591 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
1592 $ descx( dlen_ ), descy( dlen_ )
1593 COMPLEX 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 pcchkmat( 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
2325 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
2326 $ descx( dlen_ ), descy( dlen_ )
2327 COMPLEX 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 )
2566 INTRINSIC abs, aimag,
max, real
2570 err = abs( psdiff( real( xtrue ), real( x ) ) )
2571 err =
max( err, abs( psdiff( aimag( xtrue ), aimag( x ) ) ) )
2573 errmax =
max( errmax, err )
2580 SUBROUTINE pcchkvin( ERRMAX, N, X, PX, IX, JX, DESCX, INCX,
2589 INTEGER INCX, INFO, IX, JX, N
2594 COMPLEX 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 )
2726 PARAMETER ( ZERO = 0.0e+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
2743 INTRINSIC abs, aimag,
max,
min, mod, real
2755 ictxt = descx( ctxt_ )
2756 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
2758 eps = pslamch( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 pcerrset( err, errmax, x( i+kk+(jx-1)*ldx ),
2846 $ px( iix+kk+(jjx-1)*ldpx ) )
2853 icurrow = mod( icurrow+1, nprow )
2861 CALL sgamx2d( 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
2883 INTEGER INCX, INFO, IX, JX, N
2887 COMPLEX 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 )
3015 PARAMETER ( ZERO = 0.0e+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 REAL EPS, ERR, ERRMAX
3026 EXTERNAL BLACS_GRIDINFO, PCERRSET, SGAMX2D
3031 EXTERNAL PSLAMCH, PB_NUMROC
3034 INTRINSIC abs, aimag,
max,
min, mod, real
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 = pslamch( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 sgamx2d( 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 pcchkmin( ERRMAX, M, N, A, PA, IA, JA, DESCA, INFO )
3339 INTEGER IA, INFO, JA, M, N
3344 COMPLEX 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 )
3475 PARAMETER ( ZERO = 0.0e+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
3492 INTRINSIC abs, aimag,
max,
min, mod, real
3501 IF( ( m.EQ.0 ).OR.( n.EQ.0 ) )
3506 ictxt = desca( ctxt_ )
3507 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3509 eps = pslamch( 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 pcerrset( 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 pcerrset( 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 pcerrset( 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 sgamx2d( 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
3640 INTEGER IA, INFO, JA, M, N
3644 COMPLEX 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 )
3771 PARAMETER ( ZERO = 0.0e+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 REAL EPS, ERR, ERRMAX
3781 EXTERNAL blacs_gridinfo,
pcerrset, sgamx2d
3786 EXTERNAL PSLAMCH, 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 = pslamch( 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 pcerrset( 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 sgamx2d( 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 pcmprnt( ICTXT, NOUT, M, N, A, LDA, IRPRNT, ICPRNT,
3962 INTEGER ICPRNT, ICTXT, IRPRNT, LDA, M, N, NOUT
3965 CHARACTER*(*) CMATNM
4022 INTEGER I, J, MYCOL, MYROW, NPCOL, NPROW
4025 EXTERNAL BLACS_GRIDINFO
4028 INTRINSIC aimag, real
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 $ real( a( i, j ) ), aimag( a( i, j ) )
4057 9999
FORMAT( 1x, a,
'(', i6,
',', i6,
')=', e16.8,
'+i*(',
4065 SUBROUTINE pcvprnt( 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 aimag, real
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, real( x( i ) ),
4162 9999
FORMAT( 1x, a,
'(', i6,
')=', e16.8,
'+i*(', e16.8,
')' )
4169 SUBROUTINE pcmvch( 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,
4186 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4188 COMPLEX 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 )
4377 parameter( rzero = 0.0e+0, rone = 1.0e+0 )
4379 PARAMETER ( ZERO = ( 0.0e+0, 0.0e+0 ),
4380 $ one = ( 1.0e+0, 0.0e+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 REAL EPS, ERRI, GTMP
4389 COMPLEX C, TBETA, YTMP
4392 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
4397 EXTERNAL lsame, pslamch
4400 INTRINSIC abs, aimag, conjg,
max,
min, mod, real, sqrt
4404 abs1( c ) = abs( real( c ) ) + abs( aimag( c ) )
4408 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4410 eps = pslamch( 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 + conjg( 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 sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
4603 SUBROUTINE pcvmch( 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,
4620 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4622 COMPLEX 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 )
4813 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+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 REAL EPS, ERRI, GTMP
4824 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
4829 EXTERNAL LSAME, PSLAMCH
4832 INTRINSIC abs, aimag, conjg,
max,
min, mod, real, sqrt
4836 ABS1( C ) = abs( real( c ) ) + abs( aimag( c ) )
4840 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4842 eps = pslamch( 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 ) * conjg( 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 sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
4972 SUBROUTINE pcvmch2( 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,
4989 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4991 COMPLEX 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 )
5174 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+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 REAL EPS, ERRI, GTMP
5186 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
5191 EXTERNAL LSAME, PSLAMCH
5194 INTRINSIC abs, aimag, conjg,
max,
min, mod, real, sqrt
5198 abs1( c ) = abs( real( c ) ) + abs( aimag( c ) )
5202 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5204 eps = pslamch( 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 ) * conjg( y( ioffyj ) )
5244 atmp = atmp + y( ioffyi ) * conjg( alpha * x( ioffxj ) )
5245 gtmp = abs1( alpha * x( ioffxi ) ) * abs1( y( ioffyj ) )
5246 gtmp = gtmp + abs1( y( ioffyi ) ) *
5247 $ abs1( conjg( 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 sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5333 SUBROUTINE pcmmch( 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
5349 INTEGER DESCA( * ), DESCB( * ), DESCC( * )
5351 COMPLEX 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 )
5535 PARAMETER ( RZERO = 0.0e+0, rone = 1.0e+0 )
5537 PARAMETER ( ZERO = ( 0.0e+0, 0.0e+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
5548 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
5553 EXTERNAL LSAME, PSLAMCH
5556 INTRINSIC abs, aimag, conjg,
max,
min, mod, real, sqrt
5560 ABS1( Z ) = abs( real( z ) ) + abs( aimag( z ) )
5564 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5566 eps = pslamch( 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 ) + conjg( 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 $ conjg( 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 ) + conjg( a( ioffa ) ) *
5653 $ conjg( 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 ) + conjg( 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 $ conjg( 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 sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5786 SUBROUTINE pcmmch1( 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
5802 INTEGER DESCA( * ), DESCC( * )
5804 COMPLEX 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 )
5970 PARAMETER ( RZERO = 0.0e+0, rone = 1.0e+0 )
5972 PARAMETER ( ZERO = ( 0.0e+0, 0.0e+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
5983 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
5988 EXTERNAL lsame, pslamch
5991 INTRINSIC abs, aimag, conjg,
max,
min, mod, real, sqrt
5995 abs1( z ) = abs( real( z ) ) + abs( aimag( z ) )
5999 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6001 eps = pslamch( 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 $ conjg( 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 ) + conjg( a( ioffan ) ) * a( ioffak )
6067 g( i ) = g( i ) + abs1( conjg( a( ioffan ) ) ) *
6068 $ abs1( a( ioffak ) )
6073 ioffc = ic + ibeg - 1 + ( jc + j - 2 ) * ldc
6075 DO 100 i = ibeg, iend
6076 ct( i ) = alpha*ct( i ) + beta * c( ioffc )
6077 g( i ) = abs1( alpha )*g( i ) +
6078 $ abs1( beta )*abs1( c( ioffc ) )
6079 c( ioffc ) = ct( i )
6087 ldpc = descc( lld_ )
6088 ioffc = ic + ( jc + j - 2 ) * ldc
6089 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
6090 $ iic, jjc, icrow, iccol )
6092 rowrep = ( icrow.EQ.-1 )
6093 colrep = ( iccol.EQ.-1 )
6095 IF( mycol.EQ.iccol .OR. colrep )
THEN
6097 ibb = descc( imb_ ) - ic + 1
6099 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
6105 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6106 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6107 $ c( ioffc ) ) / eps
6108 IF( g( i-ic+1 ).NE.rzero )
6109 $ erri = erri / g( i-ic+1 )
6110 err =
max( err, erri )
6111 IF( err*sqrt( eps ).GE.rone )
6120 icurrow = mod( icurrow+1, nprow )
6122 DO 130 i = in+1, ic+n-1, descc( mb_ )
6123 ibb =
min( ic+n-i, descc( mb_ ) )
6125 DO 120 kk = 0, ibb-1
6127 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6128 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6130 IF( g( i+kk-ic+1 ).NE.rzero )
6131 $ erri = erri / g( i+kk-ic+1 )
6132 err =
max( err, erri )
6133 IF( err*sqrt( eps ).GE.rone )
6142 icurrow = mod( icurrow+1, nprow )
6150 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6151 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6165 SUBROUTINE pcmmch2( ICTXT, UPLO, TRANS, N, K, ALPHA, A, IA, JA,
6166 $ DESCA, B, IB, JB, DESCB, BETA, C, PC, IC,
6167 $ JC, DESCC, CT, G, ERR, INFO )
6175 CHARACTER*1 TRANS, UPLO
6176 INTEGER IA, IB, IC, ICTXT, INFO, JA, JB, JC, K, N
6181 INTEGER DESCA( * ), DESCB( * ), DESCC( * )
6183 COMPLEX A( * ), B( * ), C( * ), CT( * ),
6359 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
6360 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
6362 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
6363 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
6364 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
6365 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
6367 PARAMETER ( RZERO = 0.0e+0, rone = 1.0e+0 )
6369 PARAMETER ( ZERO = ( 0.0e+0, 0.0e+0 ) )
6372 LOGICAL COLREP, HTRAN, NOTRAN, ROWREP, TRAN, UPPER
6373 INTEGER I, IBB, IBEG, ICCOL, ICROW, ICURROW, IEND, IIC,
6374 $ IN, IOFFAK, IOFFAN, IOFFBK, IOFFBN, IOFFC, J,
6375 $ JJC, KK, LDA, LDB, LDC, LDPC, MYCOL, MYROW,
6381 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
6386 EXTERNAL lsame, pslamch
6389 INTRINSIC abs, aimag, conjg,
max,
min, mod, real, sqrt
6393 ABS1( Z ) = abs( real( z ) ) + abs( aimag( z ) )
6397 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6399 eps = pslamch( ictxt,
'eps' )
6401 upper = lsame( uplo,
'U' )
6402 htran = lsame( trans,
'H' )
6403 notran = lsame( trans,
'N' )
6404 tran = lsame( trans,
'T' )
6406 lda =
max( 1, desca( m_ ) )
6407 ldb =
max( 1, descb( m_ ) )
6408 ldc =
max( 1, descc( m_ ) )
6431 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
6432 ioffbk = ib + j - 1 + ( jb + kk - 2 ) * ldb
6433 DO 20 i = ibeg, iend
6434 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
6435 ioffbn = ib + i - 1 + ( jb + kk - 2 ) * ldb
6436 ct( i ) = ct( i ) + alpha * (
6437 $ a( ioffan ) * b( ioffbk ) +
6438 $ b( ioffbn ) * a( ioffak ) )
6439 g( i ) = g( i ) + abs( alpha ) * (
6440 $ abs1( a( ioffan ) ) * abs1( b( ioffbk ) ) +
6441 $ abs1( b( ioffbn ) ) * abs1( a( ioffak ) ) )
6444 ELSE IF( tran )
THEN
6446 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
6447 ioffbk = ib + kk - 1 + ( jb + j - 2 ) * ldb
6448 DO 40 i = ibeg, iend
6449 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
6450 ioffbn = ib + kk - 1 + ( jb + i - 2 ) * ldb
6451 ct( i ) = ct( i ) + alpha * (
6452 $ a( ioffan ) * b( ioffbk ) +
6453 $ b( ioffbn ) * a( ioffak ) )
6454 g( i ) = g( i ) + abs( alpha ) * (
6455 $ abs1( a( ioffan ) ) * abs1( b( ioffbk ) ) +
6456 $ abs1( b( ioffbn ) ) * abs1( a( ioffak ) ) )
6459 ELSE IF( htran )
THEN
6461 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
6462 ioffbk = ib + j - 1 + ( jb + kk - 2 ) * ldb
6463 DO 60 i = ibeg, iend
6464 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
6465 ioffbn = ib + i - 1 + ( jb + kk - 2 ) * ldb
6467 $ alpha * a( ioffan ) * conjg( b( ioffbk ) ) +
6468 $ b( ioffbn ) * conjg( alpha * a( ioffak ) )
6469 g( i ) = g( i ) + abs1( alpha ) * (
6470 $ abs1( a( ioffan ) ) * abs1( b( ioffbk ) ) +
6471 $ abs1( b( ioffbn ) ) * abs1( a( ioffak ) ) )
6476 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
6477 ioffbk = ib + kk - 1 + ( jb + j - 2 ) * ldb
6478 DO 80 i = ibeg, iend
6479 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
6480 ioffbn = ib + kk - 1 + ( jb + i - 2 ) * ldb
6482 $ alpha * conjg( a( ioffan ) ) * b( ioffbk ) +
6483 $ conjg( alpha * b( ioffbn ) ) * a( ioffak )
6484 g( i ) = g( i ) + abs1( alpha ) * (
6485 $ abs1( conjg( a( ioffan ) ) * b( ioffbk ) ) +
6486 $ abs1( conjg( b( ioffbn ) ) * a( ioffak ) ) )
6491 ioffc = ic + ibeg - 1 + ( jc + j - 2 ) * ldc
6493 DO 100 i = ibeg, iend
6494 ct( i ) = ct( i ) + beta * c( ioffc )
6495 g( i ) = g( i ) + abs1( beta )*abs1( c( ioffc ) )
6496 c( ioffc ) = ct( i )
6504 ldpc = descc( lld_ )
6505 ioffc = ic + ( jc + j - 2 ) * ldc
6506 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
6507 $ iic, jjc, icrow, iccol )
6509 rowrep = ( icrow.EQ.-1 )
6510 colrep = ( iccol.EQ.-1 )
6512 IF( mycol.EQ.iccol .OR. colrep )
THEN
6514 ibb = descc( imb_ ) - ic + 1
6516 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
6522 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6523 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6524 $ c( ioffc ) ) / eps
6525 IF( g( i-ic+1 ).NE.rzero )
6526 $ erri = erri / g( i-ic+1 )
6527 err =
max( err, erri )
6528 IF( err*sqrt( eps ).GE.rone )
6537 icurrow = mod( icurrow+1, nprow )
6539 DO 130 i = in+1, ic+n-1, descc( mb_ )
6540 ibb =
min( ic+n-i, descc( mb_ ) )
6542 DO 120 kk = 0, ibb-1
6544 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6545 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6547 IF( g( i+kk-ic+1 ).NE.rzero )
6548 $ erri = erri / g( i+kk-ic+1 )
6549 err =
max( err, erri )
6550 IF( err*sqrt( eps ).GE.rone )
6559 icurrow = mod( icurrow+1, nprow )
6567 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6568 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6582 SUBROUTINE pcmmch3( UPLO, TRANS, M, N, ALPHA, A, IA, JA, DESCA,
6583 $ BETA, C, PC, IC, JC, DESCC, ERR, INFO )
6591 CHARACTER*1 TRANS, UPLO
6592 INTEGER IA, IC, INFO, JA, JC, M, N
6597 INTEGER DESCA( * ), DESCC( * )
6598 COMPLEX A( * ), C( * ), PC( * )
6741 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
6742 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
6744 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
6745 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
6746 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
6747 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
6749 PARAMETER ( ZERO = 0.0e+0 )
6752 LOGICAL COLREP, CTRAN, LOWER, NOTRAN, ROWREP, UPPER
6753 INTEGER I, ICCOL, ICROW, ICTXT, IIC, IOFFA, IOFFC, J,
6754 $ JJC, LDA, LDC, LDPC, MYCOL, MYROW, NPCOL,
6756 REAL ERR0, ERRI, PREC
6759 EXTERNAL BLACS_GRIDINFO, IGSUM2D, PB_INFOG2L,
6765 EXTERNAL LSAME, PSLAMCH
6768 INTRINSIC abs, conjg,
max
6772 ictxt = descc( ctxt_ )
6773 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6775 prec = pslamch( ictxt,
'eps' )
6777 upper = lsame( uplo,
'U' )
6778 lower = lsame( uplo,
'L' )
6779 notran = lsame( trans,
'N' )
6780 ctran = lsame( trans,
'C' )
6788 lda =
max( 1, desca( m_ ) )
6789 ldc =
max( 1, descc( m_ ) )
6790 ldpc =
max( 1, descc( lld_ ) )
6791 rowrep = ( descc( rsrc_ ).EQ.-1 )
6792 colrep = ( descc( csrc_ ).EQ.-1 )
6796 DO 20 j = jc, jc + n - 1
6798 ioffc = ic + ( j - 1 ) * ldc
6799 ioffa = ia + ( ja - 1 + j - jc ) * lda
6801 DO 10 i = ic, ic + m - 1
6804 IF( ( j - jc ).GE.( i - ic ) )
THEN
6805 CALL pcerraxpby( erri, alpha, a( ioffa ), beta,
6806 $ c( ioffc ), prec )
6810 ELSE IF( lower )
THEN
6811 IF( ( j - jc ).LE.( i - ic ) )
THEN
6812 CALL pcerraxpby( erri, alpha, a( ioffa ), beta,
6813 $ c( ioffc ), prec )
6818 CALL pcerraxpby( erri, alpha, a( ioffa ), beta,
6819 $ c( ioffc ), prec )
6822 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6823 $ iic, jjc, icrow, iccol )
6824 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6825 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6826 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6829 err =
max( err, err0 )
6839 ELSE IF( ctran )
THEN
6841 DO 40 j = jc, jc + n - 1
6843 ioffc = ic + ( j - 1 ) * ldc
6844 ioffa = ia + ( j - jc ) + ( ja - 1 ) * lda
6846 DO 30 i = ic, ic + m - 1
6849 IF( ( j - jc ).GE.( i - ic ) )
THEN
6850 CALL pcerraxpby( erri, alpha, conjg( a( ioffa ) ),
6851 $ beta, c( ioffc ), prec )
6855 ELSE IF( lower )
THEN
6856 IF( ( j - jc ).LE.( i - ic ) )
THEN
6857 CALL pcerraxpby( erri, alpha, conjg( a( ioffa ) ),
6858 $ beta, c( ioffc ), prec )
6863 CALL pcerraxpby( erri, alpha, conjg( a( ioffa ) ),
6864 $ beta, c( ioffc ), prec )
6867 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6868 $ iic, jjc, icrow, iccol )
6869 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6870 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6871 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6874 err =
max( err, err0 )
6886 DO 60 j = jc, jc + n - 1
6888 ioffc = ic + ( j - 1 ) * ldc
6889 ioffa = ia + ( j - jc ) + ( ja - 1 ) * lda
6891 DO 50 i = ic, ic + m - 1
6894 IF( ( j - jc ).GE.( i - ic ) )
THEN
6895 CALL pcerraxpby( erri, alpha, a( ioffa ), beta,
6896 $ c( ioffc ), prec )
6900 ELSE IF( lower )
THEN
6901 IF( ( j - jc ).LE.( i - ic ) )
THEN
6902 CALL pcerraxpby( erri, alpha, a( ioffa ), beta,
6903 $ c( ioffc ), prec )
6908 CALL pcerraxpby( erri, alpha, a( ioffa ), beta,
6909 $ c( ioffc ), prec )
6912 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6913 $ iic, jjc, icrow, iccol )
6914 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6915 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6916 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6919 err =
max( err, err0 )
6933 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6934 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6951 COMPLEX ALPHA, BETA, X, Y
6990 PARAMETER ( ONE = 1.0e+0, two = 2.0e+0,
6994 REAL ADDBND, FACT, SUMINEG, SUMIPOS, SUMRNEG,
7006 fact = one + two * prec
7007 addbnd = two * two * two * prec
7010 IF( real( tmp ).GE.zero )
THEN
7011 sumrpos = sumrpos + real( tmp ) * fact
7013 sumrneg = sumrneg - real( tmp ) * fact
7015 IF( aimag( tmp ).GE.zero )
THEN
7016 sumipos = sumipos + aimag( tmp ) * fact
7018 sumineg = sumineg - aimag( tmp ) * fact
7022 IF( real( tmp ).GE.zero )
THEN
7023 sumrpos = sumrpos + real( tmp ) * fact
7025 sumrneg = sumrneg - real( tmp ) * fact
7027 IF( aimag( tmp ).GE.zero )
THEN
7028 sumipos = sumipos + aimag( tmp ) * fact
7030 sumineg = sumineg - aimag( tmp ) * fact
7033 y = ( beta * y ) + ( alpha * x )
7035 errbnd = addbnd *
max(
max( sumrpos, sumrneg ),
7036 $
max( sumipos, sumineg ) )
7171 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
7172 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
7174 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
7175 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
7176 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
7177 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
7179 PARAMETER ( ZERO = 0.0e+0 )
7182 LOGICAL COLREP, GODOWN, GOLEFT, ROWREP
7183 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
7184 $ IMB1, IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP,
7185 $ JJA, JOFFA, JOFFD, LCMT, LCMT00, LDA, LDAP1,
7186 $ LMBLOC, LNBLOC, LOW, MB, MBLKD, MBLKS, MBLOC,
7187 $ MRCOL, MRROW, MYCOL, MYROW, NB, NBLKD, NBLKS,
7188 $ NBLOC, NP, NPCOL, NPROW, NQ, PMB, QNB, UPP
7192 INTEGER DESCA2( DLEN_ )
7201 EXTERNAL lsame, pslamch
7214 ictxt = desca2( ctxt_ )
7215 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
7220 IF( lsame( toggle,
'Z' ) )
THEN
7222 ELSE IF( lsame( toggle,
'B' ) )
THEN
7223 alpha = pslamch( ictxt,
'Epsilon' )
7224 alpha = alpha / pslamch( ictxt,
'Safe minimum' )
7227 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
7228 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
7229 $ iacol, mrrow, mrcol )
7231 IF( np.LE.0 .OR. nq.LE.0 )
7239 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
7240 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
7241 $ lnbloc, ilow, low, iupp, upp )
7245 rowrep = ( desca2( rsrc_ ).EQ.-1 )
7246 colrep = ( desca2( csrc_ ).EQ.-1 )
7247 lda = desca2( lld_ )
7264 godown = ( lcmt00.GT.iupp )
7265 goleft = ( lcmt00.LT.ilow )
7267 IF( .NOT.godown .AND. .NOT.goleft )
THEN
7271 IF( lcmt00.GE.0 )
THEN
7272 ijoffa = ioffa + lcmt00 + ( joffa - 1 ) * lda
7273 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
7274 atmp = real( a( ijoffa + i*ldap1 ) )
7275 a( ijoffa + i*ldap1 ) =
cmplx( atmp, alpha )
7278 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
7279 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
7280 atmp = real( a( ijoffa + i*ldap1 ) )
7281 a( ijoffa + i*ldap1 ) =
cmplx( atmp, alpha )
7284 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
7285 godown = .NOT.goleft
7291 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7293 ioffa = ioffa + imbloc
7296 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7297 lcmt00 = lcmt00 - pmb
7312 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
7315 IF( lcmt.GE.0 )
THEN
7316 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
7317 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
7318 atmp = real( a( ijoffa + i*ldap1 ) )
7319 a( ijoffa + i*ldap1 ) =
cmplx( atmp, alpha )
7322 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
7323 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
7324 atmp = real( a( ijoffa + i*ldap1 ) )
7325 a( ijoffa + i*ldap1 ) =
cmplx( atmp, alpha )
7333 ioffd = ioffd + mbloc
7337 lcmt00 = lcmt00 + low - ilow + qnb
7339 joffa = joffa + inbloc
7341 ELSE IF( goleft )
THEN
7343 lcmt00 = lcmt00 + low - ilow + qnb
7345 joffa = joffa + inbloc
7348 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
7349 lcmt00 = lcmt00 + qnb
7364 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
7367 IF( lcmt.GE.0 )
THEN
7368 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
7369 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
7370 atmp = real( a( ijoffa + i*ldap1 ) )
7371 a( ijoffa + i*ldap1 ) =
cmplx( atmp, alpha )
7374 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
7375 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
7376 atmp = real( a( ijoffa + i*ldap1 ) )
7377 a( ijoffa + i*ldap1 ) =
cmplx( atmp, alpha )
7385 joffd = joffd + nbloc
7389 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7391 ioffa = ioffa + imbloc
7397 IF( nblks.GT.0 )
THEN
7401 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7402 lcmt00 = lcmt00 - pmb
7417 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
7420 IF( lcmt.GE.0 )
THEN
7421 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
7422 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
7423 atmp = real( a( ijoffa + i*ldap1 ) )
7424 a( ijoffa + i*ldap1 ) =
cmplx( atmp, alpha )
7427 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
7428 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
7429 atmp = real( a( ijoffa + i*ldap1 ) )
7430 a( ijoffa + i*ldap1 ) =
cmplx( atmp, alpha )
7438 ioffd = ioffd + mbloc
7442 lcmt00 = lcmt00 + qnb
7444 joffa = joffa + nbloc
7476 EXTERNAL pb_topget, sgamn2d, sgamx2d
7487 IF(
lsame( cmach,
'E' ).OR.
lsame( cmach,
'S' ).OR.
7488 $
lsame( cmach,
'M' ).OR.
lsame( cmach,
'U' ) )
THEN
7489 CALL pb_topget( ictxt,
'Combine',
'All', top )
7491 CALL sgamx2d( ictxt,
'All', top, 1, 1, temp, 1, idumm,
7492 $ idumm, -1, -1, idumm )
7493 ELSE IF(
lsame( cmach,
'L' ).OR.
lsame( cmach,
'O' ) )
THEN
7494 CALL pb_topget( ictxt,
'Combine',
'All', top )
7496 CALL sgamn2d( ictxt,
'All', top, 1, 1, temp, 1, idumm,
7497 $ idumm, -1, -1, idumm )
7507 SUBROUTINE pclaset( UPLO, M, N, ALPHA, BETA, A, IA, JA, DESCA )
7516 INTEGER IA, JA, M, N
7652 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
7653 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
7655 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
7656 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
7657 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
7658 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
7661 LOGICAL GODOWN, GOLEFT, ISCOLREP, ISROWREP, LOWER,
7663 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
7664 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP, JJA,
7665 $ JJMAX, JOFFA, JOFFD, LCMT, LCMT00, LDA, LMBLOC,
7666 $ LNBLOC, LOW, M1, MB, MBLKD, MBLKS, MBLOC, MP,
7667 $ MRCOL, MRROW, MYCOL, MYROW, N1, NB, NBLKD,
7668 $ NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB, QNB, TMP1,
7672 INTEGER DESCA2( DLEN_ )
7687 IF( m.EQ.0 .OR. n.EQ.0 )
7696 ictxt = desca2( ctxt_ )
7697 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
7699 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
7700 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
7701 $ iacol, mrrow, mrcol )
7703 IF( mp.LE.0 .OR. nq.LE.0 )
7706 isrowrep = ( desca2( rsrc_ ).LT.0 )
7707 iscolrep = ( desca2( csrc_ ).LT.0 )
7708 lda = desca2( lld_ )
7710 upper = .NOT.( lsame( uplo,
'L' ) )
7711 lower = .NOT.( lsame( uplo,
'U' ) )
7713 IF( ( ( lower.AND.upper ).AND.( alpha.EQ.beta ) ).OR.
7714 $ ( isrowrep .AND. iscolrep ) )
THEN
7715 IF( ( mp.GT.0 ).AND.( nq.GT.0 ) )
7716 $
CALL pb_claset( uplo, mp, nq, 0, alpha, beta,
7717 $ a( iia + ( jja - 1 ) * lda ), lda )
7726 CALL pb_binfo( 0, mp, nq, imb1, inb1, mb, nb, mrrow, mrcol,
7727 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
7728 $ lnbloc, ilow, low, iupp, upp )
7752 godown = ( lcmt00.GT.iupp )
7753 goleft = ( lcmt00.LT.ilow )
7755 IF( .NOT.godown .AND. .NOT.goleft )
THEN
7759 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
7760 godown = .NOT.goleft
7762 CALL pb_claset( uplo, imbloc, inbloc, lcmt00, alpha, beta,
7763 $ a( iia+joffa*lda ), lda )
7765 IF( upper .AND. nq.GT.inbloc )
7766 $
CALL pb_claset(
'All', imbloc, nq-inbloc, 0, alpha,
7767 $ alpha, a( iia+(joffa+inbloc)*lda ), lda )
7771 IF( lower .AND. mp.GT.imbloc )
7772 $
CALL pb_claset(
'All', mp-imbloc, inbloc, 0, alpha,
7773 $ alpha, a( iia+imbloc+joffa*lda ), lda )
7782 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7784 ioffa = ioffa + imbloc
7787 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7788 lcmt00 = lcmt00 - pmb
7794 tmp1 =
min( ioffa, iimax ) - iia + 1
7795 IF( upper .AND. tmp1.GT.0 )
THEN
7796 CALL pb_claset(
'All', tmp1, n1, 0, alpha, alpha,
7797 $ a( iia+joffa*lda ), lda )
7811 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
7814 CALL pb_claset( uplo, mbloc, inbloc, lcmt, alpha, beta,
7815 $ a( ioffd+1+joffa*lda ), lda )
7821 ioffd = ioffd + mbloc
7825 tmp1 = m1 - ioffd + iia - 1
7826 IF( lower .AND. tmp1.GT.0 )
7827 $
CALL pb_claset(
'ALL', tmp1, inbloc, 0, alpha, alpha,
7828 $ a( ioffd+1+joffa*lda ), lda )
7830 tmp1 = ioffa - iia + 1
7833 lcmt00 = lcmt00 + low - ilow + qnb
7835 joffa = joffa + inbloc
7837 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7838 $
CALL pb_claset(
'ALL', tmp1, n1, 0, alpha, alpha,
7839 $ a( iia+joffa*lda ), lda )
7844 ELSE IF( goleft )
THEN
7846 lcmt00 = lcmt00 + low - ilow + qnb
7848 joffa = joffa + inbloc
7851 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
7852 lcmt00 = lcmt00 + qnb
7858 tmp1 =
min( joffa, jjmax ) - jja + 1
7859 IF( lower .AND. tmp1.GT.0 )
THEN
7860 CALL pb_claset(
'All', m1, tmp1, 0, alpha, alpha,
7861 $ a( iia+(jja-1)*lda ), lda )
7875 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
7878 CALL pb_claset( uplo, imbloc, nbloc, lcmt, alpha, beta,
7879 $ a( iia+joffd*lda ), lda )
7885 joffd = joffd + nbloc
7889 tmp1 = n1 - joffd + jja - 1
7890 IF( upper .AND. tmp1.GT.0 )
7891 $
CALL pb_claset(
'All', imbloc, tmp1, 0, alpha, alpha,
7892 $ a( iia+joffd*lda ), lda )
7894 tmp1 = joffa - jja + 1
7897 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7899 ioffa = ioffa + imbloc
7901 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
7902 $
CALL pb_claset(
'All', m1, tmp1, 0, alpha, alpha,
7903 $ a( ioffa+1+(jja-1)*lda ), lda )
7912 IF( nblks.GT.0 )
THEN
7916 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7917 lcmt00 = lcmt00 - pmb
7923 tmp1 =
min( ioffa, iimax ) - iia + 1
7924 IF( upper .AND. tmp1.GT.0 )
THEN
7925 CALL pb_claset(
'All', tmp1, n1, 0, alpha, alpha,
7926 $ a( iia+joffa*lda ), lda )
7940 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
7943 CALL pb_claset( uplo, mbloc, nbloc, lcmt, alpha, beta,
7944 $ a( ioffd+1+joffa*lda ), lda )
7950 ioffd = ioffd + mbloc
7954 tmp1 = m1 - ioffd + iia - 1
7955 IF( lower .AND. tmp1.GT.0 )
7956 $
CALL pb_claset(
'All', tmp1, nbloc, 0, alpha, alpha,
7957 $ a( ioffd+1+joffa*lda ), lda )
7959 tmp1 =
min( ioffa, iimax ) - iia + 1
7962 lcmt00 = lcmt00 + qnb
7964 joffa = joffa + nbloc
7966 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7967 $
CALL pb_claset(
'All', tmp1, n1, 0, alpha, alpha,
7968 $ a( iia+joffa*lda ), lda )
7982 SUBROUTINE pclascal( TYPE, M, N, ALPHA, A, IA, JA, DESCA )
7991 INTEGER IA, JA, M, N
8117 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8118 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8120 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8121 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8122 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8123 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8127 LOGICAL GODOWN, GOLEFT, LOWER, UPPER
8128 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
8129 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, ITYPE,
8130 $ IUPP, JJA, JJMAX, JOFFA, JOFFD, LCMT, LCMT00,
8131 $ LDA, LMBLOC, LNBLOC, LOW, M1, MB, MBLKD, MBLKS,
8132 $ MBLOC, MP, MRCOL, MRROW, MYCOL, MYROW, N1, NB,
8133 $ NBLKD, NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB,
8137 INTEGER DESCA2( DLEN_ )
8146 EXTERNAL lsame, pb_numroc
8159 ictxt = desca2( ctxt_ )
8160 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8164 IF( m.EQ.0 .OR. n.EQ.0 )
8167 IF( lsame(
TYPE,
'L' ) ) then
8173 ELSE IF( lsame(
TYPE,
'U' ) ) then
8179 ELSE IF( lsame(
TYPE,
'H' ) ) then
8195 IF( itype.EQ.0 )
THEN
8199 CALL pb_infog2l( ia, ja, desca2, nprow, npcol, myrow, mycol,
8200 $ iia, jja, iarow, iacol )
8201 mp = pb_numroc( m, ia, desca2( imb_ ), desca2( mb_ ), myrow,
8202 $ desca2( rsrc_ ), nprow )
8203 nq = pb_numroc( n, ja, desca2( inb_ ), desca2( nb_ ), mycol,
8204 $ desca2( csrc_ ), npcol )
8206 IF( mp.LE.0 .OR. nq.LE.0 )
8209 lda = desca2( lld_ )
8210 ioffa = iia + ( jja - 1 ) * lda
8212 CALL pb_clascal(
'All', mp, nq, 0, alpha, a( ioffa ), lda )
8218 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
8219 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
8220 $ iacol, mrrow, mrcol )
8222 IF( mp.LE.0 .OR. nq.LE.0 )
8230 lda = desca2( lld_ )
8232 CALL pb_binfo( ioffd, mp, nq, imb1, inb1, mb, nb, mrrow,
8233 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
8234 $ lmbloc, lnbloc, ilow, low, iupp, upp )
8243 IF( desca2( rsrc_ ).LT.0 )
THEN
8248 IF( desca2( csrc_ ).LT.0 )
THEN
8257 godown = ( lcmt00.GT.iupp )
8258 goleft = ( lcmt00.LT.ilow )
8260 IF( .NOT.godown .AND. .NOT.goleft )
THEN
8264 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
8265 godown = .NOT.goleft
8267 CALL pb_clascal( uplo, imbloc, inbloc, lcmt00, alpha,
8268 $ a( iia+joffa*lda ), lda )
8270 IF( upper .AND. nq.GT.inbloc )
8271 $
CALL pb_clascal(
'All', imbloc, nq-inbloc, 0, alpha,
8272 $ a( iia+(joffa+inbloc)*lda ), lda )
8276 IF( lower .AND. mp.GT.imbloc )
8277 $
CALL pb_clascal(
'All', mp-imbloc, inbloc, 0, alpha,
8278 $ a( iia+imbloc+joffa*lda ), lda )
8287 lcmt00 = lcmt00 - ( iupp - upp + pmb )
8289 ioffa = ioffa + imbloc
8292 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
8293 lcmt00 = lcmt00 - pmb
8299 tmp1 =
min( ioffa, iimax ) - iia + 1
8300 IF( upper .AND. tmp1.GT.0 )
THEN
8302 $ a( iia+joffa*lda ), lda )
8316 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
8319 CALL pb_clascal( uplo, mbloc, inbloc, lcmt, alpha,
8320 $ a( ioffd+1+joffa*lda ), lda )
8326 ioffd = ioffd + mbloc
8330 tmp1 = m1 - ioffd + iia - 1
8331 IF( lower .AND. tmp1.GT.0 )
8332 $
CALL pb_clascal(
'All', tmp1, inbloc, 0, alpha,
8333 $ a( ioffd+1+joffa*lda ), lda )
8335 tmp1 = ioffa - iia + 1
8338 lcmt00 = lcmt00 + low - ilow + qnb
8340 joffa = joffa + inbloc
8342 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
8343 $
CALL pb_clascal(
'All', tmp1, n1, 0, alpha,
8344 $ a( iia+joffa*lda ), lda )
8349 ELSE IF( goleft )
THEN
8351 lcmt00 = lcmt00 + low - ilow + qnb
8353 joffa = joffa + inbloc
8356 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
8357 lcmt00 = lcmt00 + qnb
8363 tmp1 =
min( joffa, jjmax ) - jja + 1
8364 IF( lower .AND. tmp1.GT.0 )
THEN
8366 $ a( iia+(jja-1)*lda ), lda )
8380 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
8383 CALL pb_clascal( uplo, imbloc, nbloc, lcmt, alpha,
8384 $ a( iia+joffd*lda ), lda )
8390 joffd = joffd + nbloc
8394 tmp1 = n1 - joffd + jja - 1
8395 IF( upper .AND. tmp1.GT.0 )
8396 $
CALL pb_clascal(
'All', imbloc, tmp1, 0, alpha,
8397 $ a( iia+joffd*lda ), lda )
8399 tmp1 = joffa - jja + 1
8402 lcmt00 = lcmt00 - ( iupp - upp + pmb )
8404 ioffa = ioffa + imbloc
8406 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
8407 $
CALL pb_clascal(
'All', m1, tmp1, 0, alpha,
8408 $ a( ioffa+1+(jja-1)*lda ), lda )
8417 IF( nblks.GT.0 )
THEN
8421 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
8422 lcmt00 = lcmt00 - pmb
8428 tmp1 =
min( ioffa, iimax ) - iia + 1
8429 IF( upper .AND. tmp1.GT.0 )
THEN
8431 $ a( iia+joffa*lda ), lda )
8445 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
8448 CALL pb_clascal( uplo, mbloc, nbloc, lcmt, alpha,
8449 $ a( ioffd+1+joffa*lda ), lda )
8455 ioffd = ioffd + mbloc
8459 tmp1 = m1 - ioffd + iia - 1
8460 IF( lower .AND. tmp1.GT.0 )
8461 $
CALL pb_clascal(
'All', tmp1, nbloc, 0, alpha,
8462 $ a( ioffd+1+joffa*lda ), lda )
8464 tmp1 =
min( ioffa, iimax ) - iia + 1
8467 lcmt00 = lcmt00 + qnb
8469 joffa = joffa + nbloc
8471 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
8472 $
CALL pb_clascal(
'All', tmp1, n1, 0, alpha,
8473 $ a( iia+joffa*lda ), lda )
8489 SUBROUTINE pclagen( INPLACE, AFORM, DIAG, OFFA, M, N, IA, JA,
8490 $ DESCA, IASEED, A, LDA )
8499 CHARACTER*1 aform, diag
8500 INTEGER ia, iaseed, ja, lda, m, n, offa
8682 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8683 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8685 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8686 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8687 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8688 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8689 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
8690 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
8691 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
8692 PARAMETER ( JMP_1 = 1, jmp_row = 2, jmp_col = 3,
8693 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
8694 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
8695 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
8698 PARAMETER ( ZERO = 0.0e+0 )
8701 LOGICAL DIAGDO, SYMM, HERM, NOTRAN
8702 INTEGER CSRC, I, IACOL, IAROW, ICTXT, IIA, ILOCBLK,
8703 $ ILOCOFF, ILOW, IMB, IMB1, IMBLOC, IMBVIR, INB,
8704 $ INB1, INBLOC, INBVIR, INFO, IOFFDA, ITMP, IUPP,
8705 $ ivir, jja, jlocblk, jlocoff, jvir, lcmt00,
8706 $ lmbloc, lnbloc, low, maxmn, mb, mblks, mp,
8707 $ mrcol, mrrow, mycdist, mycol, myrdist, myrow,
8708 $ nb, nblks, npcol, nprow, nq, nvir, rsrc, upp
8712 INTEGER DESCA2( DLEN_ ), IMULADD( 4, JMP_LEN ),
8713 $ IRAN( 2 ), JMP( JMP_LEN ), MULADD0( 4 )
8716 EXTERNAL BLACS_GRIDINFO, PB_AINFOG2L, PB_BINFO,
8726 INTRINSIC CMPLX, MAX, MIN, REAL
8729 DATA ( muladd0( i ), i = 1, 4 ) / 20077, 16838,
8740 ictxt = desca2( ctxt_ )
8741 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8746 IF( nprow.EQ.-1 )
THEN
8747 info = -( 1000 + ctxt_ )
8749 symm = lsame( aform,
'S' )
8750 herm = lsame( aform,
'H' )
8751 notran = lsame( aform,
'N' )
8752 diagdo = lsame( diag,
'D' )
8753 IF( .NOT.( symm.OR.herm.OR.notran ) .AND.
8754 $ .NOT.( lsame( aform,
'T' ) ) .AND.
8755 $ .NOT.( lsame( aform,
'C' ) ) )
THEN
8757 ELSE IF( ( .NOT.diagdo ) .AND.
8758 $ ( .NOT.lsame( diag,
'N' ) ) )
THEN
8761 CALL pb_chkmat( ictxt, m, 5, n, 6, ia, ja, desca2, 10, info )
8764 IF( info.NE.0 )
THEN
8765 CALL pxerbla( ictxt,
'PCLAGEN', -info )
8771 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
8778 imb = desca2( imb_ )
8779 inb = desca2( inb_ )
8780 rsrc = desca2( rsrc_ )
8781 csrc = desca2( csrc_ )
8785 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
8786 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
8787 $ iacol, mrrow, mrcol )
8799 ioffda = ja + offa - ia
8800 CALL pb_binfo( ioffda, mp, nq, imb1, inb1, mb, nb, mrrow,
8801 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
8802 $ lmbloc, lnbloc, ilow, low, iupp, upp )
8810 itmp = max( 0, -offa )
8813 nvir = desca2( m_ ) + itmp
8815 CALL pb_locinfo( ivir, imbvir, mb, myrow, rsrc, nprow, ilocblk,
8816 $ ilocoff, myrdist )
8818 itmp = max( 0, offa )
8821 nvir = max( max( nvir, desca2( n_ ) + itmp ),
8822 $ desca2( m_ ) + desca2( n_ ) - 1 )
8824 CALL pb_locinfo( jvir, inbvir, nb, mycol, csrc, npcol, jlocblk,
8825 $ jlocoff, mycdist )
8827 IF( symm .OR. herm .OR. notran )
THEN
8829 CALL pb_initjmp( .true., nvir, imbvir, inbvir, imbloc, inbloc,
8830 $ mb, nb, rsrc, csrc, nprow, npcol, 2, jmp )
8838 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
8839 $ myrdist, mycdist, nprow, npcol, jmp,
8842 CALL pb_clagen(
'Lower', aform, a( iia, jja ), lda, lcmt00,
8843 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
8844 $ nb, lnbloc, jmp, imuladd )
8848 IF( symm .OR. herm .OR. ( .NOT. notran ) )
THEN
8850 CALL pb_initjmp( .false., nvir, imbvir, inbvir, imbloc, inbloc,
8851 $ mb, nb, rsrc, csrc, nprow, npcol, 2, jmp )
8859 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
8860 $ myrdist, mycdist, nprow, npcol, jmp,
8863 CALL pb_clagen(
'Upper', aform, a( iia, jja ), lda, lcmt00,
8864 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
8865 $ nb, lnbloc, jmp, imuladd )
8871 maxmn = max( desca2( m_ ), desca2( n_ ) )
8873 alpha = cmplx( real( 2 * maxmn ), zero )
8875 alpha = cmplx( real( maxmn ), real( maxmn ) )
8878 IF( ioffda.GE.0 )
THEN
8879 CALL pcladom( inplace, min( max( 0, m-ioffda ), n ), alpha,
8880 $ a, min( ia+ioffda, ia+m-1 ), ja, desca )
8882 CALL pcladom( inplace, min( m, max( 0, n+ioffda ) ), alpha,
8883 $ a, ia, min( ja-ioffda, ja+n-1 ), desca )
8893 SUBROUTINE pcladom( INPLACE, N, ALPHA, A, IA, JA, DESCA )
9021 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
9022 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
9024 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
9025 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
9026 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
9027 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
9030 LOGICAL GODOWN, GOLEFT
9031 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
9032 $ IMB1, IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP,
9033 $ JJA, JOFFA, JOFFD, LCMT, LCMT00, LDA, LDAP1,
9034 $ LMBLOC, LNBLOC, LOW, MB, MBLKD, MBLKS, MBLOC,
9035 $ MRCOL, MRROW, MYCOL, MYROW, NB, NBLKD, NBLKS,
9036 $ NBLOC, NP, NPCOL, NPROW, NQ, PMB, QNB, UPP
9040 INTEGER DESCA2( DLEN_ )
9057 ictxt = desca2( ctxt_ )
9058 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
9063 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
9064 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
9065 $ iacol, mrrow, mrcol )
9080 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
9081 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
9082 $ lnbloc, ilow, low, iupp, upp )
9086 lda = desca2( lld_ )
9089 IF( desca2( rsrc_ ).LT.0 )
THEN
9094 IF( desca2( csrc_ ).LT.0 )
THEN
9103 godown = ( lcmt00.GT.iupp )
9104 goleft = ( lcmt00.LT.ilow )
9106 IF( .NOT.godown .AND. .NOT.goleft )
THEN
9110 IF( lcmt00.GE.0 )
THEN
9111 ijoffa = ioffa+lcmt00 + ( joffa - 1 ) * lda
9112 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
9113 atmp = a( ijoffa + i*ldap1 )
9114 a( ijoffa + i*ldap1 ) = alpha +
9115 $
cmplx( abs( real( atmp ) ),
9116 $ abs( aimag( atmp ) ) )
9119 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
9120 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
9121 atmp = a( ijoffa + i*ldap1 )
9122 a( ijoffa + i*ldap1 ) = alpha +
9123 $
cmplx( abs( real( atmp ) ),
9124 $ abs( aimag( atmp ) ) )
9127 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
9128 godown = .NOT.goleft
9134 lcmt00 = lcmt00 - ( iupp - upp + pmb )
9136 ioffa = ioffa + imbloc
9139 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
9140 lcmt00 = lcmt00 - pmb
9152 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
9155 IF( lcmt.GE.0 )
THEN
9156 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
9157 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
9158 atmp = a( ijoffa + i*ldap1 )
9159 a( ijoffa + i*ldap1 ) = alpha +
9160 $
cmplx( abs( real( atmp ) ),
9161 $ abs( aimag( atmp ) ) )
9164 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
9165 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
9166 atmp = a( ijoffa + i*ldap1 )
9167 a( ijoffa + i*ldap1 ) = alpha +
9168 $
cmplx( abs( real( atmp ) ),
9169 $ abs( aimag( atmp ) ) )
9177 ioffd = ioffd + mbloc
9181 lcmt00 = lcmt00 + low - ilow + qnb
9183 joffa = joffa + inbloc
9185 ELSE IF( goleft )
THEN
9187 lcmt00 = lcmt00 + low - ilow + qnb
9189 joffa = joffa + inbloc
9192 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
9193 lcmt00 = lcmt00 + qnb
9205 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
9208 IF( lcmt.GE.0 )
THEN
9209 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
9210 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
9211 atmp = a( ijoffa + i*ldap1 )
9212 a( ijoffa + i*ldap1 ) = alpha +
9213 $
cmplx( abs( real( atmp ) ),
9214 $ abs( aimag( atmp ) ) )
9217 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
9218 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
9219 atmp = a( ijoffa + i*ldap1 )
9220 a( ijoffa + i*ldap1 ) = alpha +
9221 $
cmplx( abs( real( atmp ) ),
9222 $ abs( aimag( atmp ) ) )
9230 joffd = joffd + nbloc
9234 lcmt00 = lcmt00 - ( iupp - upp + pmb )
9236 ioffa = ioffa + imbloc
9242 IF( nblks.GT.0 )
THEN
9246 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
9247 lcmt00 = lcmt00 - pmb
9259 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
9262 IF( lcmt.GE.0 )
THEN
9263 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
9264 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
9265 atmp = a( ijoffa + i*ldap1 )
9266 a( ijoffa + i*ldap1 ) = alpha +
9267 $
cmplx( abs( real( atmp ) ),
9268 $ abs( aimag( atmp ) ) )
9271 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
9272 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
9273 atmp = a( ijoffa + i*ldap1 )
9274 a( ijoffa + i*ldap1 ) = alpha +
9275 $
cmplx( abs( real( atmp ) ),
9276 $ abs( aimag( atmp ) ) )
9284 ioffd = ioffd + mbloc
9288 lcmt00 = lcmt00 + qnb
9290 joffa = joffa + nbloc
9301 $ CMATNM, NOUT, WORK )
9309 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT
9312 CHARACTER*(*) CMATNM
9314 COMPLEX A( * ), WORK( * )
9440 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
9441 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
9443 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
9444 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
9445 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
9446 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
9449 INTEGER MYCOL, MYROW, NPCOL, NPROW, PCOL, PROW
9452 INTEGER DESCA2( DLEN_ )
9455 EXTERNAL BLACS_GRIDINFO, PB_DESCTRANS, PB_PCLAPRN2
9461 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
9466 CALL pb_desctrans( desca, desca2 )
9468 CALL blacs_gridinfo( desca2( ctxt_ ), nprow, npcol, myrow, mycol )
9470 IF( desca2( rsrc_ ).GE.0 )
THEN
9471 IF( desca2( csrc_ ).GE.0 )
THEN
9472 CALL pb_pclaprn2( m, n, a, ia, ja, desca2, irprnt, icprnt,
9473 $ cmatnm, nout, desca2( rsrc_ ),
9474 $ desca2( csrc_ ), work )
9476 DO 10 pcol = 0, npcol - 1
9477 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9478 $
WRITE( nout, * )
'Colum-replicated array -- ' ,
9479 $
'copy in process column: ', pcol
9480 CALL pb_pclaprn2( m, n, a, ia, ja, desca2, irprnt,
9481 $ icprnt, cmatnm, nout, desca2( rsrc_ ),
9486 IF( desca2( csrc_ ).GE.0 )
THEN
9487 DO 20 prow = 0, nprow - 1
9488 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9489 $
WRITE( nout, * )
'Row-replicated array -- ' ,
9490 $
'copy in process row: ', prow
9491 CALL pb_pclaprn2( m, n, a, ia, ja, desca2, irprnt,
9492 $ icprnt, cmatnm, nout, prow,
9493 $ desca2( csrc_ ), work )
9496 DO 40 prow = 0, nprow - 1
9497 DO 30 pcol = 0, npcol - 1
9498 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9499 $
WRITE( nout, * )
'Replicated array -- ' ,
9500 $
'copy in process (', prow,
',', pcol,
')'
9501 CALL pb_pclaprn2( m, n, a, ia, ja, desca2, irprnt,
9502 $ icprnt, cmatnm, nout, prow, pcol,
9515 $ CMATNM, NOUT, PROW, PCOL, WORK )
9523 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT, PCOL, PROW
9526 CHARACTER*(*) CMATNM
9528 COMPLEX A( * ), WORK( * )
9532 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
9533 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
9535 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
9536 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
9537 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
9538 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
9541 LOGICAL AISCOLREP, AISROWREP
9542 INTEGER H, I, IACOL, IAROW, IB, ICTXT, ICURCOL,
9543 $ ICURROW, II, IIA, IN, J, JB, JJ, JJA, JN, K,
9544 $ LDA, LDW, MYCOL, MYROW, NPCOL, NPROW
9547 EXTERNAL blacs_barrier, blacs_gridinfo, cgerv2d,
9551 INTRINSIC aimag,
min, real
9557 ictxt = desca( ctxt_ )
9558 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
9559 CALL pb_infog2l( ia, ja, desca, nprow, npcol, myrow, mycol,
9560 $ iia, jja, iarow, iacol )
9563 IF( desca( rsrc_ ).LT.0 )
THEN
9571 IF( desca( csrc_ ).LT.0 )
THEN
9580 ldw =
max( desca( imb_ ), desca( mb_ ) )
9584 jb = desca( inb_ ) - ja + 1
9586 $ jb = ( (-jb) / desca( nb_ ) + 1 ) * desca( nb_ ) + jb
9590 ib = desca( imb_ ) - ia + 1
9592 $ ib = ( (-ib) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
9595 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9596 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9598 WRITE( nout, fmt = 9999 )
9599 $ cmatnm, ia+k, ja+h,
9600 $ real( a(ii+k+(jj+h-1)*lda) ),
9601 $ aimag( a(ii+k+(jj+h-1)*lda) )
9605 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9606 CALL cgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ), lda,
9608 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9609 CALL cgerv2d( ictxt, ib, 1, work, ldw, icurrow, icurcol )
9611 WRITE( nout, fmt = 9999 )
9612 $ cmatnm, ia+k-1, ja+h, real( work( k ) ),
9613 $ aimag( work( k ) )
9617 IF( myrow.EQ.icurrow )
9619 IF( .NOT.aisrowrep )
9620 $ icurrow = mod( icurrow+1, nprow )
9621 CALL blacs_barrier( ictxt,
'All' )
9625 DO 50 i = in+1, ia+m-1, desca( mb_ )
9626 ib =
min( desca( mb_ ), ia+m-i )
9627 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9628 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9630 WRITE( nout, fmt = 9999 )
9631 $ cmatnm, i+k, ja+h,
9632 $ real( a( ii+k+(jj+h-1)*lda ) ),
9633 $ aimag( a( ii+k+(jj+h-1)*lda ) )
9637 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9638 CALL cgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9639 $ lda, irprnt, icprnt )
9640 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9641 CALL cgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9644 WRITE( nout, fmt = 9999 )
9645 $ cmatnm, i+k-1, ja+h, real( work( k ) ),
9646 $ aimag( work( k ) )
9650 IF( myrow.EQ.icurrow )
9652 IF( .NOT.aisrowrep )
9653 $ icurrow = mod( icurrow+1, nprow )
9654 CALL blacs_barrier( ictxt,
'All' )
9661 IF( mycol.EQ.icurcol )
9663 IF( .NOT.aiscolrep )
9664 $ icurcol = mod( icurcol+1, npcol )
9665 CALL blacs_barrier( ictxt,
'All' )
9669 DO 130 j = jn+1, ja+n-1, desca( nb_ )
9670 jb =
min( desca( nb_ ), ja+n-j )
9672 ib = desca( imb_ )-ia+1
9674 $ ib = ( (-ib) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
9677 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9678 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9680 WRITE( nout, fmt = 9999 )
9681 $ cmatnm, ia+k, j+h,
9682 $ real( a( ii+k+(jj+h-1)*lda ) ),
9683 $ aimag( a( ii+k+(jj+h-1)*lda ) )
9687 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9688 CALL cgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9689 $ lda, irprnt, icprnt )
9690 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9691 CALL cgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9694 WRITE( nout, fmt = 9999 )
9695 $ cmatnm, ia+k-1, j+h, real( work( k ) ),
9696 $ aimag( work( k ) )
9700 IF( myrow.EQ.icurrow )
9702 icurrow = mod( icurrow+1, nprow )
9703 CALL blacs_barrier( ictxt,
'All' )
9707 DO 110 i = in+1, ia+m-1, desca( mb_ )
9708 ib =
min( desca( mb_ ), ia+m-i )
9709 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9710 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9712 WRITE( nout, fmt = 9999 )
9714 $ real( a( ii+k+(jj+h-1)*lda ) ),
9715 $ aimag( a( ii+k+(jj+h-1)*lda ) )
9719 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9720 CALL cgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9721 $ lda, irprnt, icprnt )
9722 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9723 CALL cgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9726 WRITE( nout, fmt = 9999 )
9727 $ cmatnm, i+k-1, j+h, real( work( k ) ),
9728 $ aimag( work( k ) )
9732 IF( myrow.EQ.icurrow )
9734 IF( .NOT.aisrowrep )
9735 $ icurrow = mod( icurrow+1, nprow )
9736 CALL blacs_barrier( ictxt,
'All' )
9743 IF( mycol.EQ.icurcol )
9745 IF( .NOT.aiscolrep )
9746 $ icurcol = mod( icurcol+1, npcol )
9747 CALL blacs_barrier( ictxt,
'All' )
9751 9999
FORMAT( 1x, a,
'(', i6,
',', i6,
')=', e16.8,
'+i*(',
9767 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9833 IF( IPRE.GT.0 ) THEN
9838 WRITE( *, fmt =
'(A)' )
9839 $
'WARNING no pre-guardzone in PB_CFILLPAD'
9844 IF( ipost.GT.0 )
THEN
9846 DO 20 i = j, j+ipost-1
9850 WRITE( *, fmt =
'(A)' )
9851 $
'WARNING no post-guardzone in PB_CFILLPAD'
9859 DO 30 i = k, k + ( lda - m ) - 1
9880 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9961 INTEGER I, IAM, IDUMM, INFO, J, K, MYCOL, MYROW, NPCOL,
9965 EXTERNAL BLACS_GRIDINFO, IGAMX2D, PB_TOPGET
9968 INTRINSIC AIMAG, REAL
9974 CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
9975 IAM = myrow*npcol + mycol
9980 IF( ipre.GT.0 )
THEN
9982 IF( a( i ).NE.chkval )
THEN
9983 WRITE( *, fmt = 9998 ) myrow, mycol, mess,
' pre', i,
9984 $ real( a( i ) ), aimag( a( i ) )
9989 WRITE( *, fmt = * )
'WARNING no pre-guardzone in PB_CCHEKPAD'
9994 IF( ipost.GT.0 )
THEN
9996 DO 20 i = j, j+ipost-1
9997 IF( a( i ).NE.chkval )
THEN
9998 WRITE( *, fmt = 9998 ) myrow, mycol, mess,
'post',
9999 $ i-j+1, real( a( i ) ),
10005 WRITE( *, fmt = * )
10006 $
'WARNING no post-guardzone buffer in PB_CCHEKPAD'
10011 IF( lda.GT.m )
THEN
10014 DO 30 i = k, k + (lda-m) - 1
10015 IF( a( i ).NE.chkval )
THEN
10016 WRITE( *, fmt = 9997 ) myrow, mycol, mess,
10017 $ i-ipre-lda*(j-1), j, real( a( i ) ),
10026 CALL pb_topget( ictxt,
'Combine',
'All', top )
10027 CALL igamx2d( ictxt,
'All', top, 1, 1, info, 1, idumm, idumm, -1,
10029 IF( iam.EQ.0 .AND. info.GE.0 )
THEN
10030 WRITE( *, fmt = 9999 ) info / npcol, mod( info, npcol ), mess
10033 9999
FORMAT(
'{', i5,
',', i5,
'}: Memory overwrite in ', a )
10034 9998
FORMAT(
'{', i5,
',', i5,
'}: ', a,
' memory overwrite in ',
10035 $ a4,
'-guardzone: loc(', i3,
') = ', g11.4,
'+ i*',
10037 9997
FORMAT(
'{', i5,
',', i5,
'}: ', a,
' memory overwrite in ',
10038 $
'lda-m gap: loc(', i3,
',', i3,
') = ', g11.4,
10055 INTEGER IOFFD, LDA, M, N
10056 COMPLEX ALPHA, BETA
10059 COMPLEX A( LDA, * )
10156 INTEGER I, J, JTMP, MN
10169 IF( M.LE.0 .OR. N.LE.0 )
10174 IF( LSAME( UPLO,
'L' ) ) THEN
10179 mn = max( 0, -ioffd )
10180 DO 20 j = 1, min( mn, n )
10185 DO 40 j = mn + 1, min( m - ioffd, n )
10187 a( jtmp, j ) = beta
10188 DO 30 i = jtmp + 1, m
10193 ELSE IF( lsame( uplo,
'U' ) )
THEN
10198 mn = min( m - ioffd, n )
10199 DO 60 j = max( 0, -ioffd ) + 1, mn
10201 DO 50 i = 1, jtmp - 1
10204 a( jtmp, j ) = beta
10206 DO 80 j = max( 0, mn ) + 1, n
10212 ELSE IF( lsame( uplo,
'D' ) )
THEN
10216 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10217 a( j + ioffd, j ) = beta
10230 IF( alpha.NE.beta .AND. ioffd.LT.m .AND. ioffd.GT.-n )
THEN
10231 DO 120 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10232 a( j + ioffd, j ) = beta
10252 INTEGER IOFFD, LDA, M, N
10256 COMPLEX A( LDA, * )
10346 INTEGER I, J, JTMP, MN
10359 IF( M.LE.0 .OR. N.LE.0 )
10364 IF( LSAME( UPLO,
'L' ) ) THEN
10368 MN = max( 0, -ioffd )
10369 DO 20 j = 1, min( mn, n )
10371 a( i, j ) = alpha * a( i, j )
10374 DO 40 j = mn + 1, min( m - ioffd, n )
10375 DO 30 i = j + ioffd, m
10376 a( i, j ) = alpha * a( i, j )
10380 ELSE IF( lsame( uplo,
'U' ) )
THEN
10384 mn = min( m - ioffd, n )
10385 DO 60 j = max( 0, -ioffd ) + 1, mn
10386 DO 50 i = 1, j + ioffd
10387 a( i, j ) = alpha * a( i, j )
10390 DO 80 j = max( 0, mn ) + 1, n
10392 a( i, j ) = alpha * a( i, j )
10396 ELSE IF( lsame( uplo,
'D' ) )
THEN
10400 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10402 a( jtmp, j ) = alpha * a( jtmp, j )
10411 a( i, j ) = alpha * a( i, j )
10423 $ IMBLOC, MB, LMBLOC, NBLKS, INBLOC, NB,
10424 $ LNBLOC, JMP, IMULADD )
10432 CHARACTER*1 UPLO, AFORM
10433 INTEGER IMBLOC, INBLOC, LCMT00, LDA, LMBLOC, LNBLOC,
10434 $ mb, mblks, nb, nblks
10437 INTEGER IMULADD( 4, * ), IRAN( * ), JMP( * )
10438 COMPLEX A( LDA, * )
10541 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
10542 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
10543 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
10544 PARAMETER ( JMP_1 = 1, jmp_row = 2, jmp_col = 3,
10545 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
10546 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
10547 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
10550 PARAMETER ( ZERO = 0.0e+0 )
10553 INTEGER I, IB, IBLK, II, IK, ITMP, JB, JBLK, JJ, JK,
10554 $ JTMP, LCMTC, LCMTR, LOW, MNB, UPP
10558 INTEGER IB0( 2 ), IB1( 2 ), IB2( 2 ), IB3( 2 )
10566 EXTERNAL lsame, pb_srand
10574 ib1( i ) = iran( i )
10575 ib2( i ) = iran( i )
10576 ib3( i ) = iran( i )
10579 IF( lsame( aform,
'N' ) )
THEN
10585 DO 50 jblk = 1, nblks
10587 IF( jblk.EQ.1 )
THEN
10589 ELSE IF( jblk.EQ.nblks )
THEN
10595 DO 40 jk = jj, jj + jb - 1
10599 DO 30 iblk = 1, mblks
10601 IF( iblk.EQ.1 )
THEN
10603 ELSE IF( iblk.EQ.mblks )
THEN
10611 DO 20 ik = ii, ii + ib - 1
10612 a( ik, jk ) =
cmplx( pb_srand( 0 ), pb_srand( 0 ) )
10617 IF( iblk.EQ.1 )
THEN
10621 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
10628 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1, ib0 )
10632 ib1( 1 ) = ib0( 1 )
10633 ib1( 2 ) = ib0( 2 )
10639 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
10641 ib1( 1 ) = ib0( 1 )
10642 ib1( 2 ) = ib0( 2 )
10643 ib2( 1 ) = ib0( 1 )
10644 ib2( 2 ) = ib0( 2 )
10650 IF( jblk.EQ.1 )
THEN
10654 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
10660 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
10664 ib1( 1 ) = ib0( 1 )
10665 ib1( 2 ) = ib0( 2 )
10666 ib2( 1 ) = ib0( 1 )
10667 ib2( 2 ) = ib0( 2 )
10668 ib3( 1 ) = ib0( 1 )
10669 ib3( 2 ) = ib0( 2 )
10673 ELSE IF( lsame( aform,
'T' ) )
THEN
10680 DO 90 iblk = 1, mblks
10682 IF( iblk.EQ.1 )
THEN
10684 ELSE IF( iblk.EQ.mblks )
THEN
10690 DO 80 ik = ii, ii + ib - 1
10694 DO 70 jblk = 1, nblks
10696 IF( jblk.EQ.1 )
THEN
10698 ELSE IF( jblk.EQ.nblks )
THEN
10706 DO 60 jk = jj, jj + jb - 1
10707 a( ik, jk ) =
cmplx( pb_srand( 0 ), pb_srand( 0 ) )
10712 IF( jblk.EQ.1 )
THEN
10716 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
10723 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1, ib0 )
10727 ib1( 1 ) = ib0( 1 )
10728 ib1( 2 ) = ib0( 2 )
10734 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
10736 ib1( 1 ) = ib0( 1 )
10737 ib1( 2 ) = ib0( 2 )
10738 ib2( 1 ) = ib0( 1 )
10739 ib2( 2 ) = ib0( 2 )
10745 IF( iblk.EQ.1 )
THEN
10749 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
10755 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
10759 ib1( 1 ) = ib0( 1 )
10760 ib1( 2 ) = ib0( 2 )
10761 ib2( 1 ) = ib0( 1 )
10762 ib2( 2 ) = ib0( 2 )
10763 ib3( 1 ) = ib0( 1 )
10764 ib3( 2 ) = ib0( 2 )
10768 ELSE IF( lsame( aform,
'S' ) )
THEN
10772 IF( lsame( uplo,
'L' ) )
THEN
10779 DO 170 jblk = 1, nblks
10781 IF( jblk.EQ.1 )
THEN
10784 ELSE IF( jblk.EQ.nblks )
THEN
10792 DO 160 jk = jj, jj + jb - 1
10797 DO 150 iblk = 1, mblks
10799 IF( iblk.EQ.1 )
THEN
10802 ELSE IF( iblk.EQ.mblks )
THEN
10812 IF( lcmtr.GT.upp )
THEN
10814 DO 100 ik = ii, ii + ib - 1
10815 dummy =
cmplx( pb_srand( 0 ),
10819 ELSE IF( lcmtr.GE.low )
THEN
10822 mnb =
max( 0, -lcmtr )
10824 IF( jtmp.LE.
min( mnb, jb ) )
THEN
10826 DO 110 ik = ii, ii + ib - 1
10827 a( ik, jk ) =
cmplx( pb_srand( 0 ),
10831 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
10832 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
10834 itmp = ii + jtmp + lcmtr - 1
10836 DO 120 ik = ii, itmp - 1
10837 dummy =
cmplx( pb_srand( 0 ),
10841 DO 130 ik = itmp, ii + ib - 1
10842 a( ik, jk ) =
cmplx( pb_srand( 0 ),
10850 DO 140 ik = ii, ii + ib - 1
10851 a( ik, jk ) =
cmplx( pb_srand( 0 ),
10859 IF( iblk.EQ.1 )
THEN
10863 lcmtr = lcmtr - jmp( jmp_npimbloc )
10864 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
10871 lcmtr = lcmtr - jmp( jmp_npmb )
10872 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
10877 ib1( 1 ) = ib0( 1 )
10878 ib1( 2 ) = ib0( 2 )
10884 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
10886 ib1( 1 ) = ib0( 1 )
10887 ib1( 2 ) = ib0( 2 )
10888 ib2( 1 ) = ib0( 1 )
10889 ib2( 2 ) = ib0( 2 )
10895 IF( jblk.EQ.1 )
THEN
10899 lcmtc = lcmtc + jmp( jmp_nqinbloc )
10900 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
10906 lcmtc = lcmtc + jmp( jmp_nqnb )
10907 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
10911 ib1( 1 ) = ib0( 1 )
10912 ib1( 2 ) = ib0( 2 )
10913 ib2( 1 ) = ib0( 1 )
10914 ib2( 2 ) = ib0( 2 )
10915 ib3( 1 ) = ib0( 1 )
10916 ib3( 2 ) = ib0( 2 )
10927 DO 250 iblk = 1, mblks
10929 IF( iblk.EQ.1 )
THEN
10932 ELSE IF( iblk.EQ.mblks )
THEN
10940 DO 240 ik = ii, ii + ib - 1
10945 DO 230 jblk = 1, nblks
10947 IF( jblk.EQ.1 )
THEN
10950 ELSE IF( jblk.EQ.nblks )
THEN
10960 IF( lcmtc.LT.low )
THEN
10962 DO 180 jk = jj, jj + jb - 1
10963 dummy =
cmplx( pb_srand( 0 ), pb_srand( 0 ) )
10966 ELSE IF( lcmtc.LE.upp )
THEN
10969 mnb =
max( 0, lcmtc )
10971 IF( itmp.LE.
min( mnb, ib ) )
THEN
10973 DO 190 jk = jj, jj + jb - 1
10974 a( ik, jk ) =
cmplx( pb_srand( 0 ),
10978 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
10979 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
10981 jtmp = jj + itmp - lcmtc - 1
10983 DO 200 jk = jj, jtmp - 1
10984 dummy =
cmplx( pb_srand( 0 ),
10988 DO 210 jk = jtmp, jj + jb - 1
10989 a( ik, jk ) =
cmplx( pb_srand( 0 ),
10997 DO 220 jk = jj, jj + jb - 1
10998 a( ik, jk ) =
cmplx( pb_srand( 0 ),
11006 IF( jblk.EQ.1 )
THEN
11010 lcmtc = lcmtc + jmp( jmp_nqinbloc )
11011 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
11018 lcmtc = lcmtc + jmp( jmp_nqnb )
11019 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
11024 ib1( 1 ) = ib0( 1 )
11025 ib1( 2 ) = ib0( 2 )
11031 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
11033 ib1( 1 ) = ib0( 1 )
11034 ib1( 2 ) = ib0( 2 )
11035 ib2( 1 ) = ib0( 1 )
11036 ib2( 2 ) = ib0( 2 )
11042 IF( iblk.EQ.1 )
THEN
11046 lcmtr = lcmtr - jmp( jmp_npimbloc )
11047 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
11053 lcmtr = lcmtr - jmp( jmp_npmb )
11054 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
11058 ib1( 1 ) = ib0( 1 )
11059 ib1( 2 ) = ib0( 2 )
11060 ib2( 1 ) = ib0( 1 )
11061 ib2( 2 ) = ib0( 2 )
11062 ib3( 1 ) = ib0( 1 )
11063 ib3( 2 ) = ib0( 2 )
11069 ELSE IF( lsame( aform,
'C' ) )
THEN
11076 DO 290 iblk = 1, mblks
11078 IF( iblk.EQ.1 )
THEN
11080 ELSE IF( iblk.EQ.mblks )
THEN
11086 DO 280 ik = ii, ii + ib - 1
11090 DO 270 jblk = 1, nblks
11092 IF( jblk.EQ.1 )
THEN
11094 ELSE IF( jblk.EQ.nblks )
THEN
11102 DO 260 jk = jj, jj + jb - 1
11103 a( ik, jk ) =
cmplx( pb_srand( 0 ),
11109 IF( jblk.EQ.1 )
THEN
11113 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
11120 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
11125 ib1( 1 ) = ib0( 1 )
11126 ib1( 2 ) = ib0( 2 )
11132 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
11134 ib1( 1 ) = ib0( 1 )
11135 ib1( 2 ) = ib0( 2 )
11136 ib2( 1 ) = ib0( 1 )
11137 ib2( 2 ) = ib0( 2 )
11143 IF( iblk.EQ.1 )
THEN
11147 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
11153 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
11157 ib1( 1 ) = ib0( 1 )
11158 ib1( 2 ) = ib0( 2 )
11159 ib2( 1 ) = ib0( 1 )
11160 ib2( 2 ) = ib0( 2 )
11161 ib3( 1 ) = ib0( 1 )
11162 ib3( 2 ) = ib0( 2 )
11166 ELSE IF( lsame( aform,
'H' ) )
THEN
11170 IF( lsame( uplo,
'L' ) )
THEN
11177 DO 370 jblk = 1, nblks
11179 IF( jblk.EQ.1 )
THEN
11182 ELSE IF( jblk.EQ.nblks )
THEN
11190 DO 360 jk = jj, jj + jb - 1
11195 DO 350 iblk = 1, mblks
11197 IF( iblk.EQ.1 )
THEN
11200 ELSE IF( iblk.EQ.mblks )
THEN
11210 IF( lcmtr.GT.upp )
THEN
11212 DO 300 ik = ii, ii + ib - 1
11213 dummy =
cmplx( pb_srand( 0 ),
11217 ELSE IF( lcmtr.GE.low )
THEN
11220 mnb =
max( 0, -lcmtr )
11222 IF( jtmp.LE.
min( mnb, jb ) )
THEN
11224 DO 310 ik = ii, ii + ib - 1
11225 a( ik, jk ) =
cmplx( pb_srand( 0 ),
11229 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
11230 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
11232 itmp = ii + jtmp + lcmtr - 1
11234 DO 320 ik = ii, itmp - 1
11235 dummy =
cmplx( pb_srand( 0 ),
11239 IF( itmp.LE.( ii + ib - 1 ) )
THEN
11240 dummy =
cmplx( pb_srand( 0 ),
11242 a( itmp, jk ) =
cmplx( real( dummy ),
11246 DO 330 ik = itmp + 1, ii + ib - 1
11247 a( ik, jk ) =
cmplx( pb_srand( 0 ),
11255 DO 340 ik = ii, ii + ib - 1
11256 a( ik, jk ) =
cmplx( pb_srand( 0 ),
11264 IF( iblk.EQ.1 )
THEN
11268 lcmtr = lcmtr - jmp( jmp_npimbloc )
11269 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
11276 lcmtr = lcmtr - jmp( jmp_npmb )
11277 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
11282 ib1( 1 ) = ib0( 1 )
11283 ib1( 2 ) = ib0( 2 )
11289 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
11291 ib1( 1 ) = ib0( 1 )
11292 ib1( 2 ) = ib0( 2 )
11293 ib2( 1 ) = ib0( 1 )
11294 ib2( 2 ) = ib0( 2 )
11300 IF( jblk.EQ.1 )
THEN
11304 lcmtc = lcmtc + jmp( jmp_nqinbloc )
11305 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
11311 lcmtc = lcmtc + jmp( jmp_nqnb )
11312 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
11316 ib1( 1 ) = ib0( 1 )
11317 ib1( 2 ) = ib0( 2 )
11318 ib2( 1 ) = ib0( 1 )
11319 ib2( 2 ) = ib0( 2 )
11320 ib3( 1 ) = ib0( 1 )
11321 ib3( 2 ) = ib0( 2 )
11332 DO 450 iblk = 1, mblks
11334 IF( iblk.EQ.1 )
THEN
11337 ELSE IF( iblk.EQ.mblks )
THEN
11345 DO 440 ik = ii, ii + ib - 1
11350 DO 430 jblk = 1, nblks
11352 IF( jblk.EQ.1 )
THEN
11355 ELSE IF( jblk.EQ.nblks )
THEN
11365 IF( lcmtc.LT.low )
THEN
11367 DO 380 jk = jj, jj + jb - 1
11368 dummy =
cmplx( pb_srand( 0 ),
11372 ELSE IF( lcmtc.LE.upp )
THEN
11375 mnb =
max( 0, lcmtc )
11377 IF( itmp.LE.
min( mnb, ib ) )
THEN
11379 DO 390 jk = jj, jj + jb - 1
11380 a( ik, jk ) =
cmplx( pb_srand( 0 ),
11384 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
11385 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
11387 jtmp = jj + itmp - lcmtc - 1
11389 DO 400 jk = jj, jtmp - 1
11390 dummy =
cmplx( pb_srand( 0 ),
11394 IF( jtmp.LE.( jj + jb - 1 ) )
THEN
11395 dummy =
cmplx( pb_srand( 0 ),
11397 a( ik, jtmp ) =
cmplx( real( dummy ),
11401 DO 410 jk = jtmp + 1, jj + jb - 1
11402 a( ik, jk ) =
cmplx( pb_srand( 0 ),
11410 DO 420 jk = jj, jj + jb - 1
11411 a( ik, jk ) =
cmplx( pb_srand( 0 ),
11419 IF( jblk.EQ.1 )
THEN
11423 lcmtc = lcmtc + jmp( jmp_nqinbloc )
11424 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
11431 lcmtc = lcmtc + jmp( jmp_nqnb )
11432 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
11437 ib1( 1 ) = ib0( 1 )
11438 ib1( 2 ) = ib0( 2 )
11444 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
11446 ib1( 1 ) = ib0( 1 )
11447 ib1( 2 ) = ib0( 2 )
11448 ib2( 1 ) = ib0( 1 )
11449 ib2( 2 ) = ib0( 2 )
11455 IF( iblk.EQ.1 )
THEN
11459 lcmtr = lcmtr - jmp( jmp_npimbloc )
11460 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
11466 lcmtr = lcmtr - jmp( jmp_npmb )
11467 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
11471 ib1( 1 ) = ib0( 1 )
11472 ib1( 2 ) = ib0( 2 )
11473 ib2( 1 ) = ib0( 1 )
11474 ib2( 2 ) = ib0( 2 )
11475 ib3( 1 ) = ib0( 1 )
11476 ib3( 2 ) = ib0( 2 )
11536 PARAMETER ( one = 1.0e+0, two = 2.0e+0 )
11597 PARAMETER ( divfac = 2.147483648e+9,
11598 $ pow16 = 6.5536e+4 )
11610 INTEGER iacs( 4 ), irand( 2 )
11611 common /rancom/ irand, iacs
11618 pb_sran = ( real( irand( 1 ) ) + pow16 * real( irand( 2 ) ) ) /
11621 CALL pb_lmul( irand, iacs, j )
11622 CALL pb_ladd( j, iacs( 3 ), irand )
subroutine pb_ainfog2l(m, n, i, j, desc, nprow, npcol, myrow, mycol, imb1, inb1, mp, nq, ii, jj, prow, pcol, rprow, rpcol)
subroutine pb_descset2(desc, m, n, imb, inb, mb, nb, rsrc, csrc, ctxt, lld)
subroutine pb_ladd(j, k, i)
subroutine pb_binfo(offd, m, n, imb1, inb1, mb, nb, mrrow, mrcol, lcmt00, mblks, nblks, imbloc, inbloc, lmbloc, lnbloc, ilow, low, iupp, upp)
subroutine pb_setran(iran, iac)
subroutine pb_infog2l(i, j, desc, nprow, npcol, myrow, mycol, ii, jj, prow, pcol)
subroutine pb_locinfo(i, inb, nb, myroc, srcproc, nprocs, ilocblk, ilocoff, mydist)
subroutine pchkpbe(ictxt, nout, sname, infot)
subroutine pb_chkmat(ictxt, m, mpos0, n, npos0, ia, ja, desca, dpos0, info)
subroutine pb_lmul(k, j, i)
subroutine pb_jump(k, muladd, irann, iranm, ima)
subroutine pb_setlocran(seed, ilocblk, jlocblk, ilocoff, jlocoff, myrdist, mycdist, nprow, npcol, jmp, imuladd, iran)
subroutine pb_initmuladd(muladd0, jmp, imuladd)
subroutine pb_desctrans(descin, descout)
subroutine pb_initjmp(colmaj, nvir, imbvir, inbvir, imbloc, inbloc, mb, nb, rsrc, csrc, nprow, npcol, stride, jmp)
subroutine pb_jumpit(muladd, irann, iranm)
subroutine pb_pclaprn2(m, n, a, ia, ja, desca, irprnt, icprnt, cmatnm, nout, prow, pcol, work)
subroutine pcmmch1(ictxt, uplo, trans, n, k, alpha, a, ia, ja, desca, beta, c, pc, ic, jc, descc, ct, g, err, info)
subroutine pcmmch(ictxt, transa, transb, m, n, k, alpha, a, ia, ja, desca, b, ib, jb, descb, beta, c, pc, ic, jc, descc, ct, g, err, info)
subroutine pclagen(inplace, aform, diag, offa, m, n, ia, ja, desca, iaseed, a, lda)
subroutine pcchkvout(n, x, px, ix, jx, descx, incx, info)
subroutine pcchkvin(errmax, n, x, px, ix, jx, descx, incx, info)
subroutine pclascal(type, m, n, alpha, a, ia, ja, desca)
subroutine pcipset(toggle, n, a, ia, ja, desca)
subroutine pcladom(inplace, n, alpha, a, ia, ja, desca)
subroutine pb_cchekpad(ictxt, mess, m, n, a, lda, ipre, ipost, chkval)
subroutine pcvecee(ictxt, nout, subptr, scode, sname)
subroutine pcerrset(err, errmax, xtrue, x)
subroutine pcmatee(ictxt, nout, subptr, scode, sname)
subroutine pb_pclaprnt(m, n, a, ia, ja, desca, irprnt, icprnt, cmatnm, nout, work)
subroutine pcchkmat(ictxt, nout, subptr, scode, sname, argnam, argpos)
subroutine pcchkmout(m, n, a, pa, ia, ja, desca, info)
subroutine pcchkmin(errmax, m, n, a, pa, ia, ja, desca, info)
subroutine pcmprnt(ictxt, nout, m, n, a, lda, irprnt, icprnt, cmatnm)
subroutine pcoptee(ictxt, nout, subptr, scode, sname)
subroutine pcvmch(ictxt, trans, uplo, m, n, alpha, x, ix, jx, descx, incx, y, iy, jy, descy, incy, a, pa, ia, ja, desca, g, err, info)
subroutine pcchkopt(ictxt, nout, subptr, scode, sname, argnam, argpos)
subroutine pb_clagen(uplo, aform, a, lda, lcmt00, iran, mblks, imbloc, mb, lmbloc, nblks, inbloc, nb, lnbloc, jmp, imuladd)
real function pb_sran(idumm)
subroutine pcdimee(ictxt, nout, subptr, scode, sname)
subroutine pb_clascal(uplo, m, n, ioffd, alpha, a, lda)
subroutine pcmmch2(ictxt, uplo, trans, n, k, alpha, a, ia, ja, desca, b, ib, jb, descb, beta, c, pc, ic, jc, descc, ct, g, err, info)
subroutine pb_cfillpad(ictxt, m, n, a, lda, ipre, ipost, chkval)
subroutine pcmmch3(uplo, trans, m, n, alpha, a, ia, ja, desca, beta, c, pc, ic, jc, descc, err, info)
subroutine pcvmch2(ictxt, uplo, m, n, alpha, x, ix, jx, descx, incx, y, iy, jy, descy, incy, a, pa, ia, ja, desca, g, err, info)
subroutine pcerraxpby(errbnd, alpha, x, beta, y, prec)
subroutine pccallsub(subptr, scode)
subroutine pcchkdim(ictxt, nout, subptr, scode, sname, argnam, argpos)
subroutine pcmvch(ictxt, trans, m, n, alpha, a, ia, ja, desca, x, ix, jx, descx, incx, beta, y, py, iy, jy, descy, incy, g, err, info)
subroutine pb_claset(uplo, m, n, ioffd, alpha, beta, a, lda)
subroutine pcvprnt(ictxt, nout, n, x, incx, irprnt, icprnt, cvecnm)
real function pb_srand(idumm)
subroutine pclaset(uplo, m, n, alpha, beta, a, ia, ja, desca)
real function pslamch(ictxt, cmach)
subroutine pcsetpblas(ictxt)
subroutine pxerbla(ictxt, srname, info)