Error in workspace query in dsytrf for empty matrices

Post here if you want to report a bug to the LAPACK team

Error in workspace query in dsytrf for empty matrices

Postby andreasnoackjensen » Sun Jul 28, 2013 12:33 pm

For empty matrices the workspace query returns 0.0 but 0 is an illegal value for lwork. See the following program where I also show the result from dsyev

program test

implicit none
integer*8 :: lwork, info, ipiv(0)
double precision :: a(0,0), w(0), work(1)

lwork = -1_8
call dsyev('N', 'U', 0_8, a, 1_8, w, work, lwork, info)

write(*,*) work

lwork = -1_8
call dsytrf('U', 0_8, a, 1_8, ipiv, work, lwork, info)

write(*,*) work

end program test
andreasnoackjensen
 
Posts: 3
Joined: Wed Feb 20, 2013 3:40 am

Re: Error in workspace query in dsytrf for empty matrices

Postby Julien Langou » Mon Jul 29, 2013 6:03 am

Hi Andreas,

Thanks for reporting this. (1) The correct behavior would indeed be to return WORK(1) = 1 when N=0. (2) I have checked a few LAPACK subroutines and unfortunately we are quite inconsistent with respect to this. You reported DSYTRF. DGEQRF has the same issue. DGELS and DSYSV are fine. So I will try to correct DGEQRF and DSYTRF and we will take it from there. Not much point in starting a systematic check.

Cheers,
Julien.
Julien Langou
 
Posts: 727
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: Error in workspace query in dsytrf for empty matrices

Postby lawrence mulholland » Wed Aug 07, 2013 8:41 am

This may be down to interpretation.
Routines may say something like "immediate return when N=0"
and may also say "WORK is not referenced N=0".

To be consistent you would have to have a rule as to which takes precedence:
the workspace query or the immediate return.
If the former then you would have to remove the "WORK not referenced comments"
from routines with workspace query mechanisms.
lawrence mulholland
 
Posts: 14
Joined: Mon Jun 11, 2012 6:33 am
Location: NAG Ltd, Oxford, UK

Re: Error in workspace query in dsytrf for empty matrices

Postby andreasnoackjensen » Fri Aug 23, 2013 3:53 pm

There might be different solutions, but what I wanted to avoid is illustrated in the the program below. If I run a work space query first and then use it I get the error message

** On entry to DSYTRF, parameter number 7 had an illegal value

program test

implicit none
integer :: lwork, info, ipiv(0)
double precision :: a(0,0), w(0), work(1)

lwork = -1
call dsyev('N', 'U', 0, a, 1, w, work, lwork, info)
lwork = work(1)
call dsyev('N', 'U', 0, a, 1, w, work, lwork, info)

lwork = -1
call dsytrf('U', 0, a, 1, ipiv, work, lwork, info)
lwork = work(1)
call dsytrf('U', 0, a, 1, ipiv, work, lwork, info)

end program test
andreasnoackjensen
 
Posts: 3
Joined: Wed Feb 20, 2013 3:40 am


Return to Bug report

Who is online

Users browsing this forum: No registered users and 1 guest