From 1653528c2b12fdd01738b55ab82ffbe47049c0ba Mon Sep 17 00:00:00 2001 From: julie Date: Wed, 9 Feb 2011 19:45:09 +0000 Subject: 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= 1, and for best performance * LWORK >= max(1,N*NB), where NB is the optimal blocksize for * CHETRF. +* 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 @@ -110,10 +113,10 @@ * .. External Functions .. LOGICAL LSAME INTEGER ILAENV - EXTERNAL ILAENV, LSAME + EXTERNAL LSAME, ILAENV * .. * .. External Subroutines .. - EXTERNAL CHETRF, CHETRS2, XERBLA + EXTERNAL XERBLA, CHETRF, ZHETRS, CHETRS2 * .. * .. Intrinsic Functions .. INTRINSIC MAX @@ -162,7 +165,19 @@ * * Solve the system A*X = B, overwriting B with X. * - CALL CHETRS2( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO ) + IF ( LWORK.LT.N ) THEN +* +* Solve with TRS ( Use Level BLAS 2) +* + CALL ZHETRS( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO ) +* + ELSE +* +* Solve with TRS2 ( Use Level BLAS 3) +* + CALL CHETRS2( UPLO,N,NRHS,A,LDA,IPIV,B,LDB,WORK,INFO ) +* + END IF * END IF * -- cgit v1.2.3