Skip to content

Use dynamic allocation in the LIN tests as well #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions TESTING/LIN/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(SCLNTST slaord.f)

set(DZLNTST dlaord.f)

set(SLINTST schkaa.f
set(SLINTST schkaa.F
schkeq.f schkgb.f schkge.f schkgt.f
schklq.f schkpb.f schkpo.f schkps.f schkpp.f
schkpt.f schkq3.f schkql.f schkqr.f schkrq.f
Expand Down Expand Up @@ -51,7 +51,7 @@ else()
serrvx.f serrge.f serrsy.f serrpo.f)
endif()

set(CLINTST cchkaa.f
set(CLINTST cchkaa.F
cchkeq.f cchkgb.f cchkge.f cchkgt.f
cchkhe.f cchkhe_rook.f cchkhe_rk.f
cchkhe_aa.f cchkhe_aa_2stage.f
Expand Down Expand Up @@ -107,7 +107,7 @@ else()
cerrvx.f cerrge.f cerrhe.f cerrsy.f cerrpo.f)
endif()

set(DLINTST dchkaa.f
set(DLINTST dchkaa.F
dchkeq.f dchkgb.f dchkge.f dchkgt.f
dchklq.f dchkpb.f dchkpo.f dchkps.f dchkpp.f
dchkpt.f dchkq3.f dchkql.f dchkqr.f dchkrq.f
Expand Down Expand Up @@ -153,7 +153,7 @@ else()
derrvx.f derrge.f derrsy.f derrpo.f)
endif()

set(ZLINTST zchkaa.f
set(ZLINTST zchkaa.F
zchkeq.f zchkgb.f zchkge.f zchkgt.f
zchkhe.f zchkhe_rook.f zchkhe_rk.f
zchkhe_aa.f zchkhe_aa_2stage.f
Expand Down
8 changes: 4 additions & 4 deletions TESTING/LIN/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@ cleanobj:
cleanexe:
rm -f xlintst*

schkaa.o: schkaa.f
schkaa.o: schkaa.F
$(FC) $(FFLAGS_DRV) -c -o $@ $<
dchkaa.o: dchkaa.f
dchkaa.o: dchkaa.F
$(FC) $(FFLAGS_DRV) -c -o $@ $<
cchkaa.o: cchkaa.f
cchkaa.o: cchkaa.F
$(FC) $(FFLAGS_DRV) -c -o $@ $<
zchkaa.o: zchkaa.f
zchkaa.o: zchkaa.F
$(FC) $(FFLAGS_DRV) -c -o $@ $<

.NOTPARALLEL:
26 changes: 23 additions & 3 deletions TESTING/LIN/cchkaa.f → TESTING/LIN/cchkaa.F
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,13 @@ PROGRAM CCHKAA
$ NBVAL( MAXIN ), NBVAL2( MAXIN ),
$ NSVAL( MAXIN ), NVAL( MAXIN ), NXVAL( MAXIN ),
$ RANKVAL( MAXIN ), PIV( NMAX )
REAL RWORK( 150*NMAX+2*MAXRHS ), S( 2*NMAX )
COMPLEX A( ( KDMAX+1 )*NMAX, 7 ), B( NMAX*MAXRHS, 4 ),
$ E( NMAX ), WORK( NMAX, NMAX+MAXRHS+10 )
REAL S( 2*NMAX )
COMPLEX E( NMAX )
* ..
* .. Allocatable Arrays ..
INTEGER AllocateStatus
REAL, DIMENSION(:), ALLOCATABLE :: RWORK
COMPLEX, DIMENSION(:,:), ALLOCATABLE :: A, B, WORK
* ..
* .. External Functions ..
LOGICAL LSAME, LSAMEN
Expand Down Expand Up @@ -191,6 +195,17 @@ PROGRAM CCHKAA
* .. Data statements ..
DATA THREQ / 2.0 / , INTSTR / '0123456789' /
* ..
* .. Allocate memory dynamically ..
*
ALLOCATE ( A( ( KDMAX+1 )*NMAX, 7 ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( WORK( NMAX, NMAX+MAXRHS+10 ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( RWORK( 150*NMAX+2*MAXRHS ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
* ..
* .. Executable Statements ..
*
S1 = SECOND( )
Expand Down Expand Up @@ -1193,6 +1208,11 @@ PROGRAM CCHKAA
S2 = SECOND( )
WRITE( NOUT, FMT = 9998 )
WRITE( NOUT, FMT = 9997 )S2 - S1
*
DEALLOCATE (A, STAT = AllocateStatus)
DEALLOCATE (B, STAT = AllocateStatus)
DEALLOCATE (WORK, STAT = AllocateStatus)
DEALLOCATE (RWORK, STAT = AllocateStatus)
*
9999 FORMAT( / ' Execution not attempted due to input errors' )
9998 FORMAT( / ' End of tests' )
Expand Down
27 changes: 23 additions & 4 deletions TESTING/LIN/dchkaa.f → TESTING/LIN/dchkaa.F
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ PROGRAM DCHKAA
* -- LAPACK test routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* Novemebr 2019
*
* =====================================================================
*
Expand Down Expand Up @@ -150,9 +149,12 @@ PROGRAM DCHKAA
$ NBVAL( MAXIN ), NBVAL2( MAXIN ),
$ NSVAL( MAXIN ), NVAL( MAXIN ), NXVAL( MAXIN ),
$ RANKVAL( MAXIN ), PIV( NMAX )
DOUBLE PRECISION A( ( KDMAX+1 )*NMAX, 7 ), B( NMAX*MAXRHS, 4 ),
$ E( NMAX ), RWORK( 5*NMAX+2*MAXRHS ),
$ S( 2*NMAX ), WORK( NMAX, 3*NMAX+MAXRHS+30 )
DOUBLE PRECISION E( NMAX ), S( 2*NMAX )
* ..
* .. Allocatable Arrays ..
INTEGER AllocateStatus
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: RWORK
DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE :: A, B, WORK
* ..
* .. External Functions ..
LOGICAL LSAME, LSAMEN
Expand Down Expand Up @@ -186,6 +188,18 @@ PROGRAM DCHKAA
* .. Data statements ..
DATA THREQ / 2.0D0 / , INTSTR / '0123456789' /
* ..
* ..
* .. Allocate memory dynamically ..
*
ALLOCATE ( A( ( KDMAX+1 )*NMAX, 7 ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( WORK( NMAX, 3*NMAX+MAXRHS+30 ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE ( RWORK( 5*NMAX+2*MAXRHS ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
*
* .. Executable Statements ..
*
S1 = DSECND( )
Expand Down Expand Up @@ -1037,6 +1051,11 @@ PROGRAM DCHKAA
S2 = DSECND( )
WRITE( NOUT, FMT = 9998 )
WRITE( NOUT, FMT = 9997 )S2 - S1
*
DEALLOCATE (A, STAT = AllocateStatus)
DEALLOCATE (B, STAT = AllocateStatus)
DEALLOCATE (WORK, STAT = AllocateStatus)
DEALLOCATE (RWORK, STAT = AllocateStatus)
*
9999 FORMAT( / ' Execution not attempted due to input errors' )
9998 FORMAT( / ' End of tests' )
Expand Down
25 changes: 22 additions & 3 deletions TESTING/LIN/schkaa.f → TESTING/LIN/schkaa.F
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,12 @@ PROGRAM SCHKAA
$ NBVAL( MAXIN ), NBVAL2( MAXIN ),
$ NSVAL( MAXIN ), NVAL( MAXIN ), NXVAL( MAXIN ),
$ RANKVAL( MAXIN ), PIV( NMAX )
REAL A( ( KDMAX+1 )*NMAX, 7 ), B( NMAX*MAXRHS, 4 ),
$ E( NMAX ), RWORK( 5*NMAX+2*MAXRHS ),
$ S( 2*NMAX ), WORK( NMAX, NMAX+MAXRHS+30 )
REAL E( NMAX ), S( 2*NMAX )
* ..
* .. Allocatable Arrays ..
INTEGER AllocateStatus
REAL, DIMENSION(:), ALLOCATABLE :: RWORK
REAL, DIMENSION(:,:), ALLOCATABLE :: A, B, WORK
* ..
* .. External Functions ..
LOGICAL LSAME, LSAMEN
Expand Down Expand Up @@ -183,6 +186,17 @@ PROGRAM SCHKAA
* .. Data statements ..
DATA THREQ / 2.0E0 / , INTSTR / '0123456789' /
* ..
* .. Allocate memory dynamically ..
*
ALLOCATE (A( ( KDMAX+1 )*NMAX, 7 ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE (B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE (WORK( NMAX, NMAX+MAXRHS+30 ) , STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE (RWORK( 5*NMAX+2*MAXRHS ), STAT = AllocateStatus )
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
* ..
* .. Executable Statements ..
*
S1 = SECOND( )
Expand Down Expand Up @@ -1031,6 +1045,11 @@ PROGRAM SCHKAA
S2 = SECOND( )
WRITE( NOUT, FMT = 9998 )
WRITE( NOUT, FMT = 9997 )S2 - S1
*
DEALLOCATE (A, STAT = AllocateStatus)
DEALLOCATE (B, STAT = AllocateStatus)
DEALLOCATE (WORK, STAT = AllocateStatus)
DEALLOCATE (RWORK, STAT = AllocateStatus)
*
9999 FORMAT( / ' Execution not attempted due to input errors' )
9998 FORMAT( / ' End of tests' )
Expand Down
25 changes: 22 additions & 3 deletions TESTING/LIN/zchkaa.f → TESTING/LIN/zchkaa.F
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,13 @@ PROGRAM ZCHKAA
$ NBVAL( MAXIN ), NBVAL2( MAXIN ),
$ NSVAL( MAXIN ), NVAL( MAXIN ), NXVAL( MAXIN ),
$ RANKVAL( MAXIN ), PIV( NMAX )
DOUBLE PRECISION RWORK( 150*NMAX+2*MAXRHS ), S( 2*NMAX )
COMPLEX*16 A( ( KDMAX+1 )*NMAX, 7 ), B( NMAX*MAXRHS, 4 ),
$ E( NMAX ), WORK( NMAX, NMAX+MAXRHS+10 )
DOUBLE PRECISION S( 2*NMAX )
COMPLEX*16 E( NMAX )
*
* .. Allocatable Arrays ..
INTEGER AllocateStatus
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE:: RWORK
COMPLEX*16, DIMENSION(:,:), ALLOCATABLE:: A, B, WORK
* ..
* .. External Functions ..
LOGICAL LSAME, LSAMEN
Expand Down Expand Up @@ -191,6 +195,16 @@ PROGRAM ZCHKAA
* ..
* .. Data statements ..
DATA THREQ / 2.0D0 / , INTSTR / '0123456789' /
*
* .. Allocate memory dynamically ..
ALLOCATE (RWORK( 150*NMAX+2*MAXRHS ), STAT = AllocateStatus)
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE (A ((KDMAX+1) * NMAX, 7), STAT = AllocateStatus)
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE (B (NMAX * MAXRHS, 4), STAT = AllocateStatus)
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
ALLOCATE (WORK (NMAX, NMAX+MAXRHS+10), STAT = AllocateStatus)
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
* ..
* .. Executable Statements ..
*
Expand Down Expand Up @@ -1228,6 +1242,11 @@ PROGRAM ZCHKAA
S2 = DSECND( )
WRITE( NOUT, FMT = 9998 )
WRITE( NOUT, FMT = 9997 )S2 - S1
*
DEALLOCATE (A, STAT = AllocateStatus)
DEALLOCATE (B, STAT = AllocateStatus)
DEALLOCATE (RWORK, STAT = AllocateStatus)
DEALLOCATE (WORK, STAT = AllocateStatus)
*
9999 FORMAT( / ' Execution not attempted due to input errors' )
9998 FORMAT( / ' End of tests' )
Expand Down