1 SUBROUTINE psoptee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
9 INTEGER ICTXT, NOUT, SCODE
156 IF( scode.EQ.21 )
THEN
161 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
163 ELSE IF( scode.EQ.22 .OR. scode.EQ.25 .OR. scode.EQ.26 .OR.
169 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
171 ELSE IF( scode.EQ.23 )
THEN
176 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
181 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
186 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'D', apos )
190 ELSE IF( scode.EQ.31 )
THEN
195 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
200 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'B', apos )
202 ELSE IF( scode.EQ.32 )
THEN
207 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'S', apos )
212 CALL pschkopt( 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 pschkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
225 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
227 ELSE IF( scode.EQ.38 )
THEN
232 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'S', apos )
237 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'U', apos )
242 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
247 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'D', apos )
250 ELSE IF( scode.EQ.39 )
THEN
255 CALL pschkopt( ictxt, nout, subptr, scode, sname,
'A', apos )
264 SUBROUTINE pschkopt( 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 psdimee( 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 pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
619 ELSE IF( scode.EQ.21 )
THEN
624 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
629 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
631 ELSE IF( scode.EQ.22 .OR. scode.EQ.25 .OR. scode.EQ.26 .OR.
637 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
639 ELSE IF( scode.EQ.23 )
THEN
644 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
646 ELSE IF( scode.EQ.24 )
THEN
651 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
656 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
660 ELSE IF( scode.EQ.31 )
THEN
665 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
670 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
675 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'K', apos )
677 ELSE IF( scode.EQ.32 )
THEN
682 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
687 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
689 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 .OR. scode.EQ.35 .OR.
695 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
700 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'K', apos )
702 ELSE IF( scode.EQ.37 )
THEN
707 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
712 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
714 ELSE IF( scode.EQ.38 )
THEN
719 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
724 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
726 ELSE IF( scode.EQ.39 )
THEN
731 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
736 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
738 ELSE IF( scode.EQ.40 )
THEN
743 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'M', apos )
748 CALL pschkdim( ictxt, nout, subptr, scode, sname,
'N', apos )
757 SUBROUTINE pschkdim( 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 psvecee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
943 INTEGER ICTXT, NOUT, SCODE
1092 IF( scode.EQ.11 )
THEN
1097 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1102 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1104 ELSE IF( scode.EQ.12 .OR. scode.EQ.15 )
THEN
1109 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1111 ELSE IF( scode.EQ.13 )
THEN
1116 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1121 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1123 ELSE IF( scode.EQ.14 )
THEN
1128 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1132 ELSE IF( scode.EQ.21 )
THEN
1137 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1142 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1144 ELSE IF( scode.EQ.22 )
THEN
1149 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1154 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1156 ELSE IF( scode.EQ.23 )
THEN
1161 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1163 ELSE IF( scode.EQ.24 .OR. scode.EQ.27 )
THEN
1168 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1173 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'Y', apos )
1175 ELSE IF( scode.EQ.26 .OR. scode.EQ.27 )
THEN
1180 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'X', apos )
1189 SUBROUTINE psmatee( ICTXT, NOUT, SUBPTR, SCODE, SNAME )
1197 INTEGER ICTXT, NOUT, SCODE
1346 IF( scode.EQ.21 .OR. scode.EQ.23 )
THEN
1351 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1353 ELSE IF( scode.EQ.22 )
THEN
1358 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1360 ELSE IF( scode.EQ.24 .OR. scode.EQ.27 )
THEN
1365 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1367 ELSE IF( scode.EQ.25 .OR. scode.EQ.26 )
THEN
1372 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1376 ELSE IF( scode.EQ.31 )
THEN
1381 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1386 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1391 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1393 ELSE IF( scode.EQ.32 .OR. scode.EQ.35 .OR. scode.EQ.36 )
THEN
1398 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1403 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1408 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1410 ELSE IF( scode.EQ.33 .OR. scode.EQ.34 )
THEN
1415 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1420 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1422 ELSE IF( scode.EQ.37 )
THEN
1427 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1432 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1434 ELSE IF( scode.EQ.38 )
THEN
1439 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1444 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'B', apos )
1446 ELSE IF( scode.EQ.39 )
THEN
1451 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1456 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'C', apos )
1458 ELSE IF( scode.EQ.40 )
THEN
1463 CALL pschkmat( ictxt, nout, subptr, scode, sname,
'A', apos )
1468 CALL pschkmat( 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 )
1578 PARAMETER ( ONE = 1.0e+0 )
1584 CHARACTER*1 DIAG, SIDE, TRANSA, TRANSB, UPLO
1585 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
1586 $ jc, jx, jy, kdim, mdim, ndim
1588 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
1589 $ descx( dlen_ ), descy( dlen_ )
1590 REAL A( 2, 2 ), B( 2, 2 ), C( 2, 2 ), X( 2 ), Y( 2 )
1591 COMMON /PBLASC/DIAG, SIDE, TRANSA, TRANSB, UPLO
1592 COMMON /pblasd/desca, descb, descc, descx, descy
1593 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
1594 $ ja, jb, jc, jx, jy
1595 COMMON /pblasm/a, b, c
1596 COMMON /pblasn/kdim, mdim, ndim
1597 COMMON /pblass/sclr, usclr
1627 CALL pb_descset2( desca, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1637 CALL pb_descset2( descb, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1647 CALL pb_descset2( descc, 2, 2, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1655 CALL pb_descset2( descx, 2, 1, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1664 CALL pb_descset2( descy, 2, 1, 1, 1, 1, 1, 0, 0, ictxt, 2 )
1672 SUBROUTINE pschkmat( ICTXT, NOUT, SUBPTR, SCODE, SNAME, ARGNAM,
1682 INTEGER ARGPOS, ICTXT, NOUT, SCODE
1798 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1799 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
1801 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
1802 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1803 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1804 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1806 PARAMETER ( DESCMULT = 100 )
1809 INTEGER I, INFOT, NPROW, NPCOL, MYROW, MYCOL
1819 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
1821 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
1822 $ descx( dlen_ ), descy( dlen_ )
1823 COMMON /pblasd/desca, descb, descc, descx, descy
1824 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
1825 $ ja, jb, jc, jx, jy
1829 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1831 IF( lsame( argnam,
'A' ) )
THEN
1839 CALL pchkpbe( ictxt, nout, sname, infot )
1847 CALL pchkpbe( ictxt, nout, sname, infot )
1857 infot = ( ( argpos + 3 ) * descmult ) + i
1859 CALL pchkpbe( ictxt, nout, sname, infot )
1863 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1864 $ ( i.EQ.lld_ ) )
THEN
1871 $ desca( i ) = nprow
1876 $ desca( i ) = npcol
1880 IF( i.EQ.lld_ )
THEN
1881 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
1888 infot = ( ( argpos + 3 ) * descmult ) + i
1890 CALL pchkpbe( ictxt, nout, sname, infot )
1896 ELSE IF( lsame( argnam,
'B' ) )
THEN
1904 CALL pchkpbe( ictxt, nout, sname, infot )
1912 CALL pchkpbe( ictxt, nout, sname, infot )
1922 infot = ( ( argpos + 3 ) * descmult ) + i
1924 CALL pchkpbe( ictxt, nout, sname, infot )
1928 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1929 $ ( i.EQ.lld_ ) )
THEN
1936 $ descb( i ) = nprow
1941 $ descb( i ) = npcol
1945 IF( i.EQ.lld_ )
THEN
1946 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
1953 infot = ( ( argpos + 3 ) * descmult ) + i
1955 CALL pchkpbe( ictxt, nout, sname, infot )
1961 ELSE IF( lsame( argnam,
'C' ) )
THEN
1969 CALL pchkpbe( ictxt, nout, sname, infot )
1977 CALL pchkpbe( ictxt, nout, sname, infot )
1987 infot = ( ( argpos + 3 ) * descmult ) + i
1989 CALL pchkpbe( ictxt, nout, sname, infot )
1993 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
1994 $ ( i.EQ.lld_ ) )
THEN
2001 $ descc( i ) = nprow
2006 $ descc( i ) = npcol
2010 IF( i.EQ.lld_ )
THEN
2011 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2018 infot = ( ( argpos + 3 ) * descmult ) + i
2020 CALL pchkpbe( ictxt, nout, sname, infot )
2026 ELSE IF( lsame( argnam,
'X' ) )
THEN
2034 CALL pchkpbe( ictxt, nout, sname, infot )
2042 CALL pchkpbe( ictxt, nout, sname, infot )
2052 infot = ( ( argpos + 3 ) * descmult ) + i
2054 CALL pchkpbe( ictxt, nout, sname, infot )
2058 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
2059 $ ( i.EQ.lld_ ) )
THEN
2066 $ descx( i ) = nprow
2071 $ descx( i ) = npcol
2075 IF( i.EQ.lld_ )
THEN
2076 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2083 infot = ( ( argpos + 3 ) * descmult ) + i
2085 CALL pchkpbe( ictxt, nout, sname, infot )
2097 CALL pchkpbe( ictxt, nout, sname, infot )
2107 CALL pchkpbe( ictxt, nout, sname, infot )
2115 CALL pchkpbe( ictxt, nout, sname, infot )
2125 infot = ( ( argpos + 3 ) * descmult ) + i
2127 CALL pchkpbe( ictxt, nout, sname, infot )
2131 IF( ( i.EQ.rsrc_ ) .OR. ( i.EQ.csrc_ ) .OR.
2132 $ ( i.EQ.lld_ ) )
THEN
2139 $ descy( i ) = nprow
2144 $ descy( i ) = npcol
2148 IF( i.EQ.lld_ )
THEN
2149 IF( myrow.EQ.0 .AND.mycol.EQ.0 )
THEN
2156 infot = ( ( argpos + 3 ) * descmult ) + i
2158 CALL pchkpbe( ictxt, nout, sname, infot )
2170 CALL pchkpbe( ictxt, nout, sname, infot )
2308 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2309 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2311 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
2312 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2313 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2314 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2317 CHARACTER*1 DIAG, SIDE, TRANSA, TRANSB, UPLO
2318 INTEGER IA, IB, IC, INCX, INCY, ISCLR, IX, IY, JA, JB,
2319 $ JC, JX, JY, KDIM, MDIM, NDIM
2321 INTEGER DESCA( DLEN_ ), DESCB( DLEN_ ), DESCC( DLEN_ ),
2322 $ DESCX( DLEN_ ), DESCY( DLEN_ )
2323 REAL A( 2, 2 ), B( 2, 2 ), C( 2, 2 ), X( 2 ), Y( 2 )
2324 COMMON /pblasc/diag, side, transa, transb, uplo
2325 COMMON /pblasd/desca, descb, descc, descx, descy
2326 COMMON /pblasi/ia, ib, ic, incx, incy, isclr, ix, iy,
2327 $ ja, jb, jc, jx, jy
2328 COMMON /pblasm/a, b, c
2329 COMMON /pblasn/kdim, mdim, ndim
2330 COMMON /pblass/sclr, usclr
2337 IF( scode.EQ.11 )
THEN
2339 CALL subptr( ndim, x, ix, jx, descx, incx, y, iy, jy, descy,
2342 ELSE IF( scode.EQ.12 )
THEN
2344 CALL subptr( ndim, sclr, x, ix, jx, descx, incx )
2346 ELSE IF( scode.EQ.13 )
THEN
2348 CALL subptr( ndim, sclr, x, ix, jx, descx, incx, y, iy, jy,
2351 ELSE IF( scode.EQ.14 )
THEN
2353 CALL subptr( ndim, sclr, isclr, x, ix, jx, descx, incx )
2355 ELSE IF( scode.EQ.15 )
THEN
2357 CALL subptr( ndim, usclr, x, ix, jx, descx, incx )
2361 ELSE IF( scode.EQ.21 )
THEN
2363 CALL subptr( transa, mdim, ndim, sclr, a, ia, ja, desca, x, ix,
2364 $ jx, descx, incx, sclr, y, iy, jy, descy, incy )
2366 ELSE IF( scode.EQ.22 )
THEN
2368 CALL subptr( uplo, ndim, sclr, a, ia, ja, desca, x, ix, jx,
2369 $ descx, incx, sclr, y, iy, jy, descy, incy )
2371 ELSE IF( scode.EQ.23 )
THEN
2373 CALL subptr( uplo, transa, diag, ndim, a, ia, ja, desca, x, ix,
2376 ELSE IF( scode.EQ.24 )
THEN
2378 CALL subptr( mdim, ndim, sclr, x, ix, jx, descx, incx, y, iy,
2379 $ jy, descy, incy, a, ia, ja, desca )
2381 ELSE IF( scode.EQ.25 )
THEN
2383 CALL subptr( uplo, ndim, sclr, x, ix, jx, descx, incx, a, ia,
2386 ELSE IF( scode.EQ.26 )
THEN
2388 CALL subptr( uplo, ndim, usclr, x, ix, jx, descx, incx, a, ia,
2391 ELSE IF( scode.EQ.27 )
THEN
2393 CALL subptr( uplo, ndim, sclr, x, ix, jx, descx, incx, y, iy,
2394 $ jy, descy, incy, a, ia, ja, desca )
2398 ELSE IF( scode.EQ.31 )
THEN
2400 CALL subptr( transa, transb, mdim, ndim, kdim, sclr, a, ia, ja,
2401 $ desca, b, ib, jb, descb, sclr, c, ic, jc, descc )
2403 ELSE IF( scode.EQ.32 )
THEN
2405 CALL subptr( side, uplo, mdim, ndim, sclr, a, ia, ja, desca, b,
2406 $ ib, jb, descb, sclr, c, ic, jc, descc )
2408 ELSE IF( scode.EQ.33 )
THEN
2410 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2411 $ sclr, c, ic, jc, descc )
2413 ELSE IF( scode.EQ.34 )
THEN
2415 CALL subptr( uplo, transa, ndim, kdim, usclr, a, ia, ja, desca,
2416 $ usclr, c, ic, jc, descc )
2418 ELSE IF( scode.EQ.35 )
THEN
2420 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2421 $ b, ib, jb, descb, sclr, c, ic, jc, descc )
2423 ELSE IF( scode.EQ.36 )
THEN
2425 CALL subptr( uplo, transa, ndim, kdim, sclr, a, ia, ja, desca,
2426 $ b, ib, jb, descb, usclr, c, ic, jc, descc )
2428 ELSE IF( scode.EQ.37 )
THEN
2430 CALL subptr( mdim, ndim, sclr, a, ia, ja, desca, sclr, c, ic,
2433 ELSE IF( scode.EQ.38 )
THEN
2435 CALL subptr( side, uplo, transa, diag, mdim, ndim, sclr, a, ia,
2436 $ ja, desca, b, ib, jb, descb )
2438 ELSE IF( scode.EQ.39 )
THEN
2440 CALL subptr( transa, mdim, ndim, sclr, a, ia, ja, desca, sclr,
2441 $ c, ic, jc, descc )
2443 ELSE IF( scode.EQ.40 )
THEN
2445 CALL subptr( uplo, transa, mdim, ndim, sclr, a, ia, ja, desca,
2446 $ sclr, c, ic, jc, descc )
2455 SUBROUTINE pserrset( ERR, ERRMAX, XTRUE, X )
2463 REAL ERR, ERRMAX, X, XTRUE
2565 err = abs( psdiff( xtrue, x ) )
2567 errmax =
max( errmax, err )
2574 SUBROUTINE pschkvin( ERRMAX, N, X, PX, IX, JX, DESCX, INCX,
2583 INTEGER INCX, INFO, IX, JX, N
2588 REAL PX( * ), X( * )
2712 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2713 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2715 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
2716 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2717 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2718 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2720 PARAMETER ( ZERO = 0.0e+0 )
2723 LOGICAL COLREP, ROWREP
2724 INTEGER I, IB, ICTXT, ICURCOL, ICURROW, IIX, IN, IXCOL,
2725 $ IXROW, J, JB, JJX, JN, KK, LDPX, LDX, LL,
2726 $ MYCOL, MYROW, NPCOL, NPROW
2737 INTRINSIC abs,
max,
min, mod
2749 ictxt = descx( ctxt_ )
2750 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
2752 eps = pslamch( ictxt,
'eps' )
2754 CALL pb_infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix,
2755 $ jjx, ixrow, ixcol )
2758 ldpx = descx( lld_ )
2759 rowrep = ( ixrow.EQ.-1 )
2760 colrep = ( ixcol.EQ.-1 )
2764 IF( ( myrow.EQ.ixrow .OR. rowrep ) .AND.
2765 $ ( mycol.EQ.ixcol .OR. colrep ) )
2766 $
CALL pserrset( err, errmax, x( ix+(jx-1)*ldx ),
2767 $ px( iix+(jjx-1)*ldpx ) )
2769 ELSE IF( incx.EQ.descx( m_ ) )
THEN
2773 jb = descx( inb_ ) - jx + 1
2775 $ jb = ( ( -jb ) / descx( nb_ ) + 1 ) * descx( nb_ ) + jb
2779 IF( myrow.EQ.ixrow .OR. rowrep )
THEN
2782 IF( mycol.EQ.icurcol .OR. colrep )
THEN
2784 CALL pserrset( err, errmax, x( ix+(j-1)*ldx ),
2785 $ px( iix+(jjx-1)*ldpx ) )
2789 icurcol = mod( icurcol+1, npcol )
2791 DO 30 j = jn+1, jx+n-1, descx( nb_ )
2792 jb =
min( jx+n-j, descx( nb_ ) )
2794 IF( mycol.EQ.icurcol .OR. colrep )
THEN
2797 CALL pserrset( err, errmax, x( ix+(j+kk-1)*ldx ),
2798 $ px( iix+(jjx+kk-1)*ldpx ) )
2805 icurcol = mod( icurcol+1, npcol )
2815 ib = descx( imb_ ) - ix + 1
2817 $ ib = ( ( -ib ) / descx( mb_ ) + 1 ) * descx( mb_ ) + ib
2821 IF( mycol.EQ.ixcol .OR. colrep )
THEN
2824 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
2826 CALL pserrset( err, errmax, x( i+(jx-1)*ldx ),
2827 $ px( iix+(jjx-1)*ldpx ) )
2831 icurrow = mod( icurrow+1, nprow )
2833 DO 60 i = in+1, ix+n-1, descx( mb_ )
2834 ib =
min( ix+n-i, descx( mb_ ) )
2836 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
2839 CALL pserrset( err, errmax, x( i+kk+(jx-1)*ldx ),
2840 $ px( iix+kk+(jjx-1)*ldpx ) )
2847 icurrow = mod( icurrow+1, nprow )
2855 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
2858 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
2860 ELSE IF( errmax.GT.eps )
THEN
2869 SUBROUTINE pschkvout( N, X, PX, IX, JX, DESCX, INCX, INFO )
2877 INTEGER INCX, INFO, IX, JX, N
2881 REAL PX( * ), X( * )
3001 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3002 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3004 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3005 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3006 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3007 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3009 PARAMETER ( ZERO = 0.0e+0 )
3012 LOGICAL COLREP, ROWREP
3013 INTEGER I, IB, ICTXT, ICURCOL, ICURROW, II, IMBX, INBX,
3014 $ J, JB, JJ, KK, LDPX, LDX, LL, MBX, MPALL,
3015 $ MYCOL, MYCOLDIST, MYROW, MYROWDIST, NBX, NPCOL,
3017 REAL EPS, ERR, ERRMAX
3020 EXTERNAL BLACS_GRIDINFO, PSERRSET, SGAMX2D
3025 EXTERNAL PSLAMCH, PB_NUMROC
3028 INTRINSIC abs,
max,
min, mod
3037 IF( ( descx( m_ ).LE.0 ).OR.( descx( n_ ).LE.0 ) )
3042 ictxt = descx( ctxt_ )
3043 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3045 eps = pslamch( ictxt,
'eps' )
3047 mpall = pb_numroc( descx( m_ ), 1, descx( imb_ ), descx( mb_ ),
3048 $ myrow, descx( rsrc_ ), nprow )
3049 nqall = pb_numroc( descx( n_ ), 1, descx( inb_ ), descx( nb_ ),
3050 $ mycol, descx( csrc_ ), npcol )
3055 ldpx = descx( lld_ )
3056 icurrow = descx( rsrc_ )
3057 icurcol = descx( csrc_ )
3058 rowrep = ( icurrow.EQ.-1 )
3059 colrep = ( icurcol.EQ.-1 )
3060 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3061 imbx = descx( imb_ )
3065 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3066 inbx = descx( inb_ )
3073 myrowdist = mod( myrow - icurrow + nprow, nprow )
3078 mycoldist = mod( mycol - icurcol + npcol, npcol )
3083 IF( incx.EQ.descx( m_ ) )
THEN
3087 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3090 IF( mycoldist.EQ.0 )
THEN
3093 j = descx( inb_ ) + ( mycoldist - 1 ) * nbx + 1
3095 jb =
min(
max( 0, descx( n_ ) - j + 1 ), inbx )
3096 ib =
min( descx( m_ ), descx( imb_ ) )
3100 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR. j+kk.GT.jx+n-1 )
3101 $
CALL pserrset( err, errmax,
3102 $ x( i+ll+(j+kk-1)*ldx ),
3103 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3109 j = j + inbx + ( npcol - 1 ) * nbx
3112 DO 50 jj = inbx+1, nqall, nbx
3113 jb =
min( nqall-jj+1, nbx )
3117 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3119 $
CALL pserrset( err, errmax,
3120 $ x( i+ll+(j+kk-1)*ldx ),
3121 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3137 icurrow = mod( icurrow + 1, nprow )
3139 DO 110 i = descx( imb_ ) + 1, descx( m_ ), mbx
3140 ib =
min( descx( m_ ) - i + 1, mbx )
3142 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3144 IF( mycoldist.EQ.0 )
THEN
3147 j = descx( inb_ ) + ( mycoldist - 1 ) * nbx + 1
3151 jb =
min(
max( 0, descx( n_ ) - j + 1 ), inbx )
3154 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3156 $
CALL pserrset( err, errmax,
3157 $ x( i+ll+(j+kk-1)*ldx ),
3158 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3164 j = j + inbx + ( npcol - 1 ) * nbx
3167 DO 100 jj = inbx+1, nqall, nbx
3168 jb =
min( nqall-jj+1, nbx )
3172 IF( i+ll.NE.ix .OR. j+kk.LT.jx .OR.
3174 $
CALL pserrset( err, errmax,
3175 $ x( i+ll+(j+kk-1)*ldx ),
3176 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3192 icurrow = mod( icurrow + 1, nprow )
3200 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3203 IF( myrowdist.EQ.0 )
THEN
3206 i = descx( imb_ ) + ( myrowdist - 1 ) * mbx + 1
3208 ib =
min(
max( 0, descx( m_ ) - i + 1 ), imbx )
3209 jb =
min( descx( n_ ), descx( inb_ ) )
3213 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR. i+ll.GT.ix+n-1 )
3214 $
CALL pserrset( err, errmax,
3215 $ x( i+ll+(j+kk-1)*ldx ),
3216 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3222 i = i + imbx + ( nprow - 1 ) * mbx
3225 DO 160 ii = imbx+1, mpall, mbx
3226 ib =
min( mpall-ii+1, mbx )
3230 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3232 $
CALL pserrset( err, errmax,
3233 $ x( i+ll+(j+kk-1)*ldx ),
3234 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3250 icurcol = mod( icurcol + 1, npcol )
3252 DO 220 j = descx( inb_ ) + 1, descx( n_ ), nbx
3253 jb =
min( descx( n_ ) - j + 1, nbx )
3255 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3257 IF( myrowdist.EQ.0 )
THEN
3260 i = descx( imb_ ) + ( myrowdist - 1 ) * mbx + 1
3264 ib =
min(
max( 0, descx( m_ ) - i + 1 ), imbx )
3267 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3269 $
CALL pserrset( err, errmax,
3270 $ x( i+ll+(j+kk-1)*ldx ),
3271 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3277 i = i + imbx + ( nprow - 1 ) * mbx
3280 DO 210 ii = imbx+1, mpall, mbx
3281 ib =
min( mpall-ii+1, mbx )
3285 IF( j+kk.NE.jx .OR. i+ll.LT.ix .OR.
3287 $
CALL pserrset( err, errmax,
3288 $ x( i+ll+(j+kk-1)*ldx ),
3289 $ px( ii+ll+(jj+kk-1)*ldpx ) )
3305 icurcol = mod( icurcol + 1, npcol )
3311 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3314 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3316 ELSE IF( errmax.GT.eps )
THEN
3325 SUBROUTINE pschkmin( ERRMAX, M, N, A, PA, IA, JA, DESCA, INFO )
3333 INTEGER IA, INFO, JA, M, N
3338 REAL PA( * ), A( * )
3461 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3462 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3464 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3465 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3466 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3467 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3469 PARAMETER ( ZERO = 0.0e+0 )
3472 LOGICAL COLREP, ROWREP
3473 INTEGER H, I, IACOL, IAROW, IB, ICTXT, ICURCOL,
3474 $ ICURROW, II, IIA, IN, J, JB, JJ, JJA, JN, K,
3475 $ KK, LDA, LDPA, LL, MYCOL, MYROW, NPCOL, NPROW
3486 INTRINSIC abs,
max,
min, mod
3495 IF( ( m.EQ.0 ).OR.( n.EQ.0 ) )
3500 ictxt = desca( ctxt_ )
3501 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3503 eps = pslamch( ictxt,
'eps' )
3505 CALL pb_infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia,
3506 $ jja, iarow, iacol )
3511 ldpa = desca( lld_ )
3514 rowrep = ( iarow.EQ.-1 )
3515 colrep = ( iacol.EQ.-1 )
3519 jb = desca( inb_ ) - ja + 1
3521 $ jb = ( ( -jb ) / desca( nb_ ) + 1 ) * desca( nb_ ) + jb
3525 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3528 ib = desca( imb_ ) - ia + 1
3530 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
3533 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3535 CALL pserrset( err, errmax, a( ia+k+(ja+h-1)*lda ),
3536 $ pa( ii+k+(jj+h-1)*ldpa ) )
3540 icurrow = mod( icurrow+1, nprow )
3544 DO 30 i = in+1, ia+m-1, desca( mb_ )
3545 ib =
min( desca( mb_ ), ia+m-i )
3546 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3548 CALL pserrset( err, errmax, a( i+k+(ja+h-1)*lda ),
3549 $ pa( ii+k+(jj+h-1)*ldpa ) )
3553 icurrow = mod( icurrow+1, nprow )
3564 icurcol = mod( icurcol+1, npcol )
3568 DO 90 j = jn+1, ja+n-1, desca( nb_ )
3569 jb =
min( desca( nb_ ), ja+n-j )
3570 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3572 ib = desca( imb_ ) - ia + 1
3574 $ ib = ( ( -ib ) / desca( mb_ ) + 1 )*desca( mb_ ) + ib
3577 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3579 CALL pserrset( err, errmax, a( ia+k+(j+h-1)*lda ),
3580 $ pa( ii+k+(jj+h-1)*ldpa ) )
3584 icurrow = mod( icurrow+1, nprow )
3588 DO 70 i = in+1, ia+m-1, desca( mb_ )
3589 ib =
min( desca( mb_ ), ia+m-i )
3590 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
3593 $ a( i+k+(j+h-1)*lda ),
3594 $ pa( ii+k+(jj+h-1)*ldpa ) )
3598 icurrow = mod( icurrow+1, nprow )
3608 icurcol = mod( icurcol+1, npcol )
3612 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3615 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3617 ELSE IF( errmax.GT.eps )
THEN
3626 SUBROUTINE pschkmout( M, N, A, PA, IA, JA, DESCA, INFO )
3634 INTEGER IA, INFO, JA, M, N
3638 REAL A( * ), PA( * )
3757 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3758 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3760 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
3761 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3762 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3763 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3765 PARAMETER ( ZERO = 0.0e+0 )
3768 LOGICAL COLREP, ROWREP
3769 INTEGER I, IB, ICTXT, ICURCOL, II, IMBA, J, JB, JJ, KK,
3770 $ LDA, LDPA, LL, MPALL, MYCOL, MYROW, MYROWDIST,
3772 REAL EPS, ERR, ERRMAX
3775 EXTERNAL blacs_gridinfo,
pserrset, sgamx2d
3780 EXTERNAL PSLAMCH, PB_NUMROC
3792 IF( ( desca( m_ ).LE.0 ).OR.( desca( n_ ).LE.0 ) )
3797 ictxt = desca( ctxt_ )
3798 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
3800 eps = pslamch( ictxt,
'eps' )
3802 mpall = pb_numroc( desca( m_ ), 1, desca( imb_ ), desca( mb_ ),
3803 $ myrow, desca( rsrc_ ), nprow )
3806 ldpa = desca( lld_ )
3810 rowrep = ( desca( rsrc_ ).EQ.-1 )
3811 colrep = ( desca( csrc_ ).EQ.-1 )
3812 icurcol = desca( csrc_ )
3813 IF( myrow.EQ.desca( rsrc_ ) .OR. rowrep )
THEN
3814 imba = desca( imb_ )
3821 myrowdist = mod( myrow - desca( rsrc_ ) + nprow, nprow )
3824 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3827 IF( myrowdist.EQ.0 )
THEN
3830 i = desca( imb_ ) + ( myrowdist - 1 ) * desca( mb_ ) + 1
3832 ib =
min(
max( 0, desca( m_ ) - i + 1 ), imba )
3833 jb =
min( desca( n_ ), desca( inb_ ) )
3837 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3838 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3839 $
CALL pserrset( err, errmax, a( i+ll+(j+kk-1)*lda ),
3840 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3846 i = i + imba + ( nprow - 1 ) * desca( mb_ )
3849 DO 50 ii = imba + 1, mpall, desca( mb_ )
3850 ib =
min( mpall-ii+1, desca( mb_ ) )
3854 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3855 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3857 $ a( i+ll+(j+kk-1)*lda ),
3858 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3863 i = i + desca( mb_ )
3865 i = i + nprow * desca( mb_ )
3874 icurcol = mod( icurcol + 1, npcol )
3876 DO 110 j = desca( inb_ ) + 1, desca( n_ ), desca( nb_ )
3877 jb =
min( desca( n_ ) - j + 1, desca( nb_ ) )
3879 IF( mycol.EQ.icurcol .OR. colrep )
THEN
3881 IF( myrowdist.EQ.0 )
THEN
3884 i = desca( imb_ ) + ( myrowdist - 1 ) * desca( mb_ ) + 1
3888 ib =
min(
max( 0, desca( m_ ) - i + 1 ), imba )
3891 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3892 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3894 $ a( i+ll+(j+kk-1)*lda ),
3895 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3901 i = i + imba + ( nprow - 1 ) * desca( mb_ )
3904 DO 100 ii = imba+1, mpall, desca( mb_ )
3905 ib =
min( mpall-ii+1, desca( mb_ ) )
3909 IF( i+ll.LT.ia .OR. i+ll.GT.ia+m-1 .OR.
3910 $ j+kk.LT.ja .OR. j+kk.GT.ja+n-1 )
3912 $ a( i+ll+(j+kk-1)*lda ),
3913 $ pa( ii+ll+(jj+kk-1)*ldpa ) )
3918 i = i + desca( mb_ )
3920 i = i + nprow * desca( mb_ )
3929 icurcol = mod( icurcol + 1, npcol )
3933 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, errmax, 1, kk, ll, -1,
3936 IF( errmax.GT.zero .AND. errmax.LE.eps )
THEN
3938 ELSE IF( errmax.GT.eps )
THEN
3947 SUBROUTINE psmprnt( ICTXT, NOUT, M, N, A, LDA, IRPRNT, ICPRNT,
3956 INTEGER ICPRNT, ICTXT, IRPRNT, LDA, M, N, NOUT
3959 CHARACTER*(*) CMATNM
4016 INTEGER I, J, MYCOL, MYROW, NPCOL, NPROW
4019 EXTERNAL BLACS_GRIDINFO
4025 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
4030 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4032 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
4034 WRITE( nout, fmt = * )
4039 WRITE( nout, fmt = 9999 ) cmatnm, i, j, a( i, j )
4047 9999
FORMAT( 1x, a,
'(', i6,
',', i6,
')=', e16.8 )
4054 SUBROUTINE psvprnt( ICTXT, NOUT, N, X, INCX, IRPRNT, ICPRNT,
4063 INTEGER ICPRNT, ICTXT, INCX, IRPRNT, N, NOUT
4066 CHARACTER*(*) CVECNM
4120 INTEGER I, MYCOL, MYROW, NPCOL, NPROW
4123 EXTERNAL BLACS_GRIDINFO
4134 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4136 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
4138 WRITE( nout, fmt = * )
4139 DO 10 i = 1, 1 + ( n-1 )*incx, incx
4141 WRITE( nout, fmt = 9999 ) cvecnm, i, x( i )
4147 9999
FORMAT( 1x, a,
'(', i6,
')=', e16.8 )
4154 SUBROUTINE psmvch( ICTXT, TRANS, M, N, ALPHA, A, IA, JA, DESCA,
4155 $ X, IX, JX, DESCX, INCX, BETA, Y, PY, IY, JY,
4156 $ DESCY, INCY, G, ERR, INFO )
4165 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4167 REAL ALPHA, BETA, ERR
4170 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4171 REAL A( * ), G( * ), PY( * ), X( * ), Y( * )
4350 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
4351 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
4353 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
4354 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
4355 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
4356 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
4358 parameter( zero = 0.0e+0, one = 1.0e+0 )
4361 LOGICAL COLREP, ROWREP, TRAN
4362 INTEGER I, IB, ICURCOL, ICURROW, IIY, IN, IOFFA, IOFFX,
4363 $ IOFFY, IYCOL, IYROW, J, JB, JJY, JN, KK, LDA,
4364 $ LDPY, LDX, LDY, ML, MYCOL, MYROW, NL, NPCOL,
4366 REAL EPS, ERRI, GTMP, TBETA, YTMP
4369 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
4374 EXTERNAL lsame, pslamch
4377 INTRINSIC abs,
max,
min, mod, sqrt
4381 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4383 eps = pslamch( ictxt,
'eps' )
4385 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
4391 tran = lsame( trans,
'T' ).OR.lsame( trans,
'C' )
4400 lda =
max( 1, desca( m_ ) )
4401 ldx =
max( 1, descx( m_ ) )
4402 ldy =
max( 1, descy( m_ ) )
4408 ioffy = iy + ( jy - 1 ) * ldy
4412 ioffx = ix + ( jx - 1 ) * ldx
4414 ioffa = ia + ( ja + i - 2 ) * lda
4416 ytmp = ytmp + a( ioffa ) * x( ioffx )
4417 gtmp = gtmp + abs( a( ioffa ) * x( ioffx ) )
4419 ioffx = ioffx + incx
4422 ioffa = ia + i - 1 + ( ja - 1 ) * lda
4424 ytmp = ytmp + a( ioffa ) * x( ioffx )
4425 gtmp = gtmp + abs( a( ioffa ) * x( ioffx ) )
4427 ioffx = ioffx + incx
4430 g( i ) = abs( alpha ) * gtmp + abs( tbeta * y( ioffy ) )
4431 y( ioffy ) = alpha * ytmp + tbeta * y( ioffy )
4432 ioffy = ioffy + incy
4439 ldpy = descy( lld_ )
4440 ioffy = iy + ( jy - 1 ) * ldy
4441 CALL pb_infog2l( iy, jy, descy, nprow, npcol, myrow, mycol, iiy,
4442 $ jjy, iyrow, iycol )
4445 rowrep = ( iyrow.EQ.-1 )
4446 colrep = ( iycol.EQ.-1 )
4448 IF( incy.EQ.descy( m_ ) )
THEN
4452 jb = descy( inb_ ) - jy + 1
4454 $ jb = ( ( -jb ) / descy( nb_ ) + 1 ) * descy( nb_ ) + jb
4460 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4461 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4462 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) ) / eps
4463 IF( g( j-jy+1 ).NE.zero )
4464 $ erri = erri / g( j-jy+1 )
4465 err =
max( err, erri )
4466 IF( err*sqrt( eps ).GE.one )
4471 ioffy = ioffy + incy
4475 icurcol = mod( icurcol+1, npcol )
4477 DO 70 j = jn+1, jy+ml-1, descy( nb_ )
4478 jb =
min( jy+ml-j, descy( nb_ ) )
4482 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4483 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4484 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) )/eps
4485 IF( g( j+kk-jy+1 ).NE.zero )
4486 $ erri = erri / g( j+kk-jy+1 )
4487 err =
max( err, erri )
4488 IF( err*sqrt( eps ).GE.one )
4493 ioffy = ioffy + incy
4497 icurcol = mod( icurcol+1, npcol )
4505 ib = descy( imb_ ) - iy + 1
4507 $ ib = ( ( -ib ) / descy( mb_ ) + 1 ) * descy( mb_ ) + ib
4513 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4514 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4515 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) ) / eps
4516 IF( g( i-iy+1 ).NE.zero )
4517 $ erri = erri / g( i-iy+1 )
4518 err =
max( err, erri )
4519 IF( err*sqrt( eps ).GE.one )
4524 ioffy = ioffy + incy
4528 icurrow = mod( icurrow+1, nprow )
4530 DO 100 i = in+1, iy+ml-1, descy( mb_ )
4531 ib =
min( iy+ml-i, descy( mb_ ) )
4535 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
4536 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
4537 erri = abs( py( iiy+(jjy-1)*ldpy ) - y( ioffy ) )/eps
4538 IF( g( i+kk-iy+1 ).NE.zero )
4539 $ erri = erri / g( i+kk-iy+1 )
4540 err =
max( err, erri )
4541 IF( err*sqrt( eps ).GE.one )
4546 ioffy = ioffy + incy
4550 icurrow = mod( icurrow+1, nprow )
4558 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
4559 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
4567 SUBROUTINE psvmch( ICTXT, UPLO, M, N, ALPHA, X, IX, JX, DESCX,
4568 $ INCX, Y, IY, JY, DESCY, INCY, A, PA, IA, JA,
4569 $ DESCA, G, ERR, INFO )
4578 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4583 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4584 REAL A( * ), G( * ), PA( * ), X( * ), Y( * )
4759 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
4760 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
4762 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
4763 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
4764 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
4765 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
4767 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
4770 LOGICAL COLREP, LOWER, ROWREP, UPPER
4771 INTEGER I, IACOL, IAROW, IB, IBEG, ICURROW, IEND, IIA,
4772 $ in, ioffa, ioffx, ioffy, j, jja, kk, lda, ldpa,
4773 $ ldx, ldy, mycol, myrow, npcol, nprow
4774 REAL ATMP, EPS, ERRI, GTMP
4777 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
4782 EXTERNAL LSAME, PSLAMCH
4785 INTRINSIC abs,
max,
min, mod, sqrt
4789 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
4791 eps = pslamch( ictxt,
'eps' )
4793 upper = lsame( uplo,
'U' )
4794 lower = lsame( uplo,
'L' )
4796 lda =
max( 1, desca( m_ ) )
4797 ldx =
max( 1, descx( m_ ) )
4798 ldy =
max( 1, descy( m_ ) )
4806 ioffy = iy + ( jy - 1 ) * ldy + ( j - 1 ) * incy
4814 ELSE IF( upper )
THEN
4825 DO 30 i = ibeg, iend
4827 ioffx = ix + ( jx - 1 ) * ldx + ( i - 1 ) * incx
4828 ioffa = ia + i - 1 + ( ja + j - 2 ) * lda
4829 atmp = x( ioffx ) * y( ioffy )
4830 gtmp = abs( x( ioffx ) * y( ioffy ) )
4831 g( i ) = abs( alpha ) * gtmp + abs( a( ioffa ) )
4832 a( ioffa ) = alpha * atmp + a( ioffa )
4840 ldpa = desca( lld_ )
4841 ioffa = ia + ( ja + j - 2 ) * lda
4842 CALL pb_infog2l( ia, ja+j-1, desca, nprow, npcol, myrow, mycol,
4843 $ iia, jja, iarow, iacol )
4844 rowrep = ( iarow.EQ.-1 )
4845 colrep = ( iacol.EQ.-1 )
4847 IF( mycol.EQ.iacol .OR. colrep )
THEN
4850 ib = desca( imb_ ) - ia + 1
4852 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
4858 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
4859 erri = abs( pa( iia+(jja-1)*ldpa ) - a( ioffa ) )/eps
4860 IF( g( i-ia+1 ).NE.zero )
4861 $ erri = erri / g( i-ia+1 )
4862 err =
max( err, erri )
4863 IF( err*sqrt( eps ).GE.one )
4872 icurrow = mod( icurrow+1, nprow )
4874 DO 60 i = in+1, ia+m-1, desca( mb_ )
4875 ib =
min( ia+m-i, desca( mb_ ) )
4879 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
4880 erri = abs( pa( iia+(jja-1)*ldpa )-a( ioffa ) )/eps
4881 IF( g( i+kk-ia+1 ).NE.zero )
4882 $ erri = erri / g( i+kk-ia+1 )
4883 err =
max( err, erri )
4884 IF( err*sqrt( eps ).GE.one )
4893 icurrow = mod( icurrow+1, nprow )
4901 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
4902 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
4916 SUBROUTINE psvmch2( ICTXT, UPLO, M, N, ALPHA, X, IX, JX, DESCX,
4917 $ INCX, Y, IY, JY, DESCY, INCY, A, PA, IA,
4918 $ JA, DESCA, G, ERR, INFO )
4927 INTEGER IA, ICTXT, INCX, INCY, INFO, IX, IY, JA, JX,
4932 INTEGER DESCA( * ), DESCX( * ), DESCY( * )
4933 REAL A( * ), G( * ), PA( * ), X( * ), Y( * )
5108 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5109 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5111 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5112 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5113 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5114 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5116 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
5119 LOGICAL COLREP, LOWER, ROWREP, UPPER
5120 INTEGER I, IACOL, IAROW, IB, IBEG, ICURROW, IEND, IIA,
5121 $ IN, IOFFA, IOFFXI, IOFFXJ, IOFFYI, IOFFYJ, J,
5122 $ JJA, KK, LDA, LDPA, LDX, LDY, MYCOL, MYROW,
5124 REAL EPS, ERRI, GTMP, ATMP
5127 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
5132 EXTERNAL lsame, pslamch
5135 INTRINSIC abs,
max,
min, mod, sqrt
5139 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5141 eps = pslamch( ictxt,
'eps' )
5143 upper = lsame( uplo,
'U' )
5144 lower = lsame( uplo,
'L' )
5146 lda =
max( 1, desca( m_ ) )
5147 ldx =
max( 1, descx( m_ ) )
5148 ldy =
max( 1, descy( m_ ) )
5156 ioffxj = ix + ( jx - 1 ) * ldx + ( j - 1 ) * incx
5157 ioffyj = iy + ( jy - 1 ) * ldy + ( j - 1 ) * incy
5165 ELSE IF( upper )
THEN
5176 DO 30 i = ibeg, iend
5177 ioffa = ia + i - 1 + ( ja + j - 2 ) * lda
5178 ioffxi = ix + ( jx - 1 ) * ldx + ( i - 1 ) * incx
5179 ioffyi = iy + ( jy - 1 ) * ldy + ( i - 1 ) * incy
5180 atmp = x( ioffxi ) * y( ioffyj )
5181 atmp = atmp + y( ioffyi ) * x( ioffxj )
5182 gtmp = abs( x( ioffxi ) * y( ioffyj ) )
5183 gtmp = gtmp + abs( y( ioffyi ) * x( ioffxj ) )
5184 g( i ) = abs( alpha ) * gtmp + abs( a( ioffa ) )
5185 a( ioffa ) = alpha*atmp + a( ioffa )
5193 ldpa = desca( lld_ )
5194 ioffa = ia + ( ja + j - 2 ) * lda
5195 CALL pb_infog2l( ia, ja+j-1, desca, nprow, npcol, myrow, mycol,
5196 $ iia, jja, iarow, iacol )
5197 rowrep = ( iarow.EQ.-1 )
5198 colrep = ( iacol.EQ.-1 )
5200 IF( mycol.EQ.iacol .OR. colrep )
THEN
5203 ib = desca( imb_ ) - ia + 1
5205 $ ib = ( ( -ib ) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
5211 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5212 erri = abs( pa( iia+(jja-1)*ldpa ) - a( ioffa ) )/eps
5213 IF( g( i-ia+1 ).NE.zero )
5214 $ erri = erri / g( i-ia+1 )
5215 err =
max( err, erri )
5216 IF( err*sqrt( eps ).GE.one )
5225 icurrow = mod( icurrow+1, nprow )
5227 DO 60 i = in+1, ia+m-1, desca( mb_ )
5228 ib =
min( ia+m-i, desca( mb_ ) )
5232 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5233 erri = abs( pa( iia+(jja-1)*ldpa )-a( ioffa ) )/eps
5234 IF( g( i+kk-ia+1 ).NE.zero )
5235 $ erri = erri / g( i+kk-ia+1 )
5236 err =
max( err, erri )
5237 IF( err*sqrt( eps ).GE.one )
5246 icurrow = mod( icurrow+1, nprow )
5254 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
5255 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5269 SUBROUTINE psmmch( ICTXT, TRANSA, TRANSB, M, N, K, ALPHA, A, IA,
5270 $ JA, DESCA, B, IB, JB, DESCB, BETA, C, PC, IC,
5271 $ JC, DESCC, CT, G, ERR, INFO )
5279 CHARACTER*1 TRANSA, TRANSB
5280 INTEGER IA, IB, IC, ICTXT, INFO, JA, JB, JC, K, M, N
5281 REAL ALPHA, BETA, ERR
5284 INTEGER DESCA( * ), DESCB( * ), DESCC( * )
5285 REAL A( * ), B( * ), C( * ), CT( * ), G( * ),
5462 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5463 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5465 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5466 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5467 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5468 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5470 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
5473 LOGICAL COLREP, ROWREP, TRANA, TRANB
5474 INTEGER I, IBB, ICCOL, ICROW, ICURROW, IIC, IN, IOFFA,
5475 $ IOFFB, IOFFC, J, JJC, KK, LDA, LDB, LDC, LDPC,
5476 $ mycol, myrow, npcol, nprow
5480 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
5485 EXTERNAL LSAME, PSLAMCH
5488 INTRINSIC abs,
max,
min, mod, sqrt
5492 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5494 eps = pslamch( ictxt,
'eps' )
5496 trana = lsame( transa,
'T' ).OR.lsame( transa,
'C' )
5497 tranb = lsame( transb,
'T' ).OR.lsame( transb,
'C' )
5499 lda =
max( 1, desca( m_ ) )
5500 ldb =
max( 1, descb( m_ ) )
5501 ldc =
max( 1, descc( m_ ) )
5509 ioffc = ic + ( jc + j - 2 ) * ldc
5515 IF( .NOT.trana .AND. .NOT.tranb )
THEN
5517 ioffb = ib + kk - 1 + ( jb + j - 2 ) * ldb
5519 ioffa = ia + i - 1 + ( ja + kk - 2 ) * lda
5520 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5521 g( i ) = g( i ) + abs( a( ioffa ) ) *
5525 ELSE IF( trana .AND. .NOT.tranb )
THEN
5527 ioffb = ib + kk - 1 + ( jb + j - 2 ) * ldb
5529 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5530 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5531 g( i ) = g( i ) + abs( a( ioffa ) ) *
5535 ELSE IF( .NOT.trana .AND. tranb )
THEN
5537 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5539 ioffa = ia + i - 1 + ( ja + kk - 2 ) * lda
5540 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5541 g( i ) = g( i ) + abs( a( ioffa ) ) *
5545 ELSE IF( trana .AND. tranb )
THEN
5547 ioffb = ib + j - 1 + ( jb + kk - 2 ) * ldb
5549 ioffa = ia + kk - 1 + ( ja + i - 2 ) * lda
5550 ct( i ) = ct( i ) + a( ioffa ) * b( ioffb )
5551 g( i ) = g( i ) + abs( a( ioffa ) ) *
5558 ct( i ) = alpha*ct( i ) + beta * c( ioffc )
5559 g( i ) = abs( alpha )*g( i ) + abs( beta )*abs( c( ioffc ) )
5560 c( ioffc ) = ct( i )
5568 ldpc = descc( lld_ )
5569 ioffc = ic + ( jc + j - 2 ) * ldc
5570 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
5571 $ iic, jjc, icrow, iccol )
5573 rowrep = ( icrow.EQ.-1 )
5574 colrep = ( iccol.EQ.-1 )
5576 IF( mycol.EQ.iccol .OR. colrep )
THEN
5578 ibb = descc( imb_ ) - ic + 1
5580 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
5586 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5587 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5588 $ c( ioffc ) ) / eps
5589 IF( g( i-ic+1 ).NE.zero )
5590 $ erri = erri / g( i-ic+1 )
5591 err =
max( err, erri )
5592 IF( err*sqrt( eps ).GE.one )
5601 icurrow = mod( icurrow+1, nprow )
5603 DO 230 i = in+1, ic+m-1, descc( mb_ )
5604 ibb =
min( ic+m-i, descc( mb_ ) )
5606 DO 220 kk = 0, ibb-1
5608 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5609 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5611 IF( g( i+kk-ic+1 ).NE.zero )
5612 $ erri = erri / g( i+kk-ic+1 )
5613 err =
max( err, erri )
5614 IF( err*sqrt( eps ).GE.one )
5623 icurrow = mod( icurrow+1, nprow )
5631 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
5632 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5646 SUBROUTINE psmmch1( ICTXT, UPLO, TRANS, N, K, ALPHA, A, IA, JA,
5647 $ DESCA, BETA, C, PC, IC, JC, DESCC, CT, G,
5656 CHARACTER*1 TRANS, UPLO
5657 INTEGER IA, IC, ICTXT, INFO, JA, JC, K, N
5658 REAL ALPHA, BETA, ERR
5661 INTEGER DESCA( * ), DESCC( * )
5662 REAL A( * ), C( * ), CT( * ), G( * ), PC( * )
5820 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
5821 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
5823 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
5824 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
5825 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
5826 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
5828 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
5831 LOGICAL COLREP, NOTRAN, ROWREP, TRAN, UPPER
5832 INTEGER I, IBB, IBEG, ICCOL, ICROW, ICURROW, IEND, IIC,
5833 $ IN, IOFFAK, IOFFAN, IOFFC, J, JJC, KK, LDA,
5834 $ LDC, LDPC, MYCOL, MYROW, NPCOL, NPROW
5838 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
5843 EXTERNAL lsame, pslamch
5846 INTRINSIC abs,
max,
min, mod, sqrt
5850 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
5852 eps = pslamch( ictxt,
'eps' )
5854 upper = lsame( uplo,
'U' )
5855 notran = lsame( trans,
'N' )
5856 tran = lsame( trans,
'T' )
5858 lda =
max( 1, desca( m_ ) )
5859 ldc =
max( 1, descc( m_ ) )
5882 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
5883 DO 20 i = ibeg, iend
5884 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
5885 ct( i ) = ct( i ) + a( ioffak ) * a( ioffan )
5886 g( i ) = g( i ) + abs( a( ioffak ) ) *
5887 $ abs( a( ioffan ) )
5890 ELSE IF( tran )
THEN
5892 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
5893 DO 40 i = ibeg, iend
5894 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
5895 ct( i ) = ct( i ) + a( ioffak ) * a( ioffan )
5896 g( i ) = g( i ) + abs( a( ioffak ) ) *
5897 $ abs( a( ioffan ) )
5902 ioffc = ic + ibeg - 1 + ( jc + j - 2 ) * ldc
5904 DO 100 i = ibeg, iend
5905 ct( i ) = alpha*ct( i ) + beta * c( ioffc )
5906 g( i ) = abs( alpha )*g( i ) + abs( beta )*abs( c( ioffc ) )
5907 c( ioffc ) = ct( i )
5915 ldpc = descc( lld_ )
5916 ioffc = ic + ( jc + j - 2 ) * ldc
5917 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
5918 $ iic, jjc, icrow, iccol )
5920 rowrep = ( icrow.EQ.-1 )
5921 colrep = ( iccol.EQ.-1 )
5923 IF( mycol.EQ.iccol .OR. colrep )
THEN
5925 ibb = descc( imb_ ) - ic + 1
5927 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
5933 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5934 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5935 $ c( ioffc ) ) / eps
5936 IF( g( i-ic+1 ).NE.zero )
5937 $ erri = erri / g( i-ic+1 )
5938 err =
max( err, erri )
5939 IF( err*sqrt( eps ).GE.one )
5948 icurrow = mod( icurrow+1, nprow )
5950 DO 130 i = in+1, ic+n-1, descc( mb_ )
5951 ibb =
min( ic+n-i, descc( mb_ ) )
5953 DO 120 kk = 0, ibb-1
5955 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
5956 erri = abs( pc( iic+(jjc-1)*ldpc ) -
5958 IF( g( i+kk-ic+1 ).NE.zero )
5959 $ erri = erri / g( i+kk-ic+1 )
5960 err =
max( err, erri )
5961 IF( err*sqrt( eps ).GE.one )
5970 icurrow = mod( icurrow+1, nprow )
5978 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
5979 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
5993 SUBROUTINE psmmch2( ICTXT, UPLO, TRANS, N, K, ALPHA, A, IA, JA,
5994 $ DESCA, B, IB, JB, DESCB, BETA, C, PC, IC,
5995 $ JC, DESCC, CT, G, ERR, INFO )
6003 CHARACTER*1 TRANS, UPLO
6004 INTEGER IA, IB, IC, ICTXT, INFO, JA, JB, JC, K, N
6005 REAL ALPHA, BETA, ERR
6008 INTEGER DESCA( * ), DESCB( * ), DESCC( * )
6009 REAL A( * ), B( * ), C( * ), CT( * ), G( * ),
6185 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
6186 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
6188 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
6189 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
6190 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
6191 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
6193 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
6196 LOGICAL COLREP, NOTRAN, ROWREP, TRAN, UPPER
6197 INTEGER I, IBB, IBEG, ICCOL, ICROW, ICURROW, IEND, IIC,
6198 $ IN, IOFFAK, IOFFAN, IOFFBK, IOFFBN, IOFFC, J,
6199 $ JJC, KK, LDA, LDB, LDC, LDPC, MYCOL, MYROW,
6204 EXTERNAL blacs_gridinfo, igsum2d,
pb_infog2l, sgamx2d
6209 EXTERNAL LSAME, PSLAMCH
6212 INTRINSIC abs,
max,
min, mod, sqrt
6216 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6218 eps = pslamch( ictxt,
'eps' )
6220 upper = lsame( uplo,
'U' )
6221 notran = lsame( trans,
'N' )
6222 tran = lsame( trans,
'T' )
6224 lda =
max( 1, desca( m_ ) )
6225 ldb =
max( 1, descb( m_ ) )
6226 ldc =
max( 1, descc( m_ ) )
6249 ioffak = ia + j - 1 + ( ja + kk - 2 ) * lda
6250 ioffbk = ib + j - 1 + ( jb + kk - 2 ) * ldb
6251 DO 20 i = ibeg, iend
6252 ioffan = ia + i - 1 + ( ja + kk - 2 ) * lda
6253 ioffbn = ib + i - 1 + ( jb + kk - 2 ) * ldb
6254 ct( i ) = ct( i ) + alpha * (
6255 $ a( ioffan ) * b( ioffbk ) +
6256 $ b( ioffbn ) * a( ioffak ) )
6257 g( i ) = g( i ) + abs( alpha ) * (
6258 $ abs( a( ioffan ) ) * abs( b( ioffbk ) ) +
6259 $ abs( b( ioffbn ) ) * abs( a( ioffak ) ) )
6262 ELSE IF( tran )
THEN
6264 ioffak = ia + kk - 1 + ( ja + j - 2 ) * lda
6265 ioffbk = ib + kk - 1 + ( jb + j - 2 ) * ldb
6266 DO 40 i = ibeg, iend
6267 ioffan = ia + kk - 1 + ( ja + i - 2 ) * lda
6268 ioffbn = ib + kk - 1 + ( jb + i - 2 ) * ldb
6269 ct( i ) = ct( i ) + alpha * (
6270 $ a( ioffan ) * b( ioffbk ) +
6271 $ b( ioffbn ) * a( ioffak ) )
6272 g( i ) = g( i ) + abs( alpha ) * (
6273 $ abs( a( ioffan ) ) * abs( b( ioffbk ) ) +
6274 $ abs( b( ioffbn ) ) * abs( a( ioffak ) ) )
6279 ioffc = ic + ibeg - 1 + ( jc + j - 2 ) * ldc
6281 DO 100 i = ibeg, iend
6282 ct( i ) = ct( i ) + beta * c( ioffc )
6283 g( i ) = g( i ) + abs( beta )*abs( c( ioffc ) )
6284 c( ioffc ) = ct( i )
6292 ldpc = descc( lld_ )
6293 ioffc = ic + ( jc + j - 2 ) * ldc
6294 CALL pb_infog2l( ic, jc+j-1, descc, nprow, npcol, myrow, mycol,
6295 $ iic, jjc, icrow, iccol )
6297 rowrep = ( icrow.EQ.-1 )
6298 colrep = ( iccol.EQ.-1 )
6300 IF( mycol.EQ.iccol .OR. colrep )
THEN
6302 ibb = descc( imb_ ) - ic + 1
6304 $ ibb = ( ( -ibb ) / descc( mb_ ) + 1 )*descc( mb_ ) + ibb
6310 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6311 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6312 $ c( ioffc ) ) / eps
6313 IF( g( i-ic+1 ).NE.zero )
6314 $ erri = erri / g( i-ic+1 )
6315 err =
max( err, erri )
6316 IF( err*sqrt( eps ).GE.one )
6325 icurrow = mod( icurrow+1, nprow )
6327 DO 130 i = in+1, ic+n-1, descc( mb_ )
6328 ibb =
min( ic+n-i, descc( mb_ ) )
6330 DO 120 kk = 0, ibb-1
6332 IF( myrow.EQ.icurrow .OR. rowrep )
THEN
6333 erri = abs( pc( iic+(jjc-1)*ldpc ) -
6335 IF( g( i+kk-ic+1 ).NE.zero )
6336 $ erri = erri / g( i+kk-ic+1 )
6337 err =
max( err, erri )
6338 IF( err*sqrt( eps ).GE.one )
6347 icurrow = mod( icurrow+1, nprow )
6355 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6356 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6370 SUBROUTINE psmmch3( UPLO, TRANS, M, N, ALPHA, A, IA, JA, DESCA,
6371 $ BETA, C, PC, IC, JC, DESCC, ERR, INFO )
6379 CHARACTER*1 TRANS, UPLO
6380 INTEGER IA, IC, INFO, JA, JC, M, N
6381 REAL ALPHA, BETA, ERR
6384 INTEGER DESCA( * ), DESCC( * )
6385 REAL A( * ), C( * ), PC( * )
6528 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
6529 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
6531 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
6532 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
6533 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
6534 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
6536 PARAMETER ( ZERO = 0.0e+0 )
6539 LOGICAL COLREP, LOWER, NOTRAN, ROWREP, UPPER
6540 INTEGER I, ICCOL, ICROW, ICTXT, IIC, IOFFA, IOFFC, J,
6541 $ JJC, LDA, LDC, LDPC, MYCOL, MYROW, NPCOL,
6543 REAL ERR0, ERRI, PREC
6546 EXTERNAL BLACS_GRIDINFO, IGSUM2D, PB_INFOG2L,
6552 EXTERNAL LSAME, PSLAMCH
6559 ictxt = descc( ctxt_ )
6560 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
6562 prec = pslamch( ictxt,
'eps' )
6564 upper = lsame( uplo,
'U' )
6565 lower = lsame( uplo,
'L' )
6566 notran = lsame( trans,
'N' )
6574 lda =
max( 1, desca( m_ ) )
6575 ldc =
max( 1, descc( m_ ) )
6576 ldpc =
max( 1, descc( lld_ ) )
6577 rowrep = ( descc( rsrc_ ).EQ.-1 )
6578 colrep = ( descc( csrc_ ).EQ.-1 )
6582 DO 20 j = jc, jc + n - 1
6584 ioffc = ic + ( j - 1 ) * ldc
6585 ioffa = ia + ( ja - 1 + j - jc ) * lda
6587 DO 10 i = ic, ic + m - 1
6590 IF( ( j - jc ).GE.( i - ic ) )
THEN
6591 CALL pserraxpby( erri, alpha, a( ioffa ), beta,
6592 $ c( ioffc ), prec )
6596 ELSE IF( lower )
THEN
6597 IF( ( j - jc ).LE.( i - ic ) )
THEN
6598 CALL pserraxpby( erri, alpha, a( ioffa ), beta,
6599 $ c( ioffc ), prec )
6604 CALL pserraxpby( erri, alpha, a( ioffa ), beta,
6605 $ c( ioffc ), prec )
6608 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6609 $ iic, jjc, icrow, iccol )
6610 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6611 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6612 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6615 err =
max( err, err0 )
6627 DO 40 j = jc, jc + n - 1
6629 ioffc = ic + ( j - 1 ) * ldc
6630 ioffa = ia + ( j - jc ) + ( ja - 1 ) * lda
6632 DO 30 i = ic, ic + m - 1
6635 IF( ( j - jc ).GE.( i - ic ) )
THEN
6636 CALL pserraxpby( erri, alpha, a( ioffa ), beta,
6637 $ c( ioffc ), prec )
6641 ELSE IF( lower )
THEN
6642 IF( ( j - jc ).LE.( i - ic ) )
THEN
6643 CALL pserraxpby( erri, alpha, a( ioffa ), beta,
6644 $ c( ioffc ), prec )
6649 CALL pserraxpby( erri, alpha, a( ioffa ), beta,
6650 $ c( ioffc ), prec )
6653 CALL pb_infog2l( i, j, descc, nprow, npcol, myrow, mycol,
6654 $ iic, jjc, icrow, iccol )
6655 IF( ( myrow.EQ.icrow .OR. rowrep ) .AND.
6656 $ ( mycol.EQ.iccol .OR. colrep ) )
THEN
6657 err0 = abs( pc( iic+(jjc-1)*ldpc )-c( ioffc ) )
6660 err =
max( err, err0 )
6674 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, mycol )
6675 CALL sgamx2d( ictxt,
'All',
' ', 1, 1, err, 1, i, j, -1, -1,
6683 SUBROUTINE pserraxpby( ERRBND, ALPHA, X, BETA, Y, PREC )
6691 REAL ALPHA, BETA, ERRBND, PREC, X, Y
6730 PARAMETER ( ONE = 1.0e+0, two = 2.0e+0,
6734 REAL ADDBND, FACT, SUMPOS, SUMNEG, TMP
6742 fact = one + two * prec
6743 addbnd = two * two * two * prec
6746 IF( tmp.GE.zero )
THEN
6747 sumpos = sumpos + tmp * fact
6749 sumneg = sumneg - tmp * fact
6753 IF( tmp.GE.zero )
THEN
6754 sumpos = sumpos + tmp * fact
6756 sumneg = sumneg - tmp * fact
6759 y = ( beta * y ) + ( alpha * x )
6761 errbnd = addbnd *
max( sumpos, sumneg )
6768 REAL FUNCTION PSLAMCH( ICTXT, CMACH )
6831 EXTERNAL pb_topget, sgamn2d, sgamx2d
6842 IF(
lsame( cmach,
'E' ).OR.
lsame( cmach,
'S' ).OR.
6843 $
lsame( cmach,
'M' ).OR.
lsame( cmach,
'U' ) )
THEN
6844 CALL pb_topget( ictxt,
'Combine',
'All', top )
6846 CALL sgamx2d( ictxt,
'All', top, 1, 1, temp, 1, idumm,
6847 $ idumm, -1, -1, idumm )
6848 ELSE IF(
lsame( cmach,
'L' ).OR.
lsame( cmach,
'O' ) )
THEN
6849 CALL pb_topget( ictxt,
'Combine',
'All', top )
6851 CALL sgamn2d( ictxt,
'All', top, 1, 1, temp, 1, idumm,
6852 $ idumm, -1, -1, idumm )
6862 SUBROUTINE pslaset( UPLO, M, N, ALPHA, BETA, A, IA, JA, DESCA )
6871 INTEGER IA, JA, M, N
7007 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
7008 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
7010 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
7011 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
7012 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
7013 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
7016 LOGICAL GODOWN, GOLEFT, ISCOLREP, ISROWREP, LOWER,
7018 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
7019 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP, JJA,
7020 $ JJMAX, JOFFA, JOFFD, LCMT, LCMT00, LDA, LMBLOC,
7021 $ LNBLOC, LOW, M1, MB, MBLKD, MBLKS, MBLOC, MP,
7022 $ MRCOL, MRROW, MYCOL, MYROW, N1, NB, NBLKD,
7023 $ NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB, QNB, TMP1,
7027 INTEGER DESCA2( DLEN_ )
7042 IF( m.EQ.0 .OR. n.EQ.0 )
7051 ictxt = desca2( ctxt_ )
7052 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
7054 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
7055 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
7056 $ iacol, mrrow, mrcol )
7058 IF( mp.LE.0 .OR. nq.LE.0 )
7061 isrowrep = ( desca2( rsrc_ ).LT.0 )
7062 iscolrep = ( desca2( csrc_ ).LT.0 )
7063 lda = desca2( lld_ )
7065 upper = .NOT.( lsame( uplo,
'L' ) )
7066 lower = .NOT.( lsame( uplo,
'U' ) )
7068 IF( ( ( lower.AND.upper ).AND.( alpha.EQ.beta ) ).OR.
7069 $ ( isrowrep .AND. iscolrep ) )
THEN
7070 IF( ( mp.GT.0 ).AND.( nq.GT.0 ) )
7071 $
CALL pb_slaset( uplo, mp, nq, 0, alpha, beta,
7072 $ a( iia + ( jja - 1 ) * lda ), lda )
7081 CALL pb_binfo( 0, mp, nq, imb1, inb1, mb, nb, mrrow, mrcol,
7082 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
7083 $ lnbloc, ilow, low, iupp, upp )
7107 godown = ( lcmt00.GT.iupp )
7108 goleft = ( lcmt00.LT.ilow )
7110 IF( .NOT.godown .AND. .NOT.goleft )
THEN
7114 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
7115 godown = .NOT.goleft
7117 CALL pb_slaset( uplo, imbloc, inbloc, lcmt00, alpha, beta,
7118 $ a( iia+joffa*lda ), lda )
7120 IF( upper .AND. nq.GT.inbloc )
7121 $
CALL pb_slaset(
'All', imbloc, nq-inbloc, 0, alpha,
7122 $ alpha, a( iia+(joffa+inbloc)*lda ), lda )
7126 IF( lower .AND. mp.GT.imbloc )
7127 $
CALL pb_slaset(
'All', mp-imbloc, inbloc, 0, alpha,
7128 $ alpha, a( iia+imbloc+joffa*lda ), lda )
7137 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7139 ioffa = ioffa + imbloc
7142 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7143 lcmt00 = lcmt00 - pmb
7149 tmp1 =
min( ioffa, iimax ) - iia + 1
7150 IF( upper .AND. tmp1.GT.0 )
THEN
7151 CALL pb_slaset(
'All', tmp1, n1, 0, alpha, alpha,
7152 $ a( iia+joffa*lda ), lda )
7166 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
7169 CALL pb_slaset( uplo, mbloc, inbloc, lcmt, alpha, beta,
7170 $ a( ioffd+1+joffa*lda ), lda )
7176 ioffd = ioffd + mbloc
7180 tmp1 = m1 - ioffd + iia - 1
7181 IF( lower .AND. tmp1.GT.0 )
7182 $
CALL pb_slaset(
'ALL', tmp1, inbloc, 0, alpha, alpha,
7183 $ a( ioffd+1+joffa*lda ), lda )
7185 tmp1 = ioffa - iia + 1
7188 lcmt00 = lcmt00 + low - ilow + qnb
7190 joffa = joffa + inbloc
7192 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7193 $
CALL pb_slaset(
'ALL', tmp1, n1, 0, alpha, alpha,
7194 $ a( iia+joffa*lda ), lda )
7199 ELSE IF( goleft )
THEN
7201 lcmt00 = lcmt00 + low - ilow + qnb
7203 joffa = joffa + inbloc
7206 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
7207 lcmt00 = lcmt00 + qnb
7213 tmp1 =
min( joffa, jjmax ) - jja + 1
7214 IF( lower .AND. tmp1.GT.0 )
THEN
7215 CALL pb_slaset(
'All', m1, tmp1, 0, alpha, alpha,
7216 $ a( iia+(jja-1)*lda ), lda )
7230 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
7233 CALL pb_slaset( uplo, imbloc, nbloc, lcmt, alpha, beta,
7234 $ a( iia+joffd*lda ), lda )
7240 joffd = joffd + nbloc
7244 tmp1 = n1 - joffd + jja - 1
7245 IF( upper .AND. tmp1.GT.0 )
7246 $
CALL pb_slaset(
'All', imbloc, tmp1, 0, alpha, alpha,
7247 $ a( iia+joffd*lda ), lda )
7249 tmp1 = joffa - jja + 1
7252 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7254 ioffa = ioffa + imbloc
7256 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
7257 $
CALL pb_slaset(
'All', m1, tmp1, 0, alpha, alpha,
7258 $ a( ioffa+1+(jja-1)*lda ), lda )
7267 IF( nblks.GT.0 )
THEN
7271 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7272 lcmt00 = lcmt00 - pmb
7278 tmp1 =
min( ioffa, iimax ) - iia + 1
7279 IF( upper .AND. tmp1.GT.0 )
THEN
7280 CALL pb_slaset(
'All', tmp1, n1, 0, alpha, alpha,
7281 $ a( iia+joffa*lda ), lda )
7295 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
7298 CALL pb_slaset( uplo, mbloc, nbloc, lcmt, alpha, beta,
7299 $ a( ioffd+1+joffa*lda ), lda )
7305 ioffd = ioffd + mbloc
7309 tmp1 = m1 - ioffd + iia - 1
7310 IF( lower .AND. tmp1.GT.0 )
7311 $
CALL pb_slaset(
'All', tmp1, nbloc, 0, alpha, alpha,
7312 $ a( ioffd+1+joffa*lda ), lda )
7314 tmp1 =
min( ioffa, iimax ) - iia + 1
7317 lcmt00 = lcmt00 + qnb
7319 joffa = joffa + nbloc
7321 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7322 $
CALL pb_slaset(
'All', tmp1, n1, 0, alpha, alpha,
7323 $ a( iia+joffa*lda ), lda )
7337 SUBROUTINE pslascal( TYPE, M, N, ALPHA, A, IA, JA, DESCA )
7346 INTEGER IA, JA, M, N
7472 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
7473 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
7475 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
7476 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
7477 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
7478 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
7482 LOGICAL GODOWN, GOLEFT, LOWER, UPPER
7483 INTEGER IACOL, IAROW, ICTXT, IIA, IIMAX, ILOW, IMB1,
7484 $ IMBLOC, INB1, INBLOC, IOFFA, IOFFD, ITYPE,
7485 $ IUPP, JJA, JJMAX, JOFFA, JOFFD, LCMT, LCMT00,
7486 $ LDA, LMBLOC, LNBLOC, LOW, M1, MB, MBLKD, MBLKS,
7487 $ MBLOC, MP, MRCOL, MRROW, MYCOL, MYROW, N1, NB,
7488 $ NBLKD, NBLKS, NBLOC, NPCOL, NPROW, NQ, PMB,
7492 INTEGER DESCA2( DLEN_ )
7501 EXTERNAL lsame, pb_numroc
7514 ictxt = desca2( ctxt_ )
7515 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
7519 IF( m.EQ.0 .OR. n.EQ.0 )
7522 IF( lsame(
TYPE,
'L' ) ) then
7528 ELSE IF( lsame(
TYPE,
'U' ) ) then
7534 ELSE IF( lsame(
TYPE,
'H' ) ) then
7550 IF( itype.EQ.0 )
THEN
7554 CALL pb_infog2l( ia, ja, desca2, nprow, npcol, myrow, mycol,
7555 $ iia, jja, iarow, iacol )
7556 mp = pb_numroc( m, ia, desca2( imb_ ), desca2( mb_ ), myrow,
7557 $ desca2( rsrc_ ), nprow )
7558 nq = pb_numroc( n, ja, desca2( inb_ ), desca2( nb_ ), mycol,
7559 $ desca2( csrc_ ), npcol )
7561 IF( mp.LE.0 .OR. nq.LE.0 )
7564 lda = desca2( lld_ )
7565 ioffa = iia + ( jja - 1 ) * lda
7567 CALL pb_slascal(
'All', mp, nq, 0, alpha, a( ioffa ), lda )
7573 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
7574 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
7575 $ iacol, mrrow, mrcol )
7577 IF( mp.LE.0 .OR. nq.LE.0 )
7585 lda = desca2( lld_ )
7587 CALL pb_binfo( ioffd, mp, nq, imb1, inb1, mb, nb, mrrow,
7588 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
7589 $ lmbloc, lnbloc, ilow, low, iupp, upp )
7598 IF( desca2( rsrc_ ).LT.0 )
THEN
7603 IF( desca2( csrc_ ).LT.0 )
THEN
7612 godown = ( lcmt00.GT.iupp )
7613 goleft = ( lcmt00.LT.ilow )
7615 IF( .NOT.godown .AND. .NOT.goleft )
THEN
7619 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
7620 godown = .NOT.goleft
7622 CALL pb_slascal( uplo, imbloc, inbloc, lcmt00, alpha,
7623 $ a( iia+joffa*lda ), lda )
7625 IF( upper .AND. nq.GT.inbloc )
7626 $
CALL pb_slascal(
'All', imbloc, nq-inbloc, 0, alpha,
7627 $ a( iia+(joffa+inbloc)*lda ), lda )
7631 IF( lower .AND. mp.GT.imbloc )
7632 $
CALL pb_slascal(
'All', mp-imbloc, inbloc, 0, alpha,
7633 $ a( iia+imbloc+joffa*lda ), lda )
7642 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7644 ioffa = ioffa + imbloc
7647 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7648 lcmt00 = lcmt00 - pmb
7654 tmp1 =
min( ioffa, iimax ) - iia + 1
7655 IF( upper .AND. tmp1.GT.0 )
THEN
7657 $ a( iia+joffa*lda ), lda )
7671 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
7674 CALL pb_slascal( uplo, mbloc, inbloc, lcmt, alpha,
7675 $ a( ioffd+1+joffa*lda ), lda )
7681 ioffd = ioffd + mbloc
7685 tmp1 = m1 - ioffd + iia - 1
7686 IF( lower .AND. tmp1.GT.0 )
7687 $
CALL pb_slascal(
'All', tmp1, inbloc, 0, alpha,
7688 $ a( ioffd+1+joffa*lda ), lda )
7690 tmp1 = ioffa - iia + 1
7693 lcmt00 = lcmt00 + low - ilow + qnb
7695 joffa = joffa + inbloc
7697 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7698 $
CALL pb_slascal(
'All', tmp1, n1, 0, alpha,
7699 $ a( iia+joffa*lda ), lda )
7704 ELSE IF( goleft )
THEN
7706 lcmt00 = lcmt00 + low - ilow + qnb
7708 joffa = joffa + inbloc
7711 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
7712 lcmt00 = lcmt00 + qnb
7718 tmp1 =
min( joffa, jjmax ) - jja + 1
7719 IF( lower .AND. tmp1.GT.0 )
THEN
7721 $ a( iia+(jja-1)*lda ), lda )
7735 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
7738 CALL pb_slascal( uplo, imbloc, nbloc, lcmt, alpha,
7739 $ a( iia+joffd*lda ), lda )
7745 joffd = joffd + nbloc
7749 tmp1 = n1 - joffd + jja - 1
7750 IF( upper .AND. tmp1.GT.0 )
7751 $
CALL pb_slascal(
'All', imbloc, tmp1, 0, alpha,
7752 $ a( iia+joffd*lda ), lda )
7754 tmp1 = joffa - jja + 1
7757 lcmt00 = lcmt00 - ( iupp - upp + pmb )
7759 ioffa = ioffa + imbloc
7761 IF( lower .AND. m1.GT.0 .AND. tmp1.GT.0 )
7762 $
CALL pb_slascal(
'All', m1, tmp1, 0, alpha,
7763 $ a( ioffa+1+(jja-1)*lda ), lda )
7772 IF( nblks.GT.0 )
THEN
7776 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
7777 lcmt00 = lcmt00 - pmb
7783 tmp1 =
min( ioffa, iimax ) - iia + 1
7784 IF( upper .AND. tmp1.GT.0 )
THEN
7786 $ a( iia+joffa*lda ), lda )
7800 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
7803 CALL pb_slascal( uplo, mbloc, nbloc, lcmt, alpha,
7804 $ a( ioffd+1+joffa*lda ), lda )
7810 ioffd = ioffd + mbloc
7814 tmp1 = m1 - ioffd + iia - 1
7815 IF( lower .AND. tmp1.GT.0 )
7816 $
CALL pb_slascal(
'All', tmp1, nbloc, 0, alpha,
7817 $ a( ioffd+1+joffa*lda ), lda )
7819 tmp1 =
min( ioffa, iimax ) - iia + 1
7822 lcmt00 = lcmt00 + qnb
7824 joffa = joffa + nbloc
7826 IF( upper .AND. tmp1.GT.0 .AND. n1.GT.0 )
7827 $
CALL pb_slascal(
'All', tmp1, n1, 0, alpha,
7828 $ a( iia+joffa*lda ), lda )
7844 SUBROUTINE pslagen( INPLACE, AFORM, DIAG, OFFA, M, N, IA, JA,
7845 $ DESCA, IASEED, A, LDA )
7854 CHARACTER*1 aform, diag
7855 INTEGER ia, iaseed, ja, lda, m, n, offa
8037 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8038 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8040 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8041 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8042 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8043 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8044 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
8045 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
8046 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
8047 PARAMETER ( JMP_1 = 1, jmp_row = 2, jmp_col = 3,
8048 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
8049 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
8050 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
8054 LOGICAL DIAGDO, SYMM, HERM, NOTRAN
8055 INTEGER CSRC, I, IACOL, IAROW, ICTXT, IIA, ILOCBLK,
8056 $ ILOCOFF, ILOW, IMB, IMB1, IMBLOC, IMBVIR, INB,
8057 $ inb1, inbloc, inbvir, info, ioffda, itmp, iupp,
8058 $ ivir, jja, jlocblk, jlocoff, jvir, lcmt00,
8059 $ lmbloc, lnbloc, low, maxmn, mb, mblks, mp,
8060 $ mrcol, mrrow, mycdist, mycol, myrdist, myrow,
8061 $ nb, nblks, npcol, nprow, nq, nvir, rsrc, upp
8065 INTEGER DESCA2( DLEN_ ), IMULADD( 4, JMP_LEN ),
8066 $ IRAN( 2 ), JMP( JMP_LEN ), MULADD0( 4 )
8080 INTRINSIC MAX, MIN, REAL
8083 DATA ( muladd0( i ), i = 1, 4 ) / 20077, 16838,
8094 ictxt = desca2( ctxt_ )
8095 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8100 IF( nprow.EQ.-1 )
THEN
8101 info = -( 1000 + ctxt_ )
8103 symm = lsame( aform,
'S' )
8104 herm = lsame( aform,
'H' )
8105 notran = lsame( aform,
'N' )
8106 diagdo = lsame( diag,
'D' )
8107 IF( .NOT.( symm.OR.herm.OR.notran ) .AND.
8108 $ .NOT.( lsame( aform,
'T' ) ) .AND.
8109 $ .NOT.( lsame( aform,
'C' ) ) )
THEN
8111 ELSE IF( ( .NOT.diagdo ) .AND.
8112 $ ( .NOT.lsame( diag,
'N' ) ) )
THEN
8115 CALL pb_chkmat( ictxt, m, 5, n, 6, ia, ja, desca2, 10, info )
8118 IF( info.NE.0 )
THEN
8119 CALL pxerbla( ictxt,
'PSLAGEN', -info )
8125 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
8132 imb = desca2( imb_ )
8133 inb = desca2( inb_ )
8134 rsrc = desca2( rsrc_ )
8135 csrc = desca2( csrc_ )
8139 CALL pb_ainfog2l( m, n, ia, ja, desca2, nprow, npcol, myrow,
8140 $ mycol, imb1, inb1, mp, nq, iia, jja, iarow,
8141 $ iacol, mrrow, mrcol )
8153 ioffda = ja + offa - ia
8154 CALL pb_binfo( ioffda, mp, nq, imb1, inb1, mb, nb, mrrow,
8155 $ mrcol, lcmt00, mblks, nblks, imbloc, inbloc,
8156 $ lmbloc, lnbloc, ilow, low, iupp, upp )
8164 itmp = max( 0, -offa )
8167 nvir = desca2( m_ ) + itmp
8169 CALL pb_locinfo( ivir, imbvir, mb, myrow, rsrc, nprow, ilocblk,
8170 $ ilocoff, myrdist )
8172 itmp = max( 0, offa )
8175 nvir = max( max( nvir, desca2( n_ ) + itmp ),
8176 $ desca2( m_ ) + desca2( n_ ) - 1 )
8178 CALL pb_locinfo( jvir, inbvir, nb, mycol, csrc, npcol, jlocblk,
8179 $ jlocoff, mycdist )
8181 IF( symm .OR. herm .OR. notran )
THEN
8183 CALL pb_initjmp( .true., nvir, imbvir, inbvir, imbloc, inbloc,
8184 $ mb, nb, rsrc, csrc, nprow, npcol, 1, jmp )
8192 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
8193 $ myrdist, mycdist, nprow, npcol, jmp,
8196 CALL pb_slagen(
'Lower', aform, a( iia, jja ), lda, lcmt00,
8197 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
8198 $ nb, lnbloc, jmp, imuladd )
8202 IF( symm .OR. herm .OR. ( .NOT. notran ) )
THEN
8204 CALL pb_initjmp( .false., nvir, imbvir, inbvir, imbloc, inbloc,
8205 $ mb, nb, rsrc, csrc, nprow, npcol, 1, jmp )
8213 CALL pb_setlocran( iaseed, ilocblk, jlocblk, ilocoff, jlocoff,
8214 $ myrdist, mycdist, nprow, npcol, jmp,
8217 CALL pb_slagen(
'Upper', aform, a( iia, jja ), lda, lcmt00,
8218 $ iran, mblks, imbloc, mb, lmbloc, nblks, inbloc,
8219 $ nb, lnbloc, jmp, imuladd )
8225 maxmn = max( desca2( m_ ), desca2( n_ ) )
8226 alpha = real( maxmn )
8228 IF( ioffda.GE.0 )
THEN
8229 CALL psladom( inplace, min( max( 0, m-ioffda ), n ), alpha,
8230 $ a, min( ia+ioffda, ia+m-1 ), ja, desca )
8232 CALL psladom( inplace, min( m, max( 0, n+ioffda ) ), alpha,
8233 $ a, ia, min( ja-ioffda, ja+n-1 ), desca )
8243 SUBROUTINE psladom( INPLACE, N, ALPHA, A, IA, JA, DESCA )
8371 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8372 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8374 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8375 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8376 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8377 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8380 LOGICAL GODOWN, GOLEFT
8381 INTEGER I, IACOL, IAROW, ICTXT, IIA, IJOFFA, ILOW,
8382 $ IMB1, IMBLOC, INB1, INBLOC, IOFFA, IOFFD, IUPP,
8383 $ JJA, JOFFA, JOFFD, LCMT, LCMT00, LDA, LDAP1,
8384 $ LMBLOC, LNBLOC, LOW, MB, MBLKD, MBLKS, MBLOC,
8385 $ MRCOL, MRROW, MYCOL, MYROW, NB, NBLKD, NBLKS,
8386 $ NBLOC, NP, NPCOL, NPROW, NQ, PMB, QNB, UPP
8390 INTEGER DESCA2( DLEN_ )
8407 ictxt = desca2( ctxt_ )
8408 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8413 CALL pb_ainfog2l( n, n, ia, ja, desca2, nprow, npcol, myrow,
8414 $ mycol, imb1, inb1, np, nq, iia, jja, iarow,
8415 $ iacol, mrrow, mrcol )
8430 CALL pb_binfo( 0, np, nq, imb1, inb1, mb, nb, mrrow, mrcol,
8431 $ lcmt00, mblks, nblks, imbloc, inbloc, lmbloc,
8432 $ lnbloc, ilow, low, iupp, upp )
8436 lda = desca2( lld_ )
8439 IF( desca2( rsrc_ ).LT.0 )
THEN
8444 IF( desca2( csrc_ ).LT.0 )
THEN
8453 godown = ( lcmt00.GT.iupp )
8454 goleft = ( lcmt00.LT.ilow )
8456 IF( .NOT.godown .AND. .NOT.goleft )
THEN
8460 IF( lcmt00.GE.0 )
THEN
8461 ijoffa = ioffa+lcmt00 + ( joffa - 1 ) * lda
8462 DO 10 i = 1,
min( inbloc,
max( 0, imbloc - lcmt00 ) )
8463 atmp = a( ijoffa + i*ldap1 )
8464 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8467 ijoffa = ioffa + ( joffa - lcmt00 - 1 ) * lda
8468 DO 20 i = 1,
min( imbloc,
max( 0, inbloc + lcmt00 ) )
8469 atmp = a( ijoffa + i*ldap1 )
8470 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8473 goleft = ( ( lcmt00 - ( iupp - upp + pmb ) ).LT.ilow )
8474 godown = .NOT.goleft
8480 lcmt00 = lcmt00 - ( iupp - upp + pmb )
8482 ioffa = ioffa + imbloc
8485 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
8486 lcmt00 = lcmt00 - pmb
8498 IF( mblkd.GT.0 .AND. lcmt.GE.ilow )
THEN
8501 IF( lcmt.GE.0 )
THEN
8502 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
8503 DO 50 i = 1,
min( inbloc,
max( 0, mbloc - lcmt ) )
8504 atmp = a( ijoffa + i*ldap1 )
8505 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8508 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
8509 DO 60 i = 1,
min( mbloc,
max( 0, inbloc + lcmt ) )
8510 atmp = a( ijoffa + i*ldap1 )
8511 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8519 ioffd = ioffd + mbloc
8523 lcmt00 = lcmt00 + low - ilow + qnb
8525 joffa = joffa + inbloc
8527 ELSE IF( goleft )
THEN
8529 lcmt00 = lcmt00 + low - ilow + qnb
8531 joffa = joffa + inbloc
8534 IF( nblks.GT.0 .AND. lcmt00.LT.low )
THEN
8535 lcmt00 = lcmt00 + qnb
8547 IF( nblkd.GT.0 .AND. lcmt.LE.iupp )
THEN
8550 IF( lcmt.GE.0 )
THEN
8551 ijoffa = ioffa + lcmt + ( joffd - 1 ) * lda
8552 DO 90 i = 1,
min( nbloc,
max( 0, imbloc - lcmt ) )
8553 atmp = a( ijoffa + i*ldap1 )
8554 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8557 ijoffa = ioffa + ( joffd - lcmt - 1 ) * lda
8558 DO 100 i = 1,
min( imbloc,
max( 0, nbloc + lcmt ) )
8559 atmp = a( ijoffa + i*ldap1 )
8560 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8568 joffd = joffd + nbloc
8572 lcmt00 = lcmt00 - ( iupp - upp + pmb )
8574 ioffa = ioffa + imbloc
8580 IF( nblks.GT.0 )
THEN
8584 IF( mblks.GT.0 .AND. lcmt00.GT.upp )
THEN
8585 lcmt00 = lcmt00 - pmb
8597 IF( mblkd.GT.0 .AND. lcmt.GE.low )
THEN
8600 IF( lcmt.GE.0 )
THEN
8601 ijoffa = ioffd + lcmt + ( joffa - 1 ) * lda
8602 DO 140 i = 1,
min( nbloc,
max( 0, mbloc - lcmt ) )
8603 atmp = a( ijoffa + i*ldap1 )
8604 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8607 ijoffa = ioffd + ( joffa - lcmt - 1 ) * lda
8608 DO 150 i = 1,
min( mbloc,
max( 0, nbloc + lcmt ) )
8609 atmp = a( ijoffa + i*ldap1 )
8610 a( ijoffa + i*ldap1 ) = abs( atmp ) + alpha
8618 ioffd = ioffd + mbloc
8622 lcmt00 = lcmt00 + qnb
8624 joffa = joffa + nbloc
8634 SUBROUTINE pb_pslaprnt( M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT,
8635 $ CMATNM, NOUT, WORK )
8643 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT
8646 CHARACTER*(*) CMATNM
8648 REAL A( * ), WORK( * )
8774 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8775 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8777 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
8778 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8779 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8780 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8783 INTEGER MYCOL, MYROW, NPCOL, NPROW, PCOL, PROW
8786 INTEGER DESCA2( DLEN_ )
8789 EXTERNAL BLACS_GRIDINFO, PB_DESCTRANS, PB_PSLAPRN2
8795 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
8800 CALL pb_desctrans( desca, desca2 )
8802 CALL blacs_gridinfo( desca2( ctxt_ ), nprow, npcol, myrow, mycol )
8804 IF( desca2( rsrc_ ).GE.0 )
THEN
8805 IF( desca2( csrc_ ).GE.0 )
THEN
8806 CALL pb_pslaprn2( m, n, a, ia, ja, desca2, irprnt, icprnt,
8807 $ cmatnm, nout, desca2( rsrc_ ),
8808 $ desca2( csrc_ ), work )
8810 DO 10 pcol = 0, npcol - 1
8811 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
8812 $
WRITE( nout, * )
'Colum-replicated array -- ' ,
8813 $
'copy in process column: ', pcol
8814 CALL pb_pslaprn2( m, n, a, ia, ja, desca2, irprnt,
8815 $ icprnt, cmatnm, nout, desca2( rsrc_ ),
8820 IF( desca2( csrc_ ).GE.0 )
THEN
8821 DO 20 prow = 0, nprow - 1
8822 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
8823 $
WRITE( nout, * )
'Row-replicated array -- ' ,
8824 $
'copy in process row: ', prow
8825 CALL pb_pslaprn2( m, n, a, ia, ja, desca2, irprnt,
8826 $ icprnt, cmatnm, nout, prow,
8827 $ desca2( csrc_ ), work )
8830 DO 40 prow = 0, nprow - 1
8831 DO 30 pcol = 0, npcol - 1
8832 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
8833 $
WRITE( nout, * )
'Replicated array -- ' ,
8834 $
'copy in process (', prow,
',', pcol,
')'
8835 CALL pb_pslaprn2( m, n, a, ia, ja, desca2, irprnt,
8836 $ icprnt, cmatnm, nout, prow, pcol,
8848 SUBROUTINE pb_pslaprn2( M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT,
8849 $ CMATNM, NOUT, PROW, PCOL, WORK )
8857 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT, PCOL, PROW
8860 CHARACTER*(*) CMATNM
8862 REAL A( * ), WORK( * )
8866 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
8867 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
8869 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
8870 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
8871 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
8872 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
8875 LOGICAL AISCOLREP, AISROWREP
8876 INTEGER H, I, IACOL, IAROW, IB, ICTXT, ICURCOL,
8877 $ ICURROW, II, IIA, IN, J, JB, JJ, JJA, JN, K,
8878 $ LDA, LDW, MYCOL, MYROW, NPCOL, NPROW
8881 EXTERNAL blacs_barrier, blacs_gridinfo,
pb_infog2l,
8891 ictxt = desca( ctxt_ )
8892 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
8893 CALL pb_infog2l( ia, ja, desca, nprow, npcol, myrow, mycol,
8894 $ iia, jja, iarow, iacol )
8897 IF( desca( rsrc_ ).LT.0 )
THEN
8905 IF( desca( csrc_ ).LT.0 )
THEN
8914 ldw =
max( desca( imb_ ), desca( mb_ ) )
8918 jb = desca( inb_ ) - ja + 1
8920 $ jb = ( (-jb) / desca( nb_ ) + 1 ) * desca( nb_ ) + jb
8924 ib = desca( imb_ ) - ia + 1
8926 $ ib = ( (-ib) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
8929 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
8930 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
8932 WRITE( nout, fmt = 9999 )
8933 $ cmatnm, ia+k, ja+h, a( ii+k+(jj+h-1)*lda )
8937 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
8938 CALL sgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ), lda,
8940 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
8941 CALL sgerv2d( ictxt, ib, 1, work, ldw, icurrow, icurcol )
8943 WRITE( nout, fmt = 9999 )
8944 $ cmatnm, ia+k-1, ja+h, work( k )
8948 IF( myrow.EQ.icurrow )
8950 IF( .NOT.aisrowrep )
8951 $ icurrow = mod( icurrow+1, nprow )
8952 CALL blacs_barrier( ictxt,
'All' )
8956 DO 50 i = in+1, ia+m-1, desca( mb_ )
8957 ib =
min( desca( mb_ ), ia+m-i )
8958 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
8959 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
8961 WRITE( nout, fmt = 9999 )
8962 $ cmatnm, i+k, ja+h, a( ii+k+(jj+h-1)*lda )
8966 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
8967 CALL sgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
8968 $ lda, irprnt, icprnt )
8969 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
8970 CALL sgerv2d( ictxt, ib, 1, work, ldw, icurrow,
8973 WRITE( nout, fmt = 9999 )
8974 $ cmatnm, i+k-1, ja+h, work( k )
8978 IF( myrow.EQ.icurrow )
8980 IF( .NOT.aisrowrep )
8981 $ icurrow = mod( icurrow+1, nprow )
8982 CALL blacs_barrier( ictxt,
'All' )
8989 IF( mycol.EQ.icurcol )
8991 IF( .NOT.aiscolrep )
8992 $ icurcol = mod( icurcol+1, npcol )
8993 CALL blacs_barrier( ictxt,
'All' )
8997 DO 130 j = jn+1, ja+n-1, desca( nb_ )
8998 jb =
min( desca( nb_ ), ja+n-j )
9000 ib = desca( imb_ )-ia+1
9002 $ ib = ( (-ib) / desca( mb_ ) + 1 ) * desca( mb_ ) + ib
9005 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9006 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9008 WRITE( nout, fmt = 9999 )
9009 $ cmatnm, ia+k, j+h, a( ii+k+(jj+h-1)*lda )
9013 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9014 CALL sgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9015 $ lda, irprnt, icprnt )
9016 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9017 CALL sgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9020 WRITE( nout, fmt = 9999 )
9021 $ cmatnm, ia+k-1, j+h, work( k )
9025 IF( myrow.EQ.icurrow )
9027 icurrow = mod( icurrow+1, nprow )
9028 CALL blacs_barrier( ictxt,
'All' )
9032 DO 110 i = in+1, ia+m-1, desca( mb_ )
9033 ib =
min( desca( mb_ ), ia+m-i )
9034 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
9035 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9037 WRITE( nout, fmt = 9999 )
9038 $ cmatnm, i+k, j+h, a( ii+k+(jj+h-1)*lda )
9042 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
9043 CALL sgesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
9044 $ lda, irprnt, icprnt )
9045 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
9046 CALL sgerv2d( ictxt, ib, 1, work, ldw, icurrow,
9049 WRITE( nout, fmt = 9999 )
9050 $ cmatnm, i+k-1, j+h, work( k )
9054 IF( myrow.EQ.icurrow )
9056 IF( .NOT.aisrowrep )
9057 $ icurrow = mod( icurrow+1, nprow )
9058 CALL blacs_barrier( ictxt,
'All' )
9065 IF( mycol.EQ.icurcol )
9067 IF( .NOT.aiscolrep )
9068 $ icurcol = mod( icurcol+1, npcol )
9069 CALL blacs_barrier( ictxt,
'All' )
9073 9999
FORMAT( 1x, a,
'(', i6,
',', i6,
')=', e16.8 )
9080 SUBROUTINE pb_sfillpad( ICTXT, M, N, A, LDA, IPRE, IPOST, CHKVAL )
9088 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9154 IF( IPRE.GT.0 ) THEN
9159 WRITE( *, fmt =
'(A)' )
9160 $
'WARNING no pre-guardzone in PB_SFILLPAD'
9165 IF( ipost.GT.0 )
THEN
9167 DO 20 i = j, j+ipost-1
9171 WRITE( *, fmt =
'(A)' )
9172 $
'WARNING no post-guardzone in PB_SFILLPAD'
9180 DO 30 i = k, k + ( lda - m ) - 1
9192 SUBROUTINE pb_schekpad( ICTXT, MESS, M, N, A, LDA, IPRE, IPOST,
9201 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9282 INTEGER I, IAM, IDUMM, INFO, J, K, MYCOL, MYROW, NPCOL,
9286 EXTERNAL BLACS_GRIDINFO, IGAMX2D, PB_TOPGET
9292 CALL BLACS_GRIDINFO( ICTXT, NPROW, NPCOL, MYROW, MYCOL )
9293 IAM = myrow*npcol + mycol
9298 IF( ipre.GT.0 )
THEN
9300 IF( a( i ).NE.chkval )
THEN
9301 WRITE( *, fmt = 9998 ) myrow, mycol, mess,
' pre', i,
9307 WRITE( *, fmt = * )
'WARNING no pre-guardzone in PB_SCHEKPAD'
9312 IF( ipost.GT.0 )
THEN
9314 DO 20 i = j, j+ipost-1
9315 IF( a( i ).NE.chkval )
THEN
9316 WRITE( *, fmt = 9998 ) myrow, mycol, mess,
'post',
9323 $
'WARNING no post-guardzone buffer in PB_SCHEKPAD'
9331 DO 30 i = k, k + (lda-m) - 1
9332 IF( a( i ).NE.chkval )
THEN
9333 WRITE( *, fmt = 9997 ) myrow, mycol, mess,
9334 $ i-ipre-lda*(j-1), j, a( i )
9342 CALL pb_topget( ictxt,
'Combine',
'All', top )
9343 CALL igamx2d( ictxt,
'All', top, 1, 1, info, 1, idumm, idumm, -1,
9345 IF( iam.EQ.0 .AND. info.GE.0 )
THEN
9346 WRITE( *, fmt = 9999 ) info / npcol, mod( info, npcol ), mess
9349 9999
FORMAT(
'{', i5,
',', i5,
'}: Memory overwrite in ', a )
9350 9998
FORMAT(
'{', i5,
',', i5,
'}: ', a,
' memory overwrite in ',
9351 $ a4,
'-guardzone: loc(', i3,
') = ', g11.4 )
9352 9997
FORMAT(
'{', i5,
',', i5,
'}: ', a,
' memory overwrite in ',
9353 $
'lda-m gap: loc(', i3,
',', i3,
') = ', g11.4 )
9360 SUBROUTINE pb_slaset( UPLO, M, N, IOFFD, ALPHA, BETA, A, LDA )
9369 INTEGER IOFFD, LDA, M, N
9470 INTEGER I, J, JTMP, MN
9483 IF( M.LE.0 .OR. N.LE.0 )
9488 IF( LSAME( UPLO,
'L' ) ) THEN
9493 mn = max( 0, -ioffd )
9494 DO 20 j = 1, min( mn, n )
9499 DO 40 j = mn + 1, min( m - ioffd, n )
9502 DO 30 i = jtmp + 1, m
9507 ELSE IF( lsame( uplo,
'U' ) )
THEN
9512 mn = min( m - ioffd, n )
9513 DO 60 j = max( 0, -ioffd ) + 1, mn
9515 DO 50 i = 1, jtmp - 1
9520 DO 80 j = max( 0, mn ) + 1, n
9526 ELSE IF( lsame( uplo,
'D' ) )
THEN
9530 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9531 a( j + ioffd, j ) = beta
9544 IF( alpha.NE.beta .AND. ioffd.LT.m .AND. ioffd.GT.-n )
THEN
9545 DO 120 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9546 a( j + ioffd, j ) = beta
9557 SUBROUTINE pb_slascal( UPLO, M, N, IOFFD, ALPHA, A, LDA )
9566 INTEGER IOFFD, LDA, M, N
9660 INTEGER I, J, JTMP, MN
9673 IF( M.LE.0 .OR. N.LE.0 )
9678 IF( LSAME( UPLO,
'L' ) ) THEN
9682 MN = max( 0, -ioffd )
9683 DO 20 j = 1, min( mn, n )
9685 a( i, j ) = alpha * a( i, j )
9688 DO 40 j = mn + 1, min( m - ioffd, n )
9689 DO 30 i = j + ioffd, m
9690 a( i, j ) = alpha * a( i, j )
9694 ELSE IF( lsame( uplo,
'U' ) )
THEN
9698 mn = min( m - ioffd, n )
9699 DO 60 j = max( 0, -ioffd ) + 1, mn
9700 DO 50 i = 1, j + ioffd
9701 a( i, j ) = alpha * a( i, j )
9704 DO 80 j = max( 0, mn ) + 1, n
9706 a( i, j ) = alpha * a( i, j )
9710 ELSE IF( lsame( uplo,
'D' ) )
THEN
9714 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9716 a( jtmp, j ) = alpha * a( jtmp, j )
9725 a( i, j ) = alpha * a( i, j )
9736 SUBROUTINE pb_slagen( UPLO, AFORM, A, LDA, LCMT00, IRAN, MBLKS,
9737 $ IMBLOC, MB, LMBLOC, NBLKS, INBLOC, NB,
9738 $ LNBLOC, JMP, IMULADD )
9746 CHARACTER*1 UPLO, AFORM
9747 INTEGER IMBLOC, INBLOC, LCMT00, LDA, LMBLOC, LNBLOC,
9748 $ mb, mblks, nb, nblks
9751 INTEGER IMULADD( 4, * ), IRAN( * ), JMP( * )
9855 INTEGER JMP_1, JMP_COL, JMP_IMBV, JMP_INBV, JMP_LEN,
9856 $ JMP_MB, JMP_NB, JMP_NPIMBLOC, JMP_NPMB,
9857 $ JMP_NQINBLOC, JMP_NQNB, JMP_ROW
9858 PARAMETER ( JMP_1 = 1, jmp_row = 2, jmp_col = 3,
9859 $ jmp_mb = 4, jmp_imbv = 5, jmp_npmb = 6,
9860 $ jmp_npimbloc = 7, jmp_nb = 8, jmp_inbv = 9,
9861 $ jmp_nqnb = 10, jmp_nqinbloc = 11,
9865 INTEGER I, IB, IBLK, II, IK, ITMP, JB, JBLK, JJ, JK,
9866 $ JTMP, LCMTC, LCMTR, LOW, MNB, UPP
9870 INTEGER IB0( 2 ), IB1( 2 ), IB2( 2 ), IB3( 2 )
9878 EXTERNAL LSAME, PB_SRAND
9886 ib1( i ) = iran( i )
9887 ib2( i ) = iran( i )
9888 ib3( i ) = iran( i )
9891 IF( lsame( aform,
'N' ) )
THEN
9897 DO 50 jblk = 1, nblks
9899 IF( jblk.EQ.1 )
THEN
9901 ELSE IF( jblk.EQ.nblks )
THEN
9907 DO 40 jk = jj, jj + jb - 1
9911 DO 30 iblk = 1, mblks
9913 IF( iblk.EQ.1 )
THEN
9915 ELSE IF( iblk.EQ.mblks )
THEN
9923 DO 20 ik = ii, ii + ib - 1
9924 a( ik, jk ) = pb_srand( 0 )
9929 IF( iblk.EQ.1 )
THEN
9933 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
9940 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1, ib0 )
9951 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
9962 IF( jblk.EQ.1 )
THEN
9966 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
9972 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
9985 ELSE IF( lsame( aform,
'T' ) .OR. lsame( aform,
'C' ) )
THEN
9992 DO 90 iblk = 1, mblks
9994 IF( iblk.EQ.1 )
THEN
9996 ELSE IF( iblk.EQ.mblks )
THEN
10002 DO 80 ik = ii, ii + ib - 1
10006 DO 70 jblk = 1, nblks
10008 IF( jblk.EQ.1 )
THEN
10010 ELSE IF( jblk.EQ.nblks )
THEN
10018 DO 60 jk = jj, jj + jb - 1
10019 a( ik, jk ) = pb_srand( 0 )
10024 IF( jblk.EQ.1 )
THEN
10028 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
10035 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1, ib0 )
10039 ib1( 1 ) = ib0( 1 )
10040 ib1( 2 ) = ib0( 2 )
10046 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
10048 ib1( 1 ) = ib0( 1 )
10049 ib1( 2 ) = ib0( 2 )
10050 ib2( 1 ) = ib0( 1 )
10051 ib2( 2 ) = ib0( 2 )
10057 IF( iblk.EQ.1 )
THEN
10061 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
10067 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
10071 ib1( 1 ) = ib0( 1 )
10072 ib1( 2 ) = ib0( 2 )
10073 ib2( 1 ) = ib0( 1 )
10074 ib2( 2 ) = ib0( 2 )
10075 ib3( 1 ) = ib0( 1 )
10076 ib3( 2 ) = ib0( 2 )
10080 ELSE IF( ( lsame( aform,
'S' ) ).OR.( lsame( aform,
'H' ) ) )
THEN
10084 IF( lsame( uplo,
'L' ) )
THEN
10091 DO 170 jblk = 1, nblks
10093 IF( jblk.EQ.1 )
THEN
10096 ELSE IF( jblk.EQ.nblks )
THEN
10104 DO 160 jk = jj, jj + jb - 1
10109 DO 150 iblk = 1, mblks
10111 IF( iblk.EQ.1 )
THEN
10114 ELSE IF( iblk.EQ.mblks )
THEN
10124 IF( lcmtr.GT.upp )
THEN
10126 DO 100 ik = ii, ii + ib - 1
10127 dummy = pb_srand( 0 )
10130 ELSE IF( lcmtr.GE.low )
THEN
10133 mnb =
max( 0, -lcmtr )
10135 IF( jtmp.LE.
min( mnb, jb ) )
THEN
10137 DO 110 ik = ii, ii + ib - 1
10138 a( ik, jk ) = pb_srand( 0 )
10141 ELSE IF( ( jtmp.GE.( mnb + 1 ) ) .AND.
10142 $ ( jtmp.LE.
min( ib-lcmtr, jb ) ) )
THEN
10144 itmp = ii + jtmp + lcmtr - 1
10146 DO 120 ik = ii, itmp - 1
10147 dummy = pb_srand( 0 )
10150 DO 130 ik = itmp, ii + ib - 1
10151 a( ik, jk ) = pb_srand( 0 )
10158 DO 140 ik = ii, ii + ib - 1
10159 a( ik, jk ) = pb_srand( 0 )
10166 IF( iblk.EQ.1 )
THEN
10170 lcmtr = lcmtr - jmp( jmp_npimbloc )
10171 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib1,
10178 lcmtr = lcmtr - jmp( jmp_npmb )
10179 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib1,
10184 ib1( 1 ) = ib0( 1 )
10185 ib1( 2 ) = ib0( 2 )
10191 CALL pb_jumpit( imuladd( 1, jmp_col ), ib2, ib0 )
10193 ib1( 1 ) = ib0( 1 )
10194 ib1( 2 ) = ib0( 2 )
10195 ib2( 1 ) = ib0( 1 )
10196 ib2( 2 ) = ib0( 2 )
10202 IF( jblk.EQ.1 )
THEN
10206 lcmtc = lcmtc + jmp( jmp_nqinbloc )
10207 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib3, ib0 )
10213 lcmtc = lcmtc + jmp( jmp_nqnb )
10214 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib3, ib0 )
10218 ib1( 1 ) = ib0( 1 )
10219 ib1( 2 ) = ib0( 2 )
10220 ib2( 1 ) = ib0( 1 )
10221 ib2( 2 ) = ib0( 2 )
10222 ib3( 1 ) = ib0( 1 )
10223 ib3( 2 ) = ib0( 2 )
10234 DO 250 iblk = 1, mblks
10236 IF( iblk.EQ.1 )
THEN
10239 ELSE IF( iblk.EQ.mblks )
THEN
10247 DO 240 ik = ii, ii + ib - 1
10252 DO 230 jblk = 1, nblks
10254 IF( jblk.EQ.1 )
THEN
10257 ELSE IF( jblk.EQ.nblks )
THEN
10267 IF( lcmtc.LT.low )
THEN
10269 DO 180 jk = jj, jj + jb - 1
10270 dummy = pb_srand( 0 )
10273 ELSE IF( lcmtc.LE.upp )
THEN
10276 mnb =
max( 0, lcmtc )
10278 IF( itmp.LE.
min( mnb, ib ) )
THEN
10280 DO 190 jk = jj, jj + jb - 1
10281 a( ik, jk ) = pb_srand( 0 )
10284 ELSE IF( ( itmp.GE.( mnb + 1 ) ) .AND.
10285 $ ( itmp.LE.
min( jb+lcmtc, ib ) ) )
THEN
10287 jtmp = jj + itmp - lcmtc - 1
10289 DO 200 jk = jj, jtmp - 1
10290 dummy = pb_srand( 0 )
10293 DO 210 jk = jtmp, jj + jb - 1
10294 a( ik, jk ) = pb_srand( 0 )
10301 DO 220 jk = jj, jj + jb - 1
10302 a( ik, jk ) = pb_srand( 0 )
10309 IF( jblk.EQ.1 )
THEN
10313 lcmtc = lcmtc + jmp( jmp_nqinbloc )
10314 CALL pb_jumpit( imuladd( 1, jmp_nqinbloc ), ib1,
10321 lcmtc = lcmtc + jmp( jmp_nqnb )
10322 CALL pb_jumpit( imuladd( 1, jmp_nqnb ), ib1,
10327 ib1( 1 ) = ib0( 1 )
10328 ib1( 2 ) = ib0( 2 )
10334 CALL pb_jumpit( imuladd( 1, jmp_row ), ib2, ib0 )
10336 ib1( 1 ) = ib0( 1 )
10337 ib1( 2 ) = ib0( 2 )
10338 ib2( 1 ) = ib0( 1 )
10339 ib2( 2 ) = ib0( 2 )
10345 IF( iblk.EQ.1 )
THEN
10349 lcmtr = lcmtr - jmp( jmp_npimbloc )
10350 CALL pb_jumpit( imuladd( 1, jmp_npimbloc ), ib3, ib0 )
10356 lcmtr = lcmtr - jmp( jmp_npmb )
10357 CALL pb_jumpit( imuladd( 1, jmp_npmb ), ib3, ib0 )
10361 ib1( 1 ) = ib0( 1 )
10362 ib1( 2 ) = ib0( 2 )
10363 ib2( 1 ) = ib0( 1 )
10364 ib2( 2 ) = ib0( 2 )
10365 ib3( 1 ) = ib0( 1 )
10366 ib3( 2 ) = ib0( 2 )
10379 REAL FUNCTION PB_SRAND( IDUMM )
10426 PARAMETER ( one = 1.0e+0, two = 2.0e+0 )
10434 pb_srand = one - two *
pb_sran( idumm )
10441 REAL function
pb_sran( idumm )
10487 PARAMETER ( divfac = 2.147483648e+9,
10488 $ pow16 = 6.5536e+4 )
10500 INTEGER iacs( 4 ), irand( 2 )
10501 common /rancom/ irand, iacs
10508 pb_sran = ( real( irand( 1 ) ) + pow16 * real( irand( 2 ) ) ) /
10511 CALL pb_lmul( irand, iacs, j )
10512 CALL pb_ladd( j, iacs( 3 ), irand )