1 SUBROUTINE pzseprtst(DESCA, UPLO, N, MATTYPE, SUBTESTS, THRESH,
2 $ ORDER, ABSTOL, ISEED, A, COPYA, Z, LDA, WIN,
3 $ WNEW, IFAIL, ICLUSTR, GAP, IPREPAD, IPOSTPAD,
4 $ WORK, LWORK, RWORK, LRWORK,
5 $ IWORK, LIWORK, HETERO, NOUT, INFO )
15 CHARACTER HETERO, SUBTESTS, UPLO
16 INTEGER INFO, IPOSTPAD, IPREPAD, LDA, LIWORK, LWORK,
17 $ MATTYPE, N, NOUT, ORDER
19 DOUBLE PRECISION ABSTOL, THRESH
22 INTEGER DESCA( * ), ICLUSTR( * ), IFAIL( * ),
23 $ iseed( 4 ), iwork( * )
24 DOUBLE PRECISION GAP( * ), WIN( * ), WNEW( * ), RWORK( * )
25 COMPLEX*16 A( LDA, * ), COPYA( LDA, * ),
26 $ work( * ), z( lda, * )
198 INTEGER CTXT_, MB_, NB_, RSRC_, CSRC_, LLD_
199 PARAMETER ( CTXT_ = 2, mb_ = 5, nb_ = 6,
200 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
201 DOUBLE PRECISION HALF, ONE, TEN, ZERO
202 parameter( zero = 0.0d0, one = 1.0d0,
203 $ ten = 10.0d0, half = 0.5d0 )
205 parameter( padval = ( 19.25d0, 1.1d1 ) )
207 PARAMETER ( ZZERO = ( 0.0d0, 0.0d0 ) )
209 parameter( zone = ( 1.0d0, 0.0d0 ) )
211 parameter( maxtyp = 22 )
216 CHARACTER JOBZ, RANGE
218 INTEGER CONTEXT, I, IAM, IHETERO, IINFO, IL, IMODE, IN,
219 $ indd, indwork, isizesubtst, isizeevr,
220 $ isizetst, itype, iu, j, llwork, levrsize,
221 $ maxsize, mycol, myrow, nb, ngen, nloc,
222 $ nnodes, np, npcol, nprow, nq, res, sizechk,
223 $ sizemqrleft, sizemqrright, sizeqrf, sizeqtq,
224 $ sizesubtst, sizeevr, sizetms,
225 $ sizetst, valsize, vecsize
226 INTEGER INDRWORK, LLRWORK, RSIZEEVR, RSIZESUBTST,
228 DOUBLE PRECISION ANINV, ANORM, COND, MAXQTQNRM, MAXTSTNRM, OVFL,
233 INTEGER ISEEDIN( 4 ), KMAGN( MAXTYP ), KMODE( MAXTYP ),
235 DOUBLE PRECISION CTIME( 10 ), WTIME( 10 )
240 DOUBLE PRECISION DLARAN, PDLAMCH
241 EXTERNAL DLARAN, LSAME, NUMROC, PDLAMCH
244 EXTERNAL blacs_gridinfo, blacs_pinfo, dlabad, dlasrt,
251 INTRINSIC abs, dble, int,
max,
min, sqrt
254 DATA ktype / 1, 2, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 8,
255 $ 8, 8, 9, 9, 9, 9, 9, 10, 11 /
256 DATA kmagn / 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1,
257 $ 2, 3, 1, 1, 1, 2, 3, 1, 1 /
258 DATA kmode / 0, 0, 4, 3, 1, 4, 4, 4, 3, 1, 4, 4, 0,
259 $ 0, 0, 4, 3, 1, 4, 4, 3, 0 /
264 passed =
'PASSED EVR'
265 context = desca( ctxt_ )
268 CALL blacs_pinfo( iam, nnodes )
269 CALL blacs_gridinfo( context, nprow, npcol, myrow, mycol )
274 IF( lsame( hetero,
'Y' ) )
THEN
279 CALL igebs2d( context,
'All',
' ', 1, 1, ihetero, 1 )
281 CALL igebr2d( context,
'All',
' ', 1, 1, ihetero, 1, 0, 0 )
283 IF( ihetero.EQ.2 )
THEN
291 CALL pzlasizesepr( desca, iprepad, ipostpad, sizemqrleft,
292 $ sizemqrright, sizeqrf, sizetms, sizeqtq,
293 $ sizechk, sizeevr, rsizeevr, isizeevr,
294 $ sizesubtst, rsizesubtst,
295 $ isizesubtst, sizetst, rsizetst, isizetst )
296 IF( lrwork.LT.rsizetst )
THEN
300 CALL igamx2d( context,
'a',
' ', 1, 1, info, 1, 1, 1, -1, -1, 0 )
307 llwork = lwork - indwork + 1
308 llrwork = lrwork - indrwork + 1
310 ulp = pdlamch( context,
'P' )
312 unfl = pdlamch( context,
'Safe min' )
314 CALL dlabad( unfl, ovfl )
315 rtunfl = sqrt( unfl )
316 rtovfl = sqrt( ovfl )
317 aninv = one / dble(
max( 1, n ) )
321 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
322 CALL igebs2d( context,
'a',
' ', 4, 1, iseed, 4 )
324 CALL igebr2d( context,
'a',
' ', 4, 1, iseed, 4, 0, 0 )
326 iseedin( 1 ) = iseed( 1 )
327 iseedin( 2 ) = iseed( 2 )
328 iseedin( 3 ) = iseed( 3 )
329 iseedin( 4 ) = iseed( 4 )
348 itype = ktype( mattype )
349 imode = kmode( mattype )
353 GO TO ( 10, 20, 30 )kmagn( mattype )
360 anorm = ( rtovfl*ulp )*aninv
364 anorm = rtunfl*n*ulpinv
368 IF( mattype.LE.15 )
THEN
371 cond = ulpinv*aninv / ten
376 IF( itype.EQ.1 )
THEN
381 rwork( indd+i-1 ) = zero
383 CALL pzlaset(
'All', n, n,zzero,zzero, copya, 1, 1, desca )
386 ELSE IF( itype.EQ.2 )
THEN
391 rwork( indd+i-1 ) = one
393 CALL pzlaset(
'All', n, n,zzero,zone, copya, 1, 1, desca )
396 ELSE IF( itype.EQ.4 )
THEN
400 CALL pzfillpad( desca( ctxt_ ), sizetms, 1, work( indwork ),
401 $ sizetms, iprepad, ipostpad, padval+1.0d0 )
403 CALL pzlatms( n, n,
'S', iseed,
'S',rwork( indd ), imode,
404 $ cond, anorm, 0, 0,
'N', copya, 1, 1, desca,
405 $ order, work( indwork+iprepad ), sizetms,
409 CALL pzchekpad( desca( ctxt_ ),
'PZLATMS1-WORK', sizetms, 1,
410 $ work( indwork ), sizetms, iprepad, ipostpad,
413 ELSE IF( itype.EQ.5 )
THEN
417 CALL pzfillpad( desca( ctxt_ ), sizetms, 1, work( indwork ),
418 $ sizetms, iprepad, ipostpad, padval+2.0d0 )
420 CALL pzlatms( n, n,
'S', iseed,
'S',rwork( indd ), imode,
421 $ cond, anorm, n, n,
'N', copya, 1, 1, desca,
422 $ order, work( indwork+iprepad ), sizetms,
425 CALL pzchekpad( desca( ctxt_ ),
'PZLATMS2-WORK', sizetms, 1,
426 $ work( indwork ), sizetms, iprepad, ipostpad,
431 ELSE IF( itype.EQ.8 )
THEN
435 np = numroc( n, desca( mb_ ), myrow, 0, nprow )
436 nq = numroc( n, desca( nb_ ), mycol, 0, npcol )
437 CALL pzmatgen( desca( ctxt_ ),
'H',
'N', n, n, desca( mb_ ),
438 $ desca( nb_ ), copya, desca( lld_ ),
439 $ desca( rsrc_ ), desca( csrc_ ), iseed( 1 ),
440 $ 0, np, 0, nq, myrow, mycol, nprow, npcol )
444 ELSE IF( itype.EQ.9 )
THEN
448 CALL pzfillpad( desca( ctxt_ ), sizetms, 1, work( indwork ),
449 $ sizetms, iprepad, ipostpad, padval+3.0d0 )
451 CALL pzlatms( n, n,
'S', iseed,
'S',rwork( indd ), imode,
452 $ cond, anorm, n, n,
'N', copya, 1, 1, desca,
453 $ order, work( indwork+iprepad ), sizetms,
458 CALL pzchekpad( desca( ctxt_ ),
'PZLATMS3-WORK', sizetms, 1,
459 $ work( indwork ), sizetms, iprepad, ipostpad,
462 ELSE IF( itype.EQ.10 )
THEN
467 CALL pzlaset(
'All', n, n,zzero,zzero, copya, 1, 1, desca )
468 np = numroc( n, desca( mb_ ), 0, 0, nprow )
469 nq = numroc( n, desca( nb_ ), 0, 0, npcol )
475 in =
min( 1+int( dlaran( iseed )*dble( nloc ) ), n-ngen )
477 CALL zlatms( in, in,
'S', iseed,
'P',rwork( indd ),
478 $ imode, cond, anorm, 1, 1,
'N', a, lda,
479 $ work( indwork ), iinfo )
482 temp1 = abs( a( i-1, i ) ) /
483 $ sqrt( abs( a( i-1, i-1 )*a( i, i ) ) )
484 IF( temp1.GT.half )
THEN
485 a( i-1, i ) = half*sqrt( abs( a( i-1, i-1 )*a( i,
487 a( i, i-1 ) = a( i-1, i )
490 CALL pzelset( copya, ngen+1, ngen+1, desca, a( 1, 1 ) )
492 CALL pzelset( copya, ngen+i, ngen+i, desca,
494 CALL pzelset( copya, ngen+i-1, ngen+i, desca,
496 CALL pzelset( copya, ngen+i, ngen+i-1, desca,
504 ELSE IF( itype.EQ.11 )
THEN
513 in =
min( j, n-ngen )
515 rwork( indd+ngen+i ) = temp1
523 CALL pzfillpad( desca( ctxt_ ), sizetms, 1, work( indwork ),
524 $ sizetms, iprepad, ipostpad, padval+4.0d0 )
526 CALL pzlatms( n, n,
'S', iseed,
'S',rwork( indd ), imode,
527 $ cond, anorm, 0, 0,
'N', copya, 1, 1, desca,
528 $ order, work( indwork+iprepad ), sizetms,
531 CALL pzchekpad( desca( ctxt_ ),
'PZLATMS4-WORK', sizetms, 1,
532 $ work( indwork ), sizetms, iprepad, ipostpad,
540 $
CALL dlasrt(
'I', n,rwork( indd ), iinfo )
543 $ iseed,rwork( indd ), maxsize, vecsize,
545 levrsize =
min( maxsize, llrwork )
547 CALL pzseprsubtst( wknown,
'v',
'a', uplo, n, vl, vu, il, iu,
548 $ thresh, abstol, a, copya, z, 1, 1, desca,
549 $ rwork( indd ), win, ifail, iclustr, gap,
550 $ iprepad, ipostpad, work( indwork ), llwork,
551 $ rwork( indrwork ), llrwork,
552 $ levrsize, iwork, isizeevr, res, tstnrm,
558 IF( thresh.LE.zero )
THEN
561 ELSE IF( res.NE.0 )
THEN
567 IF( thresh.GT.zero .AND. lsame( subtests,
'Y' ) )
THEN
576 $ iseed, win( 1+iprepad ), maxsize,
581 CALL pzseprsubtst( .true., jobz, range, uplo, n, vl, vu, il,
582 $ iu, thresh, abstol, a, copya, z, 1, 1,
583 $ desca, win( 1+iprepad ), wnew, ifail,
584 $ iclustr, gap, iprepad, ipostpad,
585 $ work( indwork ), llwork,
586 $ rwork, lrwork, levrsize,
587 $ iwork, isizeevr, res, tstnrm, qtqnrm,
591 maxtstnrm =
max( tstnrm, maxtstnrm )
592 maxqtqnrm =
max( qtqnrm, maxqtqnrm )
593 passed =
'FAILED stest 1'
610 $ iseed, win( 1+iprepad ), maxsize,
615 CALL pzseprsubtst( .true., jobz, range, uplo, n, vl, vu, il,
616 $ iu, thresh, abstol, a, copya, z, 1, 1,
617 $ desca, win( 1+iprepad ), wnew, ifail,
618 $ iclustr, gap, iprepad, ipostpad,
619 $ work( indwork ), llwork,
620 $ rwork, lrwork, levrsize,
621 $ iwork, isizeevr, res, tstnrm, qtqnrm,
625 maxtstnrm =
max( tstnrm, maxtstnrm )
626 maxqtqnrm =
max( qtqnrm, maxqtqnrm )
627 passed =
'FAILED stest 2'
643 $ iseed, win( 1+iprepad ), maxsize,
648 CALL pzseprsubtst( .true., jobz, range, uplo, n, vl, vu, il,
649 $ iu, thresh, abstol, a, copya, z, 1, 1,
650 $ desca, win( 1+iprepad ), wnew, ifail,
651 $ iclustr, gap, iprepad, ipostpad,
652 $ work( indwork ), llwork,
653 $ rwork, lrwork, levrsize,
654 $ iwork, isizeevr, res, tstnrm, qtqnrm,
658 maxtstnrm =
max( tstnrm, maxtstnrm )
659 maxqtqnrm =
max( qtqnrm, maxqtqnrm )
660 passed =
'FAILED stest 3'
676 $ iseed, win( 1+iprepad ), maxsize,
681 CALL pzseprsubtst( .true., jobz, range, uplo, n, vl, vu, il,
682 $ iu, thresh, abstol, a, copya, z, 1, 1,
683 $ desca, win( 1+iprepad ), wnew, ifail,
684 $ iclustr, gap, iprepad, ipostpad,
685 $ work( indwork ), llwork,
686 $ rwork, lrwork, levrsize,
687 $ iwork, isizeevr, res, tstnrm, qtqnrm,
691 maxtstnrm =
max( tstnrm, maxtstnrm )
692 maxqtqnrm =
max( qtqnrm, maxqtqnrm )
693 passed =
'FAILED stest 4'
709 $ iseed, win( 1+iprepad ), maxsize,
714 CALL pzseprsubtst( .true., jobz, range, uplo, n, vl, vu, il,
715 $ iu, thresh, abstol, a, copya, z, 1, 1,
716 $ desca, win( 1+iprepad ), wnew, ifail,
717 $ iclustr, gap, iprepad, ipostpad,
718 $ work( indwork ), llwork,
719 $ rwork, lrwork, levrsize,
720 $ iwork, isizeevr, res, tstnrm, qtqnrm,
724 maxtstnrm =
max( tstnrm, maxtstnrm )
725 maxqtqnrm =
max( qtqnrm, maxqtqnrm )
726 passed =
'FAILED stest 5'
732 CALL igamx2d( context,
'All',
' ', 1, 1, info, 1, -1, -1, -1, -1,
735 IF( iam.EQ.0 .AND. .false. )
THEN
736 WRITE( nout, fmt = 9994 )
'C '
737 WRITE( nout, fmt = 9993 )iseedin( 1 )
738 WRITE( nout, fmt = 9992 )iseedin( 2 )
739 WRITE( nout, fmt = 9991 )iseedin( 3 )
740 WRITE( nout, fmt = 9990 )iseedin( 4 )
741 IF( lsame( uplo,
'L' ) )
THEN
742 WRITE( nout, fmt = 9994 )
' UPLO= ''L'' '
744 WRITE( nout, fmt = 9994 )
' UPLO= ''U'' '
746 IF( lsame( subtests,
'Y' ) )
THEN
747 WRITE( nout, fmt = 9994 )
' SUBTESTS= ''Y'' '
749 WRITE( nout, fmt = 9994 )
' SUBTESTS= ''N'' '
751 WRITE( nout, fmt = 9989 )n
752 WRITE( nout, fmt = 9988 )nprow
753 WRITE( nout, fmt = 9987 )npcol
754 WRITE( nout, fmt = 9986 )nb
755 WRITE( nout, fmt = 9985 )mattype
756 WRITE( nout, fmt = 9982 )abstol
757 WRITE( nout, fmt = 9981 )thresh
758 WRITE( nout, fmt = 9994 )
'C '
762 CALL slcombine( context,
'All',
'>',
'W', 6, 1, wtime )
763 CALL slcombine( context,
'All',
'>',
'C', 6, 1, ctime )
765 IF( info.EQ.0 .OR. info.EQ.1 )
THEN
766 IF( wtime( 1 ).GE.0.0 )
THEN
767 WRITE( nout, fmt = 9999 )n, nb, nprow, npcol, mattype,
768 $ subtests, wtime( 1 ), ctime( 1 ), maxtstnrm,
771 WRITE( nout, fmt = 9998 )n, nb, nprow, npcol, mattype,
772 $ subtests, ctime( 1 ), maxtstnrm, maxqtqnrm, passed
774 ELSE IF( info.EQ.2 )
THEN
775 IF( wtime( 1 ).GE.0.0 )
THEN
776 WRITE( nout, fmt = 9997 )n, nb, nprow, npcol, mattype,
777 $ subtests, wtime( 1 ), ctime( 1 )
779 WRITE( nout, fmt = 9996 )n, nb, nprow, npcol, mattype,
780 $ subtests, ctime( 1 )
782 ELSE IF( info.EQ.3 )
THEN
783 WRITE( nout, fmt = 9995 )n, nb, nprow, npcol, mattype,
791 9999
FORMAT( 1x, i5, 1x, i3, 1x, i3, 1x, i3, 1x, i3, 3x, a1, 1x,
792 $ f8.2, 1x, f8.2, 1x, g9.2, 1x, g9.2, 1x, a14 )
793 9998
FORMAT( 1x, i5, 1x, i3, 1x, i3, 1x, i3, 1x, i3, 3x, a1, 1x, 8x,
794 $ 1x, f8.2, 1x, g9.2, 1x, g9.2, a14 )
795 9997
FORMAT( 1x, i5, 1x, i3, 1x, i3, 1x, i3, 1x, i3, 3x, a1, 1x, f8.2,
796 $ 1x, f8.2, 21x,
'Bypassed' )
797 9996
FORMAT( 1x, i5, 1x, i3, 1x, i3, 1x, i3, 1x, i3, 3x, a1, 1x, 8x,
798 $ 1x, f8.2, 21x,
'Bypassed' )
799 9995
FORMAT( 1x, i5, 1x, i3, 1x, i3, 1x, i3, 1x, i3, 3x, a1, 32x,
800 $
'Bad MEMORY parameters' )
802 9993
FORMAT(
' ISEED( 1 ) =', i8 )
803 9992
FORMAT(
' ISEED( 2 ) =', i8 )
804 9991
FORMAT(
' ISEED( 3 ) =', i8 )
805 9990
FORMAT(
' ISEED( 4 ) =', i8 )
806 9989
FORMAT(
' N=', i8 )
807 9988
FORMAT(
' NPROW=', i8 )
808 9987
FORMAT(
' NPCOL=', i8 )
809 9986
FORMAT(
' NB=', i8 )
810 9985
FORMAT(
' MATTYPE=', i8 )
813 9982
FORMAT(
' ABSTOL=', d16.6 )
814 9981
FORMAT(
' THRESH=', d16.6 )