Page 1 of 1

Possible bug in pcgehdrv

PostPosted: Thu Mar 08, 2007 9:12 am
by granat
The do loop

*
DO 10 J = JL, ILO+JA+NB-IOFF-1, -NB
JB = MIN( JA+IHI-J, NB )

in pcgehdrv makes JB such that the following call to

CALL PCLARFT( 'Forward', 'Columnwise', IHI-K, JB, A, I+1, J,
$ DESCA, TAU, WORK( IPT ), WORK( IPW ) )

adresses TAU at position N, even though TAU only consist of N-1
initiated/computed values from PCGEHRD.

This is a possible bug - anyone who knows who wrote this code?

Best regards
Robert Granat

Re: Possible bug in pcgehdrv

PostPosted: Fri Mar 09, 2007 8:53 am
by granat
granat wrote:The do loop

*
DO 10 J = JL, ILO+JA+NB-IOFF-1, -NB
JB = MIN( JA+IHI-J, NB )

in pcgehdrv makes JB such that the following call to

CALL PCLARFT( 'Forward', 'Columnwise', IHI-K, JB, A, I+1, J,
$ DESCA, TAU, WORK( IPT ), WORK( IPW ) )

adresses TAU at position N, even though TAU only consist of N-1
initiated/computed values from PCGEHRD.

This is a possible bug - anyone who knows who wrote this code?

Best regards
Robert Granat


By some testing we suggest that the line

JB = MIN( JA+IHI-J, NB )

is replaced by

JB = MIN( JA+IHI-J-1, NB ).

//Robert

PostPosted: Mon Mar 12, 2007 1:15 pm
by Julien Langou
Hello Robert,
thanks for the patch. Is there an easy to check this by simply changing the HRD.dat file for example?
Julien.

PostPosted: Tue Mar 13, 2007 6:40 am
by granat
Julien Langou wrote:Hello Robert,
thanks for the patch. Is there an easy to check this by simply changing the HRD.dat file for example?
Julien.


What we did was to compile the library using the Pathscale compiler as

pathf90 -O0 -g -trapuv

which means that all variables are initiated with NaN and floating point exceptions are trapped. The NAG compiler should have a similar option.

Observe that the following lines should be modified as well:

@@ -183,7 +183,7 @@
IV = IOFF + 1
I = IA + ILO - 1
J = JA + ILO - 1
- JB = MIN( NB-IOFF, JA+IHI-J )
+ JB = MIN( NB-IOFF, JA+IHI-J-1 )
*
* Compute upper triangular matrix T from TAU.
*

Best regards
Robert Granat and Åke Sandgren