Skip to content

Commit 164551d

Browse files
authored
Merge pull request #3232 from martin-frbg/lapack553
Reduce stack size requirements in the LAPACK LIN tests (LAPACK PR 553)
2 parents 310b76a + 15b9d6b commit 164551d

File tree

6 files changed

+103
-37
lines changed

6 files changed

+103
-37
lines changed

lapack-netlib/TESTING/LIN/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(SCLNTST slaord.f)
66

77
set(DZLNTST dlaord.f)
88

9-
set(SLINTST schkaa.f
9+
set(SLINTST schkaa.F
1010
schkeq.f schkgb.f schkge.f schkgt.f
1111
schklq.f schkpb.f schkpo.f schkps.f schkpp.f
1212
schkpt.f schkq3.f schkql.f schkqr.f schkrq.f
@@ -51,7 +51,7 @@ else()
5151
serrvx.f serrge.f serrsy.f serrpo.f)
5252
endif()
5353

54-
set(CLINTST cchkaa.f
54+
set(CLINTST cchkaa.F
5555
cchkeq.f cchkgb.f cchkge.f cchkgt.f
5656
cchkhe.f cchkhe_rook.f cchkhe_rk.f
5757
cchkhe_aa.f cchkhe_aa_2stage.f
@@ -107,7 +107,7 @@ else()
107107
cerrvx.f cerrge.f cerrhe.f cerrsy.f cerrpo.f)
108108
endif()
109109

110-
set(DLINTST dchkaa.f
110+
set(DLINTST dchkaa.F
111111
dchkeq.f dchkgb.f dchkge.f dchkgt.f
112112
dchklq.f dchkpb.f dchkpo.f dchkps.f dchkpp.f
113113
dchkpt.f dchkq3.f dchkql.f dchkqr.f dchkrq.f
@@ -153,7 +153,7 @@ else()
153153
derrvx.f derrge.f derrsy.f derrpo.f)
154154
endif()
155155

156-
set(ZLINTST zchkaa.f
156+
set(ZLINTST zchkaa.F
157157
zchkeq.f zchkgb.f zchkge.f zchkgt.f
158158
zchkhe.f zchkhe_rook.f zchkhe_rk.f
159159
zchkhe_aa.f zchkhe_aa_2stage.f

lapack-netlib/TESTING/LIN/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,13 @@ cleanobj:
317317
cleanexe:
318318
rm -f xlintst*
319319

320-
schkaa.o: schkaa.f
320+
schkaa.o: schkaa.F
321321
$(FC) $(FFLAGS_DRV) -c -o $@ $<
322-
dchkaa.o: dchkaa.f
322+
dchkaa.o: dchkaa.F
323323
$(FC) $(FFLAGS_DRV) -c -o $@ $<
324-
cchkaa.o: cchkaa.f
324+
cchkaa.o: cchkaa.F
325325
$(FC) $(FFLAGS_DRV) -c -o $@ $<
326-
zchkaa.o: zchkaa.f
326+
zchkaa.o: zchkaa.F
327327
$(FC) $(FFLAGS_DRV) -c -o $@ $<
328328

329329
.NOTPARALLEL:

lapack-netlib/TESTING/LIN/cchkaa.f renamed to lapack-netlib/TESTING/LIN/cchkaa.F

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,14 @@
110110
*> \author Univ. of Colorado Denver
111111
*> \author NAG Ltd.
112112
*
113-
*> \date November 2019
114-
*
115113
*> \ingroup complex_lin
116114
*
117115
* =====================================================================
118116
PROGRAM CCHKAA
119117
*
120-
* -- LAPACK test routine (version 3.9.0) --
118+
* -- LAPACK test routine --
121119
* -- LAPACK is a software package provided by Univ. of Tennessee, --
122120
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
123-
* November 2017
124121
*
125122
* =====================================================================
126123
*
@@ -156,9 +153,13 @@ PROGRAM CCHKAA
156153
$ NBVAL( MAXIN ), NBVAL2( MAXIN ),
157154
$ NSVAL( MAXIN ), NVAL( MAXIN ), NXVAL( MAXIN ),
158155
$ RANKVAL( MAXIN ), PIV( NMAX )
159-
REAL RWORK( 150*NMAX+2*MAXRHS ), S( 2*NMAX )
160-
COMPLEX A( ( KDMAX+1 )*NMAX, 7 ), B( NMAX*MAXRHS, 4 ),
161-
$ E( NMAX ), WORK( NMAX, NMAX+MAXRHS+10 )
156+
REAL S( 2*NMAX )
157+
COMPLEX E( NMAX )
158+
* ..
159+
* .. Allocatable Arrays ..
160+
INTEGER AllocateStatus
161+
REAL, DIMENSION(:), ALLOCATABLE :: RWORK
162+
COMPLEX, DIMENSION(:,:), ALLOCATABLE :: A, B, WORK
162163
* ..
163164
* .. External Functions ..
164165
LOGICAL LSAME, LSAMEN
@@ -194,6 +195,17 @@ PROGRAM CCHKAA
194195
* .. Data statements ..
195196
DATA THREQ / 2.0 / , INTSTR / '0123456789' /
196197
* ..
198+
* .. Allocate memory dynamically ..
199+
*
200+
ALLOCATE ( A( ( KDMAX+1 )*NMAX, 7 ), STAT = AllocateStatus )
201+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
202+
ALLOCATE ( B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus )
203+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
204+
ALLOCATE ( WORK( NMAX, NMAX+MAXRHS+10 ), STAT = AllocateStatus )
205+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
206+
ALLOCATE ( RWORK( 150*NMAX+2*MAXRHS ), STAT = AllocateStatus )
207+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
208+
* ..
197209
* .. Executable Statements ..
198210
*
199211
S1 = SECOND( )
@@ -1196,6 +1208,11 @@ PROGRAM CCHKAA
11961208
S2 = SECOND( )
11971209
WRITE( NOUT, FMT = 9998 )
11981210
WRITE( NOUT, FMT = 9997 )S2 - S1
1211+
*
1212+
DEALLOCATE (A, STAT = AllocateStatus)
1213+
DEALLOCATE (B, STAT = AllocateStatus)
1214+
DEALLOCATE (WORK, STAT = AllocateStatus)
1215+
DEALLOCATE (RWORK, STAT = AllocateStatus)
11991216
*
12001217
9999 FORMAT( / ' Execution not attempted due to input errors' )
12011218
9998 FORMAT( / ' End of tests' )

lapack-netlib/TESTING/LIN/dchkaa.f renamed to lapack-netlib/TESTING/LIN/dchkaa.F

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,14 @@
106106
*> \author Univ. of Colorado Denver
107107
*> \author NAG Ltd.
108108
*
109-
*> \date November 2019
110-
*
111109
*> \ingroup double_lin
112110
*
113111
* =====================================================================
114112
PROGRAM DCHKAA
115113
*
116-
* -- LAPACK test routine (version 3.9.0) --
114+
* -- LAPACK test routine --
117115
* -- LAPACK is a software package provided by Univ. of Tennessee, --
118116
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
119-
* Novemebr 2019
120117
*
121118
* =====================================================================
122119
*
@@ -152,9 +149,12 @@ PROGRAM DCHKAA
152149
$ NBVAL( MAXIN ), NBVAL2( MAXIN ),
153150
$ NSVAL( MAXIN ), NVAL( MAXIN ), NXVAL( MAXIN ),
154151
$ RANKVAL( MAXIN ), PIV( NMAX )
155-
DOUBLE PRECISION A( ( KDMAX+1 )*NMAX, 7 ), B( NMAX*MAXRHS, 4 ),
156-
$ E( NMAX ), RWORK( 5*NMAX+2*MAXRHS ),
157-
$ S( 2*NMAX ), WORK( NMAX, 3*NMAX+MAXRHS+30 )
152+
DOUBLE PRECISION E( NMAX ), S( 2*NMAX )
153+
* ..
154+
* .. Allocatable Arrays ..
155+
INTEGER AllocateStatus
156+
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: RWORK
157+
DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE :: A, B, WORK
158158
* ..
159159
* .. External Functions ..
160160
LOGICAL LSAME, LSAMEN
@@ -188,6 +188,18 @@ PROGRAM DCHKAA
188188
* .. Data statements ..
189189
DATA THREQ / 2.0D0 / , INTSTR / '0123456789' /
190190
* ..
191+
* ..
192+
* .. Allocate memory dynamically ..
193+
*
194+
ALLOCATE ( A( ( KDMAX+1 )*NMAX, 7 ), STAT = AllocateStatus )
195+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
196+
ALLOCATE ( B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus )
197+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
198+
ALLOCATE ( WORK( NMAX, 3*NMAX+MAXRHS+30 ), STAT = AllocateStatus )
199+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
200+
ALLOCATE ( RWORK( 5*NMAX+2*MAXRHS ), STAT = AllocateStatus )
201+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
202+
*
191203
* .. Executable Statements ..
192204
*
193205
S1 = DSECND( )
@@ -677,7 +689,7 @@ PROGRAM DCHKAA
677689
*
678690
* SK: symmetric indefinite matrices,
679691
* with bounded Bunch-Kaufman (rook) pivoting algorithm,
680-
* differnet matrix storage format than SR path version.
692+
* different matrix storage format than SR path version.
681693
*
682694
NTYPES = 10
683695
CALL ALAREQ( PATH, NMATS, DOTYPE, NTYPES, NIN, NOUT )
@@ -1039,6 +1051,11 @@ PROGRAM DCHKAA
10391051
S2 = DSECND( )
10401052
WRITE( NOUT, FMT = 9998 )
10411053
WRITE( NOUT, FMT = 9997 )S2 - S1
1054+
*
1055+
DEALLOCATE (A, STAT = AllocateStatus)
1056+
DEALLOCATE (B, STAT = AllocateStatus)
1057+
DEALLOCATE (WORK, STAT = AllocateStatus)
1058+
DEALLOCATE (RWORK, STAT = AllocateStatus)
10421059
*
10431060
9999 FORMAT( / ' Execution not attempted due to input errors' )
10441061
9998 FORMAT( / ' End of tests' )

lapack-netlib/TESTING/LIN/schkaa.f renamed to lapack-netlib/TESTING/LIN/schkaa.F

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,14 @@
104104
*> \author Univ. of Colorado Denver
105105
*> \author NAG Ltd.
106106
*
107-
*> \date November 2019
108-
*
109107
*> \ingroup single_lin
110108
*
111109
* =====================================================================
112110
PROGRAM SCHKAA
113111
*
114-
* -- LAPACK test routine (version 3.9.0) --
112+
* -- LAPACK test routine --
115113
* -- LAPACK is a software package provided by Univ. of Tennessee, --
116114
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
117-
* November 2019
118115
*
119116
* =====================================================================
120117
*
@@ -150,9 +147,12 @@ PROGRAM SCHKAA
150147
$ NBVAL( MAXIN ), NBVAL2( MAXIN ),
151148
$ NSVAL( MAXIN ), NVAL( MAXIN ), NXVAL( MAXIN ),
152149
$ RANKVAL( MAXIN ), PIV( NMAX )
153-
REAL A( ( KDMAX+1 )*NMAX, 7 ), B( NMAX*MAXRHS, 4 ),
154-
$ E( NMAX ), RWORK( 5*NMAX+2*MAXRHS ),
155-
$ S( 2*NMAX ), WORK( NMAX, NMAX+MAXRHS+30 )
150+
REAL E( NMAX ), S( 2*NMAX )
151+
* ..
152+
* .. Allocatable Arrays ..
153+
INTEGER AllocateStatus
154+
REAL, DIMENSION(:), ALLOCATABLE :: RWORK
155+
REAL, DIMENSION(:,:), ALLOCATABLE :: A, B, WORK
156156
* ..
157157
* .. External Functions ..
158158
LOGICAL LSAME, LSAMEN
@@ -186,6 +186,17 @@ PROGRAM SCHKAA
186186
* .. Data statements ..
187187
DATA THREQ / 2.0E0 / , INTSTR / '0123456789' /
188188
* ..
189+
* .. Allocate memory dynamically ..
190+
*
191+
ALLOCATE (A( ( KDMAX+1 )*NMAX, 7 ), STAT = AllocateStatus )
192+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
193+
ALLOCATE (B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus )
194+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
195+
ALLOCATE (WORK( NMAX, NMAX+MAXRHS+30 ) , STAT = AllocateStatus )
196+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
197+
ALLOCATE (RWORK( 5*NMAX+2*MAXRHS ), STAT = AllocateStatus )
198+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
199+
* ..
189200
* .. Executable Statements ..
190201
*
191202
S1 = SECOND( )
@@ -1034,6 +1045,11 @@ PROGRAM SCHKAA
10341045
S2 = SECOND( )
10351046
WRITE( NOUT, FMT = 9998 )
10361047
WRITE( NOUT, FMT = 9997 )S2 - S1
1048+
*
1049+
DEALLOCATE (A, STAT = AllocateStatus)
1050+
DEALLOCATE (B, STAT = AllocateStatus)
1051+
DEALLOCATE (WORK, STAT = AllocateStatus)
1052+
DEALLOCATE (RWORK, STAT = AllocateStatus)
10371053
*
10381054
9999 FORMAT( / ' Execution not attempted due to input errors' )
10391055
9998 FORMAT( / ' End of tests' )

lapack-netlib/TESTING/LIN/zchkaa.f renamed to lapack-netlib/TESTING/LIN/zchkaa.F

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,14 @@
110110
*> \author Univ. of Colorado Denver
111111
*> \author NAG Ltd.
112112
*
113-
*> \date November 2019
114-
*
115113
*> \ingroup complex16_lin
116114
*
117115
* =====================================================================
118116
PROGRAM ZCHKAA
119117
*
120-
* -- LAPACK test routine (version 3.9.0) --
118+
* -- LAPACK test routine --
121119
* -- LAPACK is a software package provided by Univ. of Tennessee, --
122120
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
123-
* November 2019
124121
*
125122
* =====================================================================
126123
*
@@ -156,9 +153,13 @@ PROGRAM ZCHKAA
156153
$ NBVAL( MAXIN ), NBVAL2( MAXIN ),
157154
$ NSVAL( MAXIN ), NVAL( MAXIN ), NXVAL( MAXIN ),
158155
$ RANKVAL( MAXIN ), PIV( NMAX )
159-
DOUBLE PRECISION RWORK( 150*NMAX+2*MAXRHS ), S( 2*NMAX )
160-
COMPLEX*16 A( ( KDMAX+1 )*NMAX, 7 ), B( NMAX*MAXRHS, 4 ),
161-
$ E( NMAX ), WORK( NMAX, NMAX+MAXRHS+10 )
156+
DOUBLE PRECISION S( 2*NMAX )
157+
COMPLEX*16 E( NMAX )
158+
*
159+
* .. Allocatable Arrays ..
160+
INTEGER AllocateStatus
161+
DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE:: RWORK
162+
COMPLEX*16, DIMENSION(:,:), ALLOCATABLE:: A, B, WORK
162163
* ..
163164
* .. External Functions ..
164165
LOGICAL LSAME, LSAMEN
@@ -194,6 +195,16 @@ PROGRAM ZCHKAA
194195
* ..
195196
* .. Data statements ..
196197
DATA THREQ / 2.0D0 / , INTSTR / '0123456789' /
198+
*
199+
* .. Allocate memory dynamically ..
200+
ALLOCATE (RWORK( 150*NMAX+2*MAXRHS ), STAT = AllocateStatus)
201+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
202+
ALLOCATE (A ((KDMAX+1) * NMAX, 7), STAT = AllocateStatus)
203+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
204+
ALLOCATE (B (NMAX * MAXRHS, 4), STAT = AllocateStatus)
205+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
206+
ALLOCATE (WORK (NMAX, NMAX+MAXRHS+10), STAT = AllocateStatus)
207+
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
197208
* ..
198209
* .. Executable Statements ..
199210
*
@@ -1231,6 +1242,11 @@ PROGRAM ZCHKAA
12311242
S2 = DSECND( )
12321243
WRITE( NOUT, FMT = 9998 )
12331244
WRITE( NOUT, FMT = 9997 )S2 - S1
1245+
*
1246+
DEALLOCATE (A, STAT = AllocateStatus)
1247+
DEALLOCATE (B, STAT = AllocateStatus)
1248+
DEALLOCATE (RWORK, STAT = AllocateStatus)
1249+
DEALLOCATE (WORK, STAT = AllocateStatus)
12341250
*
12351251
9999 FORMAT( / ' Execution not attempted due to input errors' )
12361252
9998 FORMAT( / ' End of tests' )

0 commit comments

Comments
 (0)