diff options
author | julie <julielangou@users.noreply.github.com> | 2011-02-09 19:45:09 +0000 |
---|---|---|
committer | julie <julielangou@users.noreply.github.com> | 2011-02-09 19:45:09 +0000 |
commit | 1653528c2b12fdd01738b55ab82ffbe47049c0ba (patch) | |
tree | 083876df2737892f51272a0eeb5aed7345a71530 /SRC/dsysv.f | |
parent | 25a1c9440f7dfdbb57263f769a0fa096c78dbf18 (diff) | |
download | lapack-1653528c2b12fdd01738b55ab82ffbe47049c0ba.tar.gz lapack-1653528c2b12fdd01738b55ab82ffbe47049c0ba.tar.bz2 lapack-1653528c2b12fdd01738b55ab82ffbe47049c0ba.zip |
Fix bug 0074
Post from Alexander Kobotov (INTEL)
In LAPACK 3.3 ?(SY/HE)SV are updated to use TRS2.
The TRS2 requires WORK(N) to operate, whereas in SV requirements for LWORK just to be >=1.
There is no any check in SV if LWORK>=N, the array WORK just passed as it is to TRS2.
So if LWORK<N a crash could occur while executing TRS2 due to overuse of allocated workspace.
I guess for the case of LWORK<N just previsous Level2 based ?(SY/HE)TRS should be used.
Diffstat (limited to 'SRC/dsysv.f')
-rw-r--r-- | SRC/dsysv.f | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/SRC/dsysv.f b/SRC/dsysv.f index 1b20643f..2c8a43e5 100644 --- a/SRC/dsysv.f +++ b/SRC/dsysv.f @@ -1,10 +1,11 @@ SUBROUTINE DSYSV( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, $ LWORK, INFO ) * -* -- LAPACK driver routine (version 3.2.2) -- +* -- LAPACK driver routine (version 3.3.0) -- * -- LAPACK is a software package provided by Univ. of Tennessee, -- * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- -* May 2010 +* February 2011 +* @generated d * * .. Scalar Arguments .. CHARACTER UPLO @@ -88,6 +89,8 @@ * The length of WORK. LWORK >= 1, and for best performance * LWORK >= max(1,N*NB), where NB is the optimal blocksize for * DSYTRF. +* for LWORK < N, TRS will be done with Level BLAS 2 +* for LWORK >= N, TRS will be done with Level BLAS 3 * * If LWORK = -1, then a workspace query is assumed; the routine * only calculates the optimal size of the WORK array, returns @@ -113,7 +116,7 @@ EXTERNAL LSAME, ILAENV * .. * .. External Subroutines .. - EXTERNAL DSYTRF, DSYTRS2, XERBLA + EXTERNAL XERBLA, DSYTRF, DSYTRS, DSYTRS2 * .. * .. Intrinsic Functions .. INTRINSIC MAX @@ -160,9 +163,21 @@ CALL DSYTRF( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO ) IF( INFO.EQ.0 ) THEN * -* Solve the system A*X = B, overwriting B with X. +* Solve the system A*X = B, overwriting B with X. * - CALL DSYTRS2( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO ) + IF ( LWORK.LT.N ) THEN +* +* Solve with TRS ( Use Level BLAS 2) +* + CALL DSYTRS( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO ) +* + ELSE +* +* Solve with TRS2 ( Use Level BLAS 3) +* + CALL DSYTRS2( UPLO,N,NRHS,A,LDA,IPIV,B,LDB,WORK,INFO ) +* + END IF * END IF * |