4 CHARACTER*7 SNAMES( NSUBS )
6 DATA snames/
'PSSWAP ',
'PSSCAL ',
'PSCOPY ',
7 $
'PSAXPY ',
'PSDOT ',
'PSNRM2 ',
8 $
'PSASUM ',
'PSAMAX '/
103 INTEGER maxtests, maxgrids, gapmul, realsz, totmem,
106 parameter( maxtests = 20, maxgrids = 20, gapmul = 10,
107 $ realsz = 4, totmem = 2000000,
108 $ memsiz = totmem / realsz, zero = 0.0e+0,
109 $ padval = -9923.0e+0, nsubs = 8 )
110 INTEGER block_cyclic_2d_inb, csrc_, ctxt_, dlen_,
111 $ dtype_, imb_, inb_, lld_, mb_, m_, nb_, n_,
113 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
114 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
115 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
116 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
119 LOGICAL errflg, sof, tee
120 INTEGER csrcx, csrcy, i, iam, ictxt, igap, imbx, imby,
121 $ imidx, imidy, inbx, inby, incx, incy, ipmatx,
122 $ ipmaty, ipostx, iposty, iprex, iprey, ipw, ipx,
123 $ ipy, iverb, ix, ixseed, iy, iyseed, j, jx, jy,
124 $ k, ldx, ldy, mbx, mby, memreqd, mpx, mpy, mx,
125 $ my, mycol, myrow, n, nbx, nby, ngrids, nout,
126 $ npcol, nprocs, nprow, nqx, nqy, ntests, nx, ny,
127 $ pisclr, rsrcx, rsrcy, tskip, tstcnt
128 REAL alpha, psclr, pusclr
132 LOGICAL ltest( nsubs ), ycheck( nsubs )
133 INTEGER cscxval( maxtests ), cscyval( maxtests ),
134 $ descx( dlen_ ), descxr( dlen_ ),
135 $ descy( dlen_ ), descyr( dlen_ ), ierr( 4 ),
136 $ imbxval( maxtests ), imbyval( maxtests ),
137 $ inbxval( maxtests ), inbyval( maxtests ),
138 $ incxval( maxtests ), incyval( maxtests ),
139 $ ixval( maxtests ), iyval( maxtests ),
140 $ jxval( maxtests ), jyval( maxtests ),
141 $ kfail( nsubs ), kpass( nsubs ), kskip( nsubs ),
142 $ ktests( nsubs ), mbxval( maxtests ),
143 $ mbyval( maxtests ), mxval( maxtests ),
144 $ myval( maxtests ), nbxval( maxtests ),
145 $ nbyval( maxtests ), nval( maxtests ),
146 $ nxval( maxtests ), nyval( maxtests ),
147 $ pval( maxtests ), qval( maxtests ),
148 $ rscxval( maxtests ), rscyval( maxtests )
152 EXTERNAL blacs_exit, blacs_get, blacs_gridexit,
153 $ blacs_gridinfo, blacs_gridinit, blacs_pinfo,
162 INTRINSIC abs,
max, mod
165 CHARACTER*7 snames( nsubs )
168 COMMON /snamec/snames
169 COMMON /infoc/info, nblog
170 COMMON /pberrorc/nout, abrtflg
173 DATA ycheck/.true., .false., .true., .true., .true.,
174 $ .false., .false., .false./
209 CALL blacs_pinfo( iam, nprocs )
210 CALL psbla1tstinfo( outfile, nout, ntests, nval, mxval, nxval,
211 $ imbxval, mbxval, inbxval, nbxval, rscxval,
212 $ cscxval, ixval, jxval, incxval, myval,
213 $ nyval, imbyval, mbyval, inbyval, nbyval,
214 $ rscyval, cscyval, iyval, jyval, incyval,
215 $ maxtests, ngrids, pval, maxgrids, qval,
216 $ maxgrids, ltest, sof, tee, iam, igap, iverb,
217 $ nprocs, alpha, mem )
220 WRITE( nout, fmt = 9979 )
221 WRITE( nout, fmt = * )
239 IF( nprow.LT.1 )
THEN
241 $
WRITE( nout, fmt = 9999 )
'GRID SIZE',
'NPROW', nprow
243 ELSE IF( npcol.LT.1 )
THEN
245 $
WRITE( nout, fmt = 9999 )
'GRID SIZE',
'NPCOL', npcol
247 ELSE IF( nprow*npcol.GT.nprocs )
THEN
249 $
WRITE( nout, fmt = 9998 ) nprow*npcol, nprocs
253 IF( ierr( 1 ).GT.0 )
THEN
255 $
WRITE( nout, fmt = 9997 )
'GRID'
262 CALL blacs_get( -1, 0, ictxt )
263 CALL blacs_gridinit( ictxt,
'Row-major', nprow, npcol )
264 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
269 IF( myrow.GE.nprow .OR. mycol.GE.npcol )
304 WRITE( nout, fmt = * )
305 WRITE( nout, fmt = 9996 ) tstcnt, nprow, npcol
306 WRITE( nout, fmt = * )
308 WRITE( nout, fmt = 9995 )
309 WRITE( nout, fmt = 9994 )
310 WRITE( nout, fmt = 9995 )
311 WRITE( nout, fmt = 9993 ) n, ix, jx, mx, nx, imbx, inbx,
312 $ mbx, nbx, rsrcx, csrcx, incx
314 WRITE( nout, fmt = 9995 )
315 WRITE( nout, fmt = 9992 )
316 WRITE( nout, fmt = 9995 )
317 WRITE( nout, fmt = 9993 ) n, iy, jy, my, ny, imby, inby,
318 $ mby, nby, rsrcy, csrcy, incy
319 WRITE( nout, fmt = 9995 )
325 $ block_cyclic_2d_inb, mx, nx, imbx, inbx,
326 $ mbx, nbx, rsrcx, csrcx, incx, mpx, nqx,
327 $ iprex, imidx, ipostx, igap, gapmul,
330 $ block_cyclic_2d_inb, my, ny, imby, inby,
331 $ mby, nby, rsrcy, csrcy, incy, mpy, nqy,
332 $ iprey, imidy, iposty, igap, gapmul,
335 IF( ierr( 1 ).GT.0 .OR. ierr( 2 ).GT.0 )
THEN
347 ipy = ipx + descx( lld_ ) * nqx + ipostx + iprey
348 ipmatx = ipy + descy( lld_ ) * nqy + iposty
349 ipmaty = ipmatx + mx * nx
350 ipw = ipmaty + my * ny
358 $
max(
max( imbx, mbx ),
max( imby, mby ) )
360 IF( memreqd.GT.memsiz )
THEN
362 $
WRITE( nout, fmt = 9990 ) memreqd*realsz
368 CALL igsum2d( ictxt,
'All',
' ', 1, 1, ierr, 1, -1, 0 )
370 IF( ierr( 1 ).GT.0 )
THEN
372 $
WRITE( nout, fmt = 9991 )
383 IF( .NOT.ltest( k ) )
387 WRITE( nout, fmt = * )
388 WRITE( nout, fmt = 9989 ) snames( k )
393 CALL pvdimchk( ictxt, nout, n,
'X', ix, jx, descx, incx,
395 CALL pvdimchk( ictxt, nout, n,
'Y', iy, jy, descy, incy,
398 IF( ierr( 1 ).NE.0 .OR. ierr( 2 ).NE.0 )
THEN
399 kskip( k ) = kskip( k ) + 1
405 CALL pslagen( .false.,
'None',
'No diag', 0, mx, nx, 1,
406 $ 1, descx, ixseed, mem( ipx ),
409 $
CALL pslagen( .false.,
'None',
'No diag', 0, my, ny,
410 $ 1, 1, descy, iyseed, mem( ipy ),
415 CALL pb_descset2( descxr, mx, nx, imbx, inbx, mbx, nbx,
416 $ -1, -1, ictxt,
max( 1, mx ) )
417 CALL pslagen( .false.,
'None',
'No diag', 0, mx, nx, 1,
418 $ 1, descxr, ixseed, mem( ipmatx ),
420 IF( ycheck( k ) )
THEN
422 $ nby, -1, -1, ictxt,
max( 1, my ) )
423 CALL pslagen( .false.,
'None',
'No diag', 0, my, ny,
424 $ 1, 1, descyr, iyseed, mem( ipmaty ),
430 CALL pb_sfillpad( ictxt, mpx, nqx, mem( ipx-iprex ),
431 $ descx( lld_ ), iprex, ipostx, padval )
433 IF( ycheck( k ) )
THEN
434 CALL pb_sfillpad( ictxt, mpy, nqy, mem( ipy-iprey ),
435 $ descy( lld_ ), iprey, iposty,
442 CALL pschkarg1( ictxt, nout, snames( k ), n, alpha, ix,
443 $ jx, descx, incx, iy, jy, descy, incy,
453 IF( iverb.EQ.2 )
THEN
454 IF( incx.EQ.descx( m_ ) )
THEN
456 $ 0, 0,
'PARALLEL_INITIAL_X', nout,
460 $ 0, 0,
'PARALLEL_INITIAL_X', nout,
463 IF( ycheck( k ) )
THEN
464 IF( incy.EQ.descy( m_ ) )
THEN
467 $
'PARALLEL_INITIAL_Y', nout,
472 $
'PARALLEL_INITIAL_Y', nout,
476 ELSE IF( iverb.GE.3 )
THEN
477 CALL pb_pslaprnt( mx, nx, mem( ipx ), 1, 1, descx, 0,
478 $ 0,
'PARALLEL_INITIAL_X', nout,
481 $
CALL pb_pslaprnt( my, ny, mem( ipy ), 1, 1, descy,
482 $ 0, 0,
'PARALLEL_INITIAL_Y', nout,
492 CALL psswap( n, mem( ipx ), ix, jx, descx, incx,
493 $ mem( ipy ), iy, jy, descy, incy )
495 ELSE IF( k.EQ.2 )
THEN
500 CALL psscal( n, alpha, mem( ipx ), ix, jx, descx,
503 ELSE IF( k.EQ.3 )
THEN
507 CALL pscopy( n, mem( ipx ), ix, jx, descx, incx,
508 $ mem( ipy ), iy, jy, descy, incy )
510 ELSE IF( k.EQ.4 )
THEN
515 CALL psaxpy( n, alpha, mem( ipx ), ix, jx, descx,
516 $ incx, mem( ipy ), iy, jy, descy, incy )
518 ELSE IF( k.EQ.5 )
THEN
522 CALL psdot( n, psclr, mem( ipx ), ix, jx, descx, incx,
523 $ mem( ipy ), iy, jy, descy, incy )
525 ELSE IF( k.EQ.6 )
THEN
529 CALL psnrm2( n, pusclr, mem( ipx ), ix, jx, descx,
532 ELSE IF( k.EQ.7 )
THEN
536 CALL psasum( n, pusclr, mem( ipx ), ix, jx, descx,
539 ELSE IF( k.EQ.8 )
THEN
541 CALL psamax( n, psclr, pisclr, mem( ipx ), ix, jx,
549 kskip( k ) = kskip( k ) + 1
551 $
WRITE( nout, fmt = 9978 ) info
558 $ pisclr, mem( ipmatx ), mem( ipx ),
559 $ ix, jx, descx, incx, mem( ipmaty ),
560 $ mem( ipy ), iy, jy, descy, incy,
562 IF( mod( info, 2 ).EQ.1 )
THEN
564 ELSE IF( mod( info / 2, 2 ).EQ.1 )
THEN
566 ELSE IF( info.NE.0 )
THEN
574 $ mem( ipx-iprex ), descx( lld_ ),
575 $ iprex, ipostx, padval )
576 IF( ycheck( k ) )
THEN
578 $ mem( ipy-iprey ), descy( lld_ ),
579 $ iprey, iposty, padval )
585 CALL pschkarg1( ictxt, nout, snames( k ), n, alpha, ix,
586 $ jx, descx, incx, iy, jy, descy, incy,
591 CALL pschkvout( n, mem( ipmatx ), mem( ipx ), ix, jx,
592 $ descx, incx, ierr( 3 ) )
594 IF( ierr( 3 ).NE.0 )
THEN
596 $
WRITE( nout, fmt = 9986 )
'PARALLEL_X', snames( k )
599 IF( ycheck( k ) )
THEN
600 CALL pschkvout( n, mem( ipmaty ), mem( ipy ), iy, jy,
601 $ descy, incy, ierr( 4 ) )
602 IF( ierr( 4 ).NE.0 )
THEN
604 $
WRITE( nout, fmt = 9986 )
'PARALLEL_Y',
611 IF( info.NE.0 .OR. ierr( 1 ).NE.0 .OR.
612 $ ierr( 2 ).NE.0 .OR. ierr( 3 ).NE.0 .OR.
613 $ ierr( 4 ).NE. 0 )
THEN
615 $
WRITE( nout, fmt = 9988 ) snames( k )
616 kfail( k ) = kfail( k ) + 1
620 $
WRITE( nout, fmt = 9987 ) snames( k )
621 kpass( k ) = kpass( k ) + 1
626 IF( iverb.GE.1 .AND. errflg )
THEN
627 IF( ierr( 3 ).NE.0 .OR. iverb.GE.3 )
THEN
628 CALL psmprnt( ictxt, nout, mx, nx, mem( ipmatx ),
629 $ ldx, 0, 0,
'SERIAL_X' )
631 $ 0, 0,
'PARALLEL_X', nout,
633 ELSE IF( ierr( 1 ).NE.0 )
THEN
635 $
CALL psvprnt( ictxt, nout, n,
636 $ mem( ipmatx+ix-1+(jx-1)*ldx ),
637 $ incx, 0, 0,
'SERIAL_X' )
638 IF( incx.EQ.descx( m_ ) )
THEN
640 $ descx, 0, 0,
'PARALLEL_X',
641 $ nout, mem( ipmatx ) )
644 $ descx, 0, 0,
'PARALLEL_X',
645 $ nout, mem( ipmatx ) )
648 IF( ycheck( k ) )
THEN
649 IF( ierr( 4 ).NE.0 .OR. iverb.GE.3 )
THEN
650 CALL psmprnt( ictxt, nout, my, ny,
651 $ mem( ipmaty ), ldy, 0, 0,
654 $ descy, 0, 0,
'PARALLEL_Y',
655 $ nout, mem( ipmatx ) )
656 ELSE IF( ierr( 2 ).NE.0 )
THEN
658 $
CALL psvprnt( ictxt, nout, n,
659 $ mem( ipmaty+iy-1+(jy-1)*ldy ),
660 $ incy, 0, 0,
'SERIAL_Y' )
661 IF( incy.EQ.descy( m_ ) )
THEN
663 $ descy, 0, 0,
'PARALLEL_Y',
664 $ nout, mem( ipmatx ) )
667 $ descy, 0, 0,
'PARALLEL_Y',
668 $ nout, mem( ipmatx ) )
681 40
IF( iam.EQ.0 )
THEN
682 WRITE( nout, fmt = * )
683 WRITE( nout, fmt = 9985 ) j
688 CALL blacs_gridexit( ictxt )
699 IF( ltest( i ) )
THEN
700 kskip( i ) = kskip( i ) + tskip
701 ktests( i ) = kskip( i ) + kfail( i ) + kpass( i )
708 WRITE( nout, fmt = * )
709 WRITE( nout, fmt = 9981 )
710 WRITE( nout, fmt = * )
711 WRITE( nout, fmt = 9983 )
712 WRITE( nout, fmt = 9982 )
715 WRITE( nout, fmt = 9984 )
'|', snames( i ), ktests( i ),
716 $ kpass( i ), kfail( i ), kskip( i )
718 WRITE( nout, fmt = * )
719 WRITE( nout, fmt = 9980 )
720 WRITE( nout, fmt = * )
726 9999
FORMAT(
'ILLEGAL ', a,
': ', a,
' = ', i10,
727 $
' should be at least 1' )
728 9998
FORMAT(
'ILLEGAL GRID: NPROW*NPCOL = ', i4,
729 $
'. It can be at most', i4 )
730 9997
FORMAT(
'Bad ', a,
' parameters: going on to next test case.' )
731 9996
FORMAT( 2x,
'Test number ', i4 ,
' started on a ', i6,
' x ',
732 $ i6,
' process grid.' )
733 9995
FORMAT( 2x,
'---------------------------------------------------',
734 $
'--------------------------' )
735 9994
FORMAT( 2x,
' N IX JX MX NX IMBX INBX',
736 $
' MBX NBX RSRCX CSRCX INCX' )
737 9993
FORMAT( 2x,i6,1x,i6,1x,i6,1x,i6,1x,i6,1x,i5,1x,i5,1x,i5,1x,i5,1x,
739 9992
FORMAT( 2x,
' N IY JY MY NY IMBY INBY',
740 $
' MBY NBY RSRCY CSRCY INCY' )
741 9991
FORMAT(
'Not enough memory for this test: going on to',
742 $
' next test case.' )
743 9990
FORMAT(
'Not enough memory. Need: ', i12 )
744 9989
FORMAT( 2x,
' Tested Subroutine: ', a )
745 9988
FORMAT( 2x,
' ***** Computational check: ', a,
' ',
746 $
' FAILED ',
' *****' )
747 9987
FORMAT( 2x,
' ***** Computational check: ', a,
' ',
748 $
' PASSED ',
' *****' )
749 9986
FORMAT( 2x,
' ***** ERROR ***** Matrix operand ', a,
750 $
' modified by ', a,
' *****' )
751 9985
FORMAT( 2x,
'Test number ', i4,
' completed.' )
752 9984
FORMAT( 2x,a1,2x,a7,8x,i4,6x,i4,5x,i4,4x,i4 )
753 9983
FORMAT( 2x,
' SUBROUTINE TOTAL TESTS PASSED FAILED ',
755 9982
FORMAT( 2x,
' ---------- ----------- ------ ------ ',
757 9981
FORMAT( 2x,
'Testing Summary')
758 9980
FORMAT( 2x,
'End of Tests.' )
759 9979
FORMAT( 2x,
'Tests started.' )
760 9978
FORMAT( 2x,
' ***** Operation not supported, error code: ',
769 $ NXVAL, IMBXVAL, MBXVAL, INBXVAL,
770 $ NBXVAL, RSCXVAL, CSCXVAL, IXVAL,
771 $ JXVAL, INCXVAL, MYVAL, NYVAL, IMBYVAL,
772 $ MBYVAL, INBYVAL, NBYVAL, RSCYVAL,
773 $ CSCYVAL, IYVAL, JYVAL, INCYVAL,
774 $ LDVAL, NGRIDS, PVAL, LDPVAL, QVAL,
775 $ LDQVAL, LTEST, SOF, TEE, IAM, IGAP,
776 $ IVERB, NPROCS, ALPHA, WORK )
785 INTEGER IAM, IGAP, IVERB, LDPVAL, LDQVAL, LDVAL,
786 $ NGRIDS, NMAT, NOUT, NPROCS
790 CHARACTER*( * ) SUMMRY
792 INTEGER CSCXVAL( LDVAL ), CSCYVAL( LDVAL ),
793 $ imbxval( ldval ), imbyval( ldval ),
794 $ inbxval( ldval ), inbyval( ldval ),
795 $ incxval( ldval ), incyval( ldval ),
796 $ ixval( ldval ), iyval( ldval ), jxval( ldval ),
797 $ jyval( ldval ), mbxval( ldval ),
798 $ mbyval( ldval ), mxval( ldval ),
799 $ myval( ldval ), nbxval( ldval ),
800 $ nbyval( ldval ), nval( ldval ), nxval( ldval ),
801 $ nyval( ldval ), pval( ldpval ), qval( ldqval ),
802 $ rscxval( ldval ), rscyval( ldval ), work( * )
1012 PARAMETER ( NIN = 11, nsubs = 8 )
1021 CHARACTER*79 USRINFO
1024 EXTERNAL blacs_abort, blacs_get, blacs_gridexit,
1025 $ blacs_gridinit, blacs_setup,
icopy, igebr2d,
1026 $ igebs2d, sgebr2d, sgebs2d
1036 CHARACTER*7 SNAMES( NSUBS )
1037 COMMON /snamec/snames
1048 OPEN( nin, file=
'PSBLAS1TST.dat', status=
'OLD' )
1049 READ( nin, fmt = * ) summry
1054 READ( nin, fmt = 9999 ) usrinfo
1058 READ( nin, fmt = * ) summry
1059 READ( nin, fmt = * ) nout
1060 IF( nout.NE.0 .AND. nout.NE.6 )
1061 $
OPEN( nout, file = summry, status =
'UNKNOWN' )
1067 READ( nin, fmt = * ) sof
1071 READ( nin, fmt = * ) tee
1075 READ( nin, fmt = * ) iverb
1076 IF( iverb.LT.0 .OR. iverb.GT.3 )
1081 READ( nin, fmt = * ) igap
1087 READ( nin, fmt = * ) ngrids
1088 IF( ngrids.LT.1 .OR. ngrids.GT.ldpval )
THEN
1089 WRITE( nout, fmt = 9998 )
'Grids', ldpval
1091 ELSE IF( ngrids.GT.ldqval )
THEN
1092 WRITE( nout, fmt = 9998 )
'Grids', ldqval
1098 READ( nin, fmt = * ) ( pval( i ), i = 1, ngrids )
1099 READ( nin, fmt = * ) ( qval( i ), i = 1, ngrids )
1103 READ( nin, fmt = * ) alpha
1107 READ( nin, fmt = * ) nmat
1108 IF( nmat.LT.1 .OR. nmat.GT.ldval )
THEN
1109 WRITE( nout, fmt = 9998 )
'Tests', ldval
1115 READ( nin, fmt = * ) ( nval( i ), i = 1, nmat )
1116 READ( nin, fmt = * ) ( mxval( i ), i = 1, nmat )
1117 READ( nin, fmt = * ) ( nxval( i ), i = 1, nmat )
1118 READ( nin, fmt = * ) ( imbxval( i ), i = 1, nmat )
1119 READ( nin, fmt = * ) ( inbxval( i ), i = 1, nmat )
1120 READ( nin, fmt = * ) ( mbxval( i ), i = 1, nmat )
1121 READ( nin, fmt = * ) ( nbxval( i ), i = 1, nmat )
1122 READ( nin, fmt = * ) ( rscxval( i ), i = 1, nmat )
1123 READ( nin, fmt = * ) ( cscxval( i ), i = 1, nmat )
1124 READ( nin, fmt = * ) ( ixval( i ), i = 1, nmat )
1125 READ( nin, fmt = * ) ( jxval( i ), i = 1, nmat )
1126 READ( nin, fmt = * ) ( incxval( i ), i = 1, nmat )
1127 READ( nin, fmt = * ) ( myval( i ), i = 1, nmat )
1128 READ( nin, fmt = * ) ( nyval( i ), i = 1, nmat )
1129 READ( nin, fmt = * ) ( imbyval( i ), i = 1, nmat )
1130 READ( nin, fmt = * ) ( inbyval( i ), i = 1, nmat )
1131 READ( nin, fmt = * ) ( mbyval( i ), i = 1, nmat )
1132 READ( nin, fmt = * ) ( nbyval( i ), i = 1, nmat )
1133 READ( nin, fmt = * ) ( rscyval( i ), i = 1, nmat )
1134 READ( nin, fmt = * ) ( cscyval( i ), i = 1, nmat )
1135 READ( nin, fmt = * ) ( iyval( i ), i = 1, nmat )
1136 READ( nin, fmt = * ) ( jyval( i ), i = 1, nmat )
1137 READ( nin, fmt = * ) ( incyval( i ), i = 1, nmat )
1143 ltest( i ) = .false.
1146 READ( nin, fmt = 9996,
END = 50 ) SNAMET, ltestt
1148 IF( snamet.EQ.snames( i ) )
1152 WRITE( nout, fmt = 9995 )snamet
1168 IF( nprocs.LT.1 )
THEN
1171 nprocs =
max( nprocs, pval( i )*qval( i ) )
1173 CALL blacs_setup( iam, nprocs )
1179 CALL blacs_get( -1, 0, ictxt )
1180 CALL blacs_gridinit( ictxt,
'Row-major', 1, nprocs )
1188 CALL sgebs2d( ictxt,
'All',
' ', 1, 1, alpha, 1 )
1192 CALL igebs2d( ictxt,
'All',
' ', 2, 1, work, 2 )
1211 CALL icopy( ngrids, pval, 1, work( i ), 1 )
1213 CALL icopy( ngrids, qval, 1, work( i ), 1 )
1215 CALL icopy( nmat, nval, 1, work( i ), 1 )
1217 CALL icopy( nmat, mxval, 1, work( i ), 1 )
1219 CALL icopy( nmat, nxval, 1, work( i ), 1 )
1221 CALL icopy( nmat, imbxval, 1, work( i ), 1 )
1223 CALL icopy( nmat, inbxval, 1, work( i ), 1 )
1225 CALL icopy( nmat, mbxval, 1, work( i ), 1 )
1227 CALL icopy( nmat, nbxval, 1, work( i ), 1 )
1229 CALL icopy( nmat, rscxval, 1, work( i ), 1 )
1231 CALL icopy( nmat, cscxval, 1, work( i ), 1 )
1233 CALL icopy( nmat, ixval, 1, work( i ), 1 )
1235 CALL icopy( nmat, jxval, 1, work( i ), 1 )
1237 CALL icopy( nmat, incxval, 1, work( i ), 1 )
1239 CALL icopy( nmat, myval, 1, work( i ), 1 )
1241 CALL icopy( nmat, nyval, 1, work( i ), 1 )
1243 CALL icopy( nmat, imbyval, 1, work( i ), 1 )
1245 CALL icopy( nmat, inbyval, 1, work( i ), 1 )
1247 CALL icopy( nmat, mbyval, 1, work( i ), 1 )
1249 CALL icopy( nmat, nbyval, 1, work( i ), 1 )
1251 CALL icopy( nmat, rscyval, 1, work( i ), 1 )
1253 CALL icopy( nmat, cscyval, 1, work( i ), 1 )
1255 CALL icopy( nmat, iyval, 1, work( i ), 1 )
1257 CALL icopy( nmat, jyval, 1, work( i ), 1 )
1259 CALL icopy( nmat, incyval, 1, work( i ), 1 )
1263 IF( ltest( j ) )
THEN
1271 CALL igebs2d( ictxt,
'All',
' ', i, 1, work, i )
1275 WRITE( nout, fmt = 9999 )
'Level 1 PBLAS testing program.'
1276 WRITE( nout, fmt = 9999 ) usrinfo
1277 WRITE( nout, fmt = * )
1278 WRITE( nout, fmt = 9999 )
1279 $
'Tests of the real single precision '//
1281 WRITE( nout, fmt = * )
1282 WRITE( nout, fmt = 9999 )
1283 $
'The following parameter values will be used:'
1284 WRITE( nout, fmt = * )
1285 WRITE( nout, fmt = 9993 ) nmat
1286 WRITE( nout, fmt = 9992 ) ngrids
1287 WRITE( nout, fmt = 9990 )
1288 $
'P', ( pval(i), i = 1,
min(ngrids, 5) )
1290 $
WRITE( nout, fmt = 9991 ) ( pval(i), i = 6,
1291 $
min( 10, ngrids ) )
1293 $
WRITE( nout, fmt = 9991 ) ( pval(i), i = 11,
1294 $
min( 15, ngrids ) )
1296 $
WRITE( nout, fmt = 9991 ) ( pval(i), i = 16, ngrids )
1297 WRITE( nout, fmt = 9990 )
1298 $
'Q', ( qval(i), i = 1,
min(ngrids, 5) )
1300 $
WRITE( nout, fmt = 9991 ) ( qval(i), i = 6,
1301 $
min( 10, ngrids ) )
1303 $
WRITE( nout, fmt = 9991 ) ( qval(i), i = 11,
1304 $
min( 15, ngrids ) )
1306 $
WRITE( nout, fmt = 9991 ) ( qval(i), i = 16, ngrids )
1307 WRITE( nout, fmt = 9988 ) sof
1308 WRITE( nout, fmt = 9987 ) tee
1309 WRITE( nout, fmt = 9983 ) igap
1310 WRITE( nout, fmt = 9986 ) iverb
1311 WRITE( nout, fmt = 9982 ) alpha
1312 IF( ltest( 1 ) )
THEN
1313 WRITE( nout, fmt = 9985 ) snames( 1 ),
' ... Yes'
1315 WRITE( nout, fmt = 9985 ) snames( 1 ),
' ... No '
1318 IF( ltest( i ) )
THEN
1319 WRITE( nout, fmt = 9984 ) snames( i ),
' ... Yes'
1321 WRITE( nout, fmt = 9984 ) snames( i ),
' ... No '
1324 WRITE( nout, fmt = 9994 ) eps
1325 WRITE( nout, fmt = * )
1332 $
CALL blacs_setup( iam, nprocs )
1337 CALL blacs_get( -1, 0, ictxt )
1338 CALL blacs_gridinit( ictxt,
'Row-major', 1, nprocs )
1344 CALL sgebr2d( ictxt,
'All',
' ', 1, 1, alpha, 1, 0, 0 )
1346 CALL igebr2d( ictxt,
'All',
' ', 2, 1, work, 2, 0, 0 )
1350 i = 2*ngrids + 23*nmat + nsubs + 4
1351 CALL igebr2d( ictxt,
'All',
' ', i, 1, work, i, 0, 0 )
1354 IF( work( i ).EQ.1 )
THEN
1360 IF( work( i ).EQ.1 )
THEN
1370 CALL icopy( ngrids, work( i ), 1, pval, 1 )
1372 CALL icopy( ngrids, work( i ), 1, qval, 1 )
1374 CALL icopy( nmat, work( i ), 1, nval, 1 )
1376 CALL icopy( nmat, work( i ), 1, mxval, 1 )
1378 CALL icopy( nmat, work( i ), 1, nxval, 1 )
1380 CALL icopy( nmat, work( i ), 1, imbxval, 1 )
1382 CALL icopy( nmat, work( i ), 1, inbxval, 1 )
1384 CALL icopy( nmat, work( i ), 1, mbxval, 1 )
1386 CALL icopy( nmat, work( i ), 1, nbxval, 1 )
1388 CALL icopy( nmat, work( i ), 1, rscxval, 1 )
1390 CALL icopy( nmat, work( i ), 1, cscxval, 1 )
1392 CALL icopy( nmat, work( i ), 1, ixval, 1 )
1394 CALL icopy( nmat, work( i ), 1, jxval, 1 )
1396 CALL icopy( nmat, work( i ), 1, incxval, 1 )
1398 CALL icopy( nmat, work( i ), 1, myval, 1 )
1400 CALL icopy( nmat, work( i ), 1, nyval, 1 )
1402 CALL icopy( nmat, work( i ), 1, imbyval, 1 )
1404 CALL icopy( nmat, work( i ), 1, inbyval, 1 )
1406 CALL icopy( nmat, work( i ), 1, mbyval, 1 )
1408 CALL icopy( nmat, work( i ), 1, nbyval, 1 )
1410 CALL icopy( nmat, work( i ), 1, rscyval, 1 )
1412 CALL icopy( nmat, work( i ), 1, cscyval, 1 )
1414 CALL icopy( nmat, work( i ), 1, iyval, 1 )
1416 CALL icopy( nmat, work( i ), 1, jyval, 1 )
1418 CALL icopy( nmat, work( i ), 1, incyval, 1 )
1422 IF( work( i ).EQ.1 )
THEN
1425 ltest( j ) = .false.
1432 CALL blacs_gridexit( ictxt )
1436 100
WRITE( nout, fmt = 9997 )
1438 IF( nout.NE.6 .AND. nout.NE.0 )
1440 CALL blacs_abort( ictxt, 1 )
1445 9998
FORMAT(
' Number of values of ',5a,
' is less than 1 or greater ',
1447 9997
FORMAT(
' Illegal input in file ',40a,
'. Aborting run.' )
1448 9996
FORMAT( a7, l2 )
1449 9995
FORMAT(
' Subprogram name ', a7,
' not recognized',
1450 $ /
' ******* TESTS ABANDONED *******' )
1451 9994
FORMAT( 2x,
'Relative machine precision (eps) is taken to be ',
1453 9993
FORMAT( 2x,
'Number of Tests : ', i6 )
1454 9992
FORMAT( 2x,
'Number of process grids : ', i6 )
1455 9991
FORMAT( 2x,
' : ', 5i6 )
1456 9990
FORMAT( 2x, a1,
' : ', 5i6 )
1457 9988
FORMAT( 2x,
'Stop on failure flag : ', l6 )
1458 9987
FORMAT( 2x,
'Test for error exits flag : ', l6 )
1459 9986
FORMAT( 2x,
'Verbosity level : ', i6 )
1460 9985
FORMAT( 2x,
'Routines to be tested : ', a, a8 )
1461 9984
FORMAT( 2x,
' ', a, a8 )
1462 9983
FORMAT( 2x,
'Leading dimension gap : ', i6 )
1463 9982
FORMAT( 2x,
'Alpha : ', g16.6 )
1476 INTEGER INOUT, NPROCS
1610 PARAMETER ( NSUBS = 8 )
1614 INTEGER I, ICTXT, MYCOL, MYROW, NPCOL, NPROW
1617 INTEGER SCODE( NSUBS )
1620 EXTERNAL blacs_get, blacs_gridexit, blacs_gridinfo,
1621 $ blacs_gridinit, psamax, psasum, psaxpy, pscopy,
1622 $
psdimee, psdot, psnrm2, psscal, psswap,
1628 CHARACTER*7 SNAMES( NSUBS )
1629 COMMON /SNAMEC/SNAMES
1630 COMMON /PBERRORC/NOUT, ABRTFLG
1633 DATA SCODE/11, 12, 11, 13, 13, 15, 15, 14/
1640 CALL blacs_get( -1, 0, ictxt )
1641 CALL blacs_gridinit( ictxt,
'Row-major', 1, nprocs )
1642 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1655 IF( ltest( i ) )
THEN
1656 CALL psdimee( ictxt, nout, psswap, scode( i ), snames( i ) )
1657 CALL psvecee( ictxt, nout, psswap, scode( i ), snames( i ) )
1663 IF( ltest( i ) )
THEN
1664 CALL psdimee( ictxt, nout, psscal, scode( i ), snames( i ) )
1665 CALL psvecee( ictxt, nout, psscal, scode( i ), snames( i ) )
1671 IF( ltest( i ) )
THEN
1672 CALL psdimee( ictxt, nout, pscopy, scode( i ), snames( i ) )
1673 CALL psvecee( ictxt, nout, pscopy, scode( i ), snames( i ) )
1679 IF( ltest( i ) )
THEN
1680 CALL psdimee( ictxt, nout, psaxpy, scode( i ), snames( i ) )
1681 CALL psvecee( ictxt, nout, psaxpy, scode( i ), snames( i ) )
1687 IF( ltest( i ) )
THEN
1688 CALL psdimee( ictxt, nout, psdot, scode( i ), snames( i ) )
1689 CALL psvecee( ictxt, nout, psdot, scode( i ), snames( i ) )
1695 IF( ltest( i ) )
THEN
1696 CALL psdimee( ictxt, nout, psnrm2, scode( i ), snames( i ) )
1697 CALL psvecee( ictxt, nout, psnrm2, scode( i ), snames( i ) )
1703 IF( ltest( i ) )
THEN
1704 CALL psdimee( ictxt, nout, psasum, scode( i ), snames( i ) )
1705 CALL psvecee( ictxt, nout, psasum, scode( i ), snames( i ) )
1711 IF( ltest( i ) )
THEN
1712 CALL psdimee( ictxt, nout, psamax, scode( i ), snames( i ) )
1713 CALL psvecee( ictxt, nout, psamax, scode( i ), snames( i ) )
1716 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
1717 $
WRITE( nout, fmt = 9999 )
1719 CALL blacs_gridexit( ictxt )
1725 9999
FORMAT( 2x,
'Error-exit tests completed.' )
1732 SUBROUTINE pschkarg1( ICTXT, NOUT, SNAME, N, ALPHA, IX, JX,
1733 $ DESCX, INCX, IY, JY, DESCY, INCY, INFO )
1741 INTEGER ICTXT, INCX, INCY, INFO, IX, IY, JX, JY, N,
1747 INTEGER DESCX( * ), DESCY( * )
1892 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
1893 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
1895 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
1896 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
1897 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
1898 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
1901 INTEGER I, INCXREF, INCYREF, IXREF, IYREF, JXREF,
1902 $ JYREF, MYCOL, MYROW, NPCOL, NPROW, NREF
1906 CHARACTER*15 ARGNAME
1907 INTEGER DESCXREF( DLEN_ ), DESCYREF( DLEN_ )
1910 EXTERNAL blacs_gridinfo, igsum2d
1919 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
1923 IF( info.EQ.0 )
THEN
1929 descxref( i ) = descx( i )
1935 descyref( i ) = descy( i )
1945 IF( n.NE.nref )
THEN
1946 WRITE( argname, fmt =
'(A)' )
'N'
1947 ELSE IF( ix.NE.ixref )
THEN
1948 WRITE( argname, fmt =
'(A)' )
'IX'
1949 ELSE IF( jx.NE.jxref )
THEN
1950 WRITE( argname, fmt =
'(A)' )
'JX'
1951 ELSE IF( descx( dtype_ ).NE.descxref( dtype_ ) )
THEN
1952 WRITE( argname, fmt =
'(A)' )
'DESCX( DTYPE_ )'
1953 ELSE IF( descx( m_ ).NE.descxref( m_ ) )
THEN
1954 WRITE( argname, fmt =
'(A)' )
'DESCX( M_ )'
1955 ELSE IF( descx( n_ ).NE.descxref( n_ ) )
THEN
1956 WRITE( argname, fmt =
'(A)' )
'DESCX( N_ )'
1957 ELSE IF( descx( imb_ ).NE.descxref( imb_ ) )
THEN
1958 WRITE( argname, fmt =
'(A)' )
'DESCX( IMB_ )'
1959 ELSE IF( descx( inb_ ).NE.descxref( inb_ ) )
THEN
1960 WRITE( argname, fmt =
'(A)' )
'DESCX( INB_ )'
1961 ELSE IF( descx( mb_ ).NE.descxref( mb_ ) )
THEN
1962 WRITE( argname, fmt =
'(A)' )
'DESCX( MB_ )'
1963 ELSE IF( descx( nb_ ).NE.descxref( nb_ ) )
THEN
1964 WRITE( argname, fmt =
'(A)' )
'DESCX( NB_ )'
1965 ELSE IF( descx( rsrc_ ).NE.descxref( rsrc_ ) )
THEN
1966 WRITE( argname, fmt =
'(A)' )
'DESCX( RSRC_ )'
1967 ELSE IF( descx( csrc_ ).NE.descxref( csrc_ ) )
THEN
1968 WRITE( argname, fmt =
'(A)' )
'DESCX( CSRC_ )'
1969 ELSE IF( descx( ctxt_ ).NE.descxref( ctxt_ ) )
THEN
1970 WRITE( argname, fmt =
'(A)' )
'DESCX( CTXT_ )'
1971 ELSE IF( descx( lld_ ).NE.descxref( lld_ ) )
THEN
1972 WRITE( argname, fmt =
'(A)' )
'DESCX( LLD_ )'
1973 ELSE IF( incx.NE.incxref )
THEN
1974 WRITE( argname, fmt =
'(A)' )
'INCX'
1975 ELSE IF( iy.NE.iyref )
THEN
1976 WRITE( argname, fmt =
'(A)' )
'IY'
1977 ELSE IF( jy.NE.jyref )
THEN
1978 WRITE( argname, fmt =
'(A)' )
'JY'
1979 ELSE IF( descy( dtype_ ).NE.descyref( dtype_ ) )
THEN
1980 WRITE( argname, fmt =
'(A)' )
'DESCY( DTYPE_ )'
1981 ELSE IF( descy( m_ ).NE.descyref( m_ ) )
THEN
1982 WRITE( argname, fmt =
'(A)' )
'DESCY( M_ )'
1983 ELSE IF( descy( n_ ).NE.descyref( n_ ) )
THEN
1984 WRITE( argname, fmt =
'(A)' )
'DESCY( N_ )'
1985 ELSE IF( descy( imb_ ).NE.descyref( imb_ ) )
THEN
1986 WRITE( argname, fmt =
'(A)' )
'DESCY( IMB_ )'
1987 ELSE IF( descy( inb_ ).NE.descyref( inb_ ) )
THEN
1988 WRITE( argname, fmt =
'(A)' )
'DESCY( INB_ )'
1989 ELSE IF( descy( mb_ ).NE.descyref( mb_ ) )
THEN
1990 WRITE( argname, fmt =
'(A)' )
'DESCY( MB_ )'
1991 ELSE IF( descy( nb_ ).NE.descyref( nb_ ) )
THEN
1992 WRITE( argname, fmt =
'(A)' )
'DESCY( NB_ )'
1993 ELSE IF( descy( rsrc_ ).NE.descyref( rsrc_ ) )
THEN
1994 WRITE( argname, fmt =
'(A)' )
'DESCY( RSRC_ )'
1995 ELSE IF( descy( csrc_ ).NE.descyref( csrc_ ) )
THEN
1996 WRITE( argname, fmt =
'(A)' )
'DESCY( CSRC_ )'
1997 ELSE IF( descy( ctxt_ ).NE.descyref( ctxt_ ) )
THEN
1998 WRITE( argname, fmt =
'(A)' )
'DESCY( CTXT_ )'
1999 ELSE IF( descy( lld_ ).NE.descyref( lld_ ) )
THEN
2000 WRITE( argname, fmt =
'(A)' )
'DESCY( LLD_ )'
2001 ELSE IF( incy.NE.incyref )
THEN
2002 WRITE( argname, fmt =
'(A)' )
'INCY'
2003 ELSE IF( alpha.NE.alpharef )
THEN
2004 WRITE( argname, fmt =
'(A)' )
'ALPHA'
2009 CALL igsum2d( ictxt,
'All',
' ', 1, 1, info, 1, -1, 0 )
2011 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2013 IF( info.GT.0 )
THEN
2014 WRITE( nout, fmt = 9999 ) argname, sname
2016 WRITE( nout, fmt = 9998 ) sname
2023 9999
FORMAT( 2x,
' ***** Input-only parameter check: ', a,
2024 $
' FAILED changed ', a,
' *****' )
2025 9998
FORMAT( 2x,
' ***** Input-only parameter check: ', a,
2033 LOGICAL FUNCTION pisinscope( ICTXT, N, IX, JX, DESCX, INCX )
2041 INTEGER ictxt, incx, ix, jx, n
2152 INTEGER block_cyclic_2d_inb, csrc_, ctxt_, dlen_,
2153 $ dtype_, imb_, inb_, lld_, mb_, m_, nb_, n_,
2155 PARAMETER ( block_cyclic_2d_inb = 2, dlen_ = 11,
2156 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2157 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2158 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2161 LOGICAL colrep, rowrep
2162 INTEGER iix, ixcol, ixrow, jjx, mycol, myrow, npcol,
2170 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
2172 CALL pb_infog2l( ix, jx, descx, nprow, npcol, myrow, mycol,
2173 $ iix, jjx, ixrow, ixcol )
2174 rowrep = ( ixrow.EQ.-1 )
2175 colrep = ( ixcol.EQ.-1 )
2177 IF( descx( m_ ).EQ.1 .AND. n.EQ.1 )
THEN
2182 pisinscope = ( ( ixrow.EQ.myrow .OR. rowrep ) .AND.
2183 $ ( ixcol.EQ.mycol .OR. colrep ) )
2187 IF( incx.EQ.descx( m_ ) )
THEN
2208 SUBROUTINE psblas1tstchk( ICTXT, NOUT, NROUT, N, PSCLR, PUSCLR,
2209 $ PISCLR, X, PX, IX, JX, DESCX, INCX, Y,
2210 $ PY, IY, JY, DESCY, INCY, INFO )
2218 INTEGER ICTXT, INCX, INCY, INFO, IX, IY, JX, JY, N,
2219 $ nout, nrout, pisclr
2223 INTEGER DESCX( * ), DESCY( * )
2224 REAL PX( * ), PY( * ), X( * ), Y( * )
2401 PARAMETER ( ZERO = 0.0e+0 )
2402 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2403 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2405 PARAMETER ( BLOCK_CYCLIC_2D_INB = 2, dlen_ = 11,
2406 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2407 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2408 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2411 LOGICAL COLREP, INXSCOPE, INYSCOPE, ROWREP
2412 INTEGER I, IB, ICURCOL, ICURROW, IDUMM, IIX, IIY, IN,
2413 $ ioffx, ioffy, isclr, ixcol, ixrow, iycol,
2414 $ iyrow, j, jb, jjx, jjy, jn, kk, ldx, ldy,
2415 $ mycol, myrow, npcol, nprow
2416 REAL ERR, ERRMAX, PREC, SCLR, USCLR
2420 CHARACTER*5 ARGIN1, ARGIN2, ARGOUT1, ARGOUT2
2431 EXTERNAL isamax, pisinscope, pslamch
2445 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
2455 prec = pslamch( ictxt,
'precision' )
2457 IF( nrout.EQ.1 )
THEN
2461 ioffx = ix + ( jx - 1 ) * descx( m_ )
2462 ioffy = iy + ( jy - 1 ) * descy( m_ )
2463 CALL sswap( n, x( ioffx ), incx, y( ioffy ), incy )
2464 CALL pschkvin( errmax, n, x, px, ix, jx, descx, incx,
2466 CALL pschkvin( errmax, n, y, py, iy, jy, descy, incy,
2469 ELSE IF( nrout.EQ.2 )
THEN
2474 ioffx = ix + ( jx - 1 ) * descx( m_ )
2475 CALL pb_infog2l( ix, jx, descx, nprow, npcol, myrow, mycol,
2476 $ iix, jjx, ixrow, ixcol )
2479 rowrep = ( ixrow.EQ.-1 )
2480 colrep = ( ixcol.EQ.-1 )
2482 IF( incx.EQ.descx( m_ ) )
THEN
2486 jb = descx( inb_ ) - jx + 1
2488 $ jb = ( (-jb ) / descx( nb_ ) + 1 ) * descx( nb_ ) + jb
2494 CALL pserrscal( err, psclr, x( ioffx ), prec )
2496 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2497 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
2498 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2504 ioffx = ioffx + incx
2508 icurcol = mod( icurcol+1, npcol )
2510 DO 40 j = jn+1, jx+n-1, descx( nb_ )
2511 jb =
min( jx+n-j, descx( nb_ ) )
2515 CALL pserrscal( err, psclr, x( ioffx ), prec )
2517 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2518 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
2519 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2525 ioffx = ioffx + incx
2529 icurcol = mod( icurcol+1, npcol )
2537 ib = descx( imb_ ) - ix + 1
2539 $ ib = ( (-ib ) / descx( mb_ ) + 1 ) * descx( mb_ ) + ib
2545 CALL pserrscal( err, psclr, x( ioffx ), prec )
2547 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2548 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
2549 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2555 ioffx = ioffx + incx
2559 icurrow = mod( icurrow+1, nprow )
2561 DO 70 i = in+1, ix+n-1, descx( mb_ )
2562 ib =
min( ix+n-i, descx( mb_ ) )
2566 CALL pserrscal( err, psclr, x( ioffx ), prec )
2568 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2569 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
2570 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2576 ioffx = ioffx + incx
2579 icurrow = mod( icurrow+1, nprow )
2585 ELSE IF( nrout.EQ.3 )
THEN
2589 ioffx = ix + ( jx - 1 ) * descx( m_ )
2590 ioffy = iy + ( jy - 1 ) * descy( m_ )
2591 CALL scopy( n, x( ioffx ), incx, y( ioffy ), incy )
2592 CALL pschkvin( errmax, n, x, px, ix, jx, descx, incx,
2594 CALL pschkvin( errmax, n, y, py, iy, jy, descy, incy,
2597 ELSE IF( nrout.EQ.4 )
THEN
2601 CALL pschkvin( errmax, n, x, px, ix, jx, descx, incx,
2604 ioffx = ix + ( jx - 1 ) * descx( m_ )
2605 ioffy = iy + ( jy - 1 ) * descy( m_ )
2606 CALL pb_infog2l( iy, jy, descy, nprow, npcol, myrow, mycol,
2607 $ iiy, jjy, iyrow, iycol )
2610 rowrep = ( iyrow.EQ.-1 )
2611 colrep = ( iycol.EQ.-1 )
2613 IF( incy.EQ.descy( m_ ) )
THEN
2617 jb = descy( inb_ ) - jy + 1
2619 $ jb = ( (-jb ) / descy( nb_ ) + 1 ) * descy( nb_ ) + jb
2625 CALL pserraxpy( err, psclr, x( ioffx ), y( ioffy ),
2628 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2629 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
2630 IF( abs( py( iiy+(jjy-1)*ldy ) - y( ioffy ) ).GT.
2637 ioffx = ioffx + incx
2638 ioffy = ioffy + incy
2642 icurcol = mod( icurcol+1, npcol )
2644 DO 160 j = jn+1, jy+n-1, descy( nb_ )
2645 jb =
min( jy+n-j, descy( nb_ ) )
2649 CALL pserraxpy( err, psclr, x( ioffx ), y( ioffy ),
2652 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2653 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
2654 IF( abs( py( iiy+(jjy-1)*ldy ) - y( ioffy ) ).GT.
2661 ioffx = ioffx + incx
2662 ioffy = ioffy + incy
2666 icurcol = mod( icurcol+1, npcol )
2674 ib = descy( imb_ ) - iy + 1
2676 $ ib = ( (-ib ) / descy( mb_ ) + 1 ) * descy( mb_ ) + ib
2682 CALL pserraxpy( err, psclr, x( ioffx ), y( ioffy ),
2685 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2686 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
2687 IF( abs( py( iiy+(jjy-1)*ldy ) - y( ioffy ) ).GT.
2694 ioffx = ioffx + incx
2695 ioffy = ioffy + incy
2699 icurrow = mod( icurrow+1, nprow )
2701 DO 190 i = in+1, iy+n-1, descy( mb_ )
2702 ib =
min( iy+n-i, descy( mb_ ) )
2706 CALL pserraxpy( err, psclr, x( ioffx ), y( ioffy ),
2709 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2710 $ ( mycol.EQ.icurcol .OR. colrep ) )
THEN
2711 IF( abs( py( iiy+(jjy-1)*ldy ) - y( ioffy ) ).GT.
2718 ioffx = ioffx + incx
2719 ioffy = ioffy + incy
2723 icurrow = mod( icurrow+1, nprow )
2729 ELSE IF( nrout.EQ.5 )
THEN
2733 CALL pschkvin( errmax, n, x, px, ix, jx, descx, incx,
2735 CALL pschkvin( errmax, n, y, py, iy, jy, descy, incy,
2737 ioffx = ix + ( jx - 1 ) * descx( m_ )
2738 ioffy = iy + ( jy - 1 ) * descy( m_ )
2739 CALL pserrdot( err, n, sclr, x( ioffx ), incx, y( ioffy ),
2741 inxscope = pisinscope( ictxt, n, ix, jx, descx, incx )
2742 inyscope = pisinscope( ictxt, n, iy, jy, descy, incy )
2743 IF( inxscope.OR.inyscope )
THEN
2744 IF( abs( psclr - sclr ).GT.err )
THEN
2746 WRITE( argin1, fmt =
'(A)' )
'DOT'
2747 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2748 WRITE( nout, fmt = 9998 ) argin1
2749 WRITE( nout, fmt = 9996 ) sclr, psclr
2754 IF( psclr.NE.sclr )
THEN
2756 WRITE( argout1, fmt =
'(A)' )
'DOT'
2757 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2758 WRITE( nout, fmt = 9997 ) argout1
2759 WRITE( nout, fmt = 9996 ) sclr, psclr
2764 ELSE IF( nrout.EQ.6 )
THEN
2768 CALL pschkvin( errmax, n, x, px, ix, jx, descx, incx,
2770 ioffx = ix + ( jx - 1 ) * descx( m_ )
2771 CALL pserrnrm2( err, n, usclr, x( ioffx ), incx, prec )
2772 IF( pisinscope( ictxt, n, ix, jx, descx, incx ) )
THEN
2773 IF( abs( pusclr - usclr ).GT.err )
THEN
2775 WRITE( argin1, fmt =
'(A)' )
'NRM2'
2776 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2777 WRITE( nout, fmt = 9998 ) argin1
2778 WRITE( nout, fmt = 9996 ) usclr, pusclr
2783 IF( pusclr.NE.usclr )
THEN
2785 WRITE( argout1, fmt =
'(A)' )
'NRM2'
2786 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2787 WRITE( nout, fmt = 9997 ) argout1
2788 WRITE( nout, fmt = 9996 ) usclr, pusclr
2793 ELSE IF( nrout.EQ.7 )
THEN
2797 CALL pschkvin( errmax, n, x, px, ix, jx, descx, incx,
2799 ioffx = ix + ( jx - 1 ) * descx( m_ )
2800 CALL pserrasum( err, n, usclr, x( ioffx ), incx, prec )
2801 IF( pisinscope( ictxt, n, ix, jx, descx, incx ) )
THEN
2802 IF( abs( pusclr - usclr ) .GT. err )
THEN
2804 WRITE( argin1, fmt =
'(A)' )
'ASUM'
2805 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2806 WRITE( nout, fmt = 9998 ) argin1
2807 WRITE( nout, fmt = 9996 ) usclr, pusclr
2812 IF( pusclr.NE.usclr )
THEN
2814 WRITE( argout1, fmt =
'(A)' )
'ASUM'
2815 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2816 WRITE( nout, fmt = 9997 ) argout1
2817 WRITE( nout, fmt = 9996 ) usclr, pusclr
2822 ELSE IF( nrout.EQ.8 )
THEN
2826 CALL pschkvin( errmax, n, x, px, ix, jx, descx, incx,
2828 ioffx = ix + ( jx - 1 ) * descx( m_ )
2829 IF( pisinscope( ictxt, n, ix, jx, descx, incx ) )
THEN
2830 isclr = isamax( n, x( ioffx ), incx )
2833 ELSE IF( ( incx.EQ.1 ).AND.( descx( m_ ).EQ.1 ).AND.
2837 ELSE IF( incx.EQ.descx( m_ ) )
THEN
2838 isclr = jx + isclr - 1
2839 sclr = x( ix + ( isclr - 1 ) * descx( m_ ) )
2841 isclr = ix + isclr - 1
2842 sclr = x( isclr + ( jx - 1 ) * descx( m_ ) )
2845 IF( psclr.NE.sclr )
THEN
2847 WRITE( argin1, fmt =
'(A)' )
'AMAX'
2848 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2849 WRITE( nout, fmt = 9998 ) argin1
2850 WRITE( nout, fmt = 9996 ) sclr, psclr
2854 IF( pisclr.NE.isclr )
THEN
2856 WRITE( argin2, fmt =
'(A)' )
'INDX'
2857 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2858 WRITE( nout, fmt = 9998 ) argin2
2859 WRITE( nout, fmt = 9995 ) isclr, pisclr
2865 IF( psclr.NE.sclr )
THEN
2867 WRITE( argout1, fmt =
'(A)' )
'AMAX'
2868 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2869 WRITE( nout, fmt = 9997 ) argout1
2870 WRITE( nout, fmt = 9996 ) sclr, psclr
2873 IF( pisclr.NE.isclr )
THEN
2875 WRITE( argout2, fmt =
'(A)' )
'INDX'
2876 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
2877 WRITE( nout, fmt = 9997 ) argout2
2878 WRITE( nout, fmt = 9995 ) isclr, pisclr
2887 CALL igamx2d( ictxt,
'All',
' ', 6, 1, ierr, 6, idumm, idumm, -1,
2892 IF( ierr( 1 ).NE.0 )
THEN
2894 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
2895 $
WRITE( nout, fmt = 9999 )
'X'
2898 IF( ierr( 2 ).NE.0 )
THEN
2900 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
2901 $
WRITE( nout, fmt = 9999 )
'Y'
2904 IF( ierr( 3 ).NE.0 )
2907 IF( ierr( 4 ).NE.0 )
2910 IF( ierr( 5 ).NE.0 )
2913 IF( ierr( 6 ).NE.0 )
2916 9999
FORMAT( 2x,
' ***** ERROR: Vector operand ', a,
2917 $
' is incorrect.' )
2918 9998
FORMAT( 2x,
' ***** ERROR: Output scalar result ', a,
2919 $
' in scope is incorrect.' )
2920 9997
FORMAT( 2x,
' ***** ERROR: Output scalar result ', a,
2921 $
' out of scope is incorrect.' )
2922 9996
FORMAT( 2x,
' ***** Expected value is: ', e16.8, /2x,
2923 $
' Obtained value is: ', e16.8 )
2924 9995
FORMAT( 2x,
' ***** Expected value is: ', i6, /2x,
2925 $
' Obtained value is: ', i6 )
2932 SUBROUTINE pserrdot( ERRBND, N, SCLR, X, INCX, Y, INCY, PREC )
2940 INTEGER INCX, INCY, N
2941 REAL ERRBND, PREC, SCLR
3007 PARAMETER ( ONE = 1.0e+0, two = 2.0e+0,
3012 REAL ADDBND, FACT, SUMNEG, SUMPOS, TMP
3024 fact = two * ( one + prec )
3025 addbnd = two * two * two * prec
3028 tmp = x( ix ) * y( iy )
3030 IF( tmp.GE.zero )
THEN
3031 sumpos = sumpos + tmp * fact
3033 sumneg = sumneg - tmp * fact
3039 errbnd = addbnd * max( sumpos, sumneg )
3046 SUBROUTINE pserrnrm2( ERRBND, N, USCLR, X, INCX, PREC )
3055 REAL ERRBND, PREC, USCLR
3111 PARAMETER ( ONE = 1.0e+0, two = 2.0e+0,
3116 REAL ABSXI, ADDBND, FACT, SCALE, SSQ, SUMSCA, SUMSSQ
3126 addbnd = two * two * two * prec
3127 fact = one + two * ( ( one + prec )**3 - one )
3131 DO 10 ix = 1, 1 + ( n - 1 )*incx, incx
3132 IF( x( ix ).NE.zero )
THEN
3133 absxi = abs( x( ix ) )
3134 IF( scale.LT.absxi )
THEN
3135 sumssq = one + ( ssq*( scale/absxi )**2 ) * fact
3136 errbnd = addbnd * sumssq
3137 sumssq = sumssq + errbnd
3138 ssq = one + ssq*( scale/absxi )**2
3142 sumssq = ssq + ( ( absxi/scale )**2 ) * fact
3143 errbnd = addbnd * sumssq
3144 sumssq = sumssq + errbnd
3145 ssq = ssq + ( absxi/scale )**2
3150 usclr = scale * sqrt( ssq )
3154 errbnd = sqrt( sumssq ) * ( one + two * ( 1.00001e+0 * prec ) )
3156 errbnd = ( sumsca * errbnd ) - usclr
3163 SUBROUTINE pserrasum( ERRBND, N, USCLR, X, INCX, PREC )
3172 REAL ERRBND, PREC, USCLR
3219 PARAMETER ( TWO = 2.0e+0, zero = 0.0e+0 )
3232 addbnd = two * two * two * prec
3234 DO 10 ix = 1, 1 + ( n - 1 )*incx, incx
3235 usclr = usclr + abs( x( ix ) )
3238 errbnd = addbnd * usclr
3245 SUBROUTINE pserrscal( ERRBND, PSCLR, X, PREC )
3253 REAL ERRBND, PREC, PSCLR, X
3296 PARAMETER ( TWO = 2.0e+0 )
3305 errbnd = ( two * prec ) * abs( x )
3312 SUBROUTINE pserraxpy( ERRBND, PSCLR, X, Y, PREC )
3320 REAL ERRBND, PREC, PSCLR, X, Y
3356 PARAMETER ( ONE = 1.0e+0, two = 2.0e+0,
3360 REAL ADDBND, FACT, SUMPOS, SUMNEG, TMP
3369 fact = one + two * prec
3370 addbnd = two * two * two * prec
3373 IF( tmp.GE.zero )
THEN
3374 sumpos = sumpos + tmp * fact
3376 sumneg = sumneg - tmp * fact
3380 IF( tmp.GE.zero )
THEN
3381 sumpos = sumpos + tmp
3383 sumneg = sumneg - tmp
3386 y = y + ( psclr * x )
3388 errbnd = addbnd * max( sumpos, sumneg )