Skip to content

fix missing II update in NPROW=1 branch of p?lanhs#159

Merged
langou merged 1 commit into
Reference-ScaLAPACK:masterfrom
kyungminlee:bugfix/lanhs
Apr 29, 2026
Merged

fix missing II update in NPROW=1 branch of p?lanhs#159
langou merged 1 commit into
Reference-ScaLAPACK:masterfrom
kyungminlee:bugfix/lanhs

Conversation

@kyungminlee
Copy link
Copy Markdown
Contributor

In the NPROW=1 path of PCLANHS/PDLANHS/PSLANHS/PZLANHS, II was not incremented by JB after processing the first block of columns. As a result, the row bound MIN(II+LL-JJ+1, IIA+NP-1) used inside the subsequent column-block loop tracked the Hessenberg diagonal at the wrong row, causing upper-triangle entries past the first block to be skipped and the computed norm to be incorrect.

Add II = II + JB after the first-block END IF in each of the four norm branches (M, 1, I, F), matching the equivalent update already present in the NPROW>1 branch.

Repro

NORM=M, N = 8, NB = 4, 1×1 grid, with 99 planted at A(6,5) (true ||A||_max = 99):

        c1   c2   c3   c4   c5   c6   c7   c8
   r1 [  1    2    3    4    5    6    7    8 ]
   r2 [  9   10   11   12   13   14   15   16 ]
   r3 [  0   17   18   19   20   21   22   23 ]
   r4 [  0    0   24   25   26   27   28   29 ]
   r5 [  0    0    0   30   31   32   33   34 ]
   r6 [  0    0    0    0   99   35   36   37 ]
   r7 [  0    0    0    0    0   38   39   40 ]
   r8 [  0    0    0    0    0    0   41   42 ]
  • Buggy: return s 34. the second block scans min(LL - 3, 8) rows instead of min(LL + 1, 8), missing the
    entry at row 6.
  • Fixed: returns 99.

In the NPROW=1 path of PCLANHS/PDLANHS/PSLANHS/PZLANHS, II was not
incremented by JB after processing the first (alignment) block of
columns. As a result, the row bound MIN(II+LL-JJ+1, IIA+NP-1) used
inside the subsequent column-block loop tracked the Hessenberg
diagonal at the wrong row, causing upper-triangle entries past the
first block to be skipped and the computed norm to be incorrect.

Add II = II + JB after the first-block END IF in each of the four
norm branches (M, 1, I, F), matching the equivalent update already
present in the NPROW>1 branch.
@langou langou merged commit 60fdb19 into Reference-ScaLAPACK:master Apr 29, 2026
12 checks passed
@kyungminlee kyungminlee deleted the bugfix/lanhs branch April 29, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants