Skip to content

Commit

Permalink
fix: ensure that LAPACK RNG state is propagated
Browse files Browse the repository at this point in the history
  • Loading branch information
szhorvat authored and fghoussen committed Aug 12, 2023
1 parent 6d625db commit 0996200
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 24 deletions.
21 changes: 15 additions & 6 deletions SRC/cgetv0.f
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ subroutine cgetv0
c | Local Scalars & Arrays |
c %------------------------%
c
logical first, orth
logical first, inits, orth
integer idist, iseed(4), iter, msglvl, jj
Real
& rnorm0
Complex
& cnorm
save first, iseed, iter, msglvl, orth, rnorm0
save first, iseed, inits, iter, msglvl, orth, rnorm0
c
c %----------------------%
c | External Subroutines |
Expand All @@ -180,6 +180,12 @@ subroutine cgetv0
& ccdotc
external ccdotc, scnrm2, slapy2
c
c %-----------------%
c | Data Statements |
c %-----------------%
c
data inits /.true./
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
Expand All @@ -190,10 +196,13 @@ subroutine cgetv0
c | random number generator |
c %-----------------------------------%
c
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
if (inits) then
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
inits = .false.
end if
c
if (ido .eq. 0) then
c
Expand Down
21 changes: 15 additions & 6 deletions SRC/dgetv0.f
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ subroutine dgetv0
c | Local Scalars & Arrays |
c %------------------------%
c
logical first, orth
logical first, inits, orth
integer idist, iseed(4), iter, msglvl, jj
Double precision
& rnorm0
save first, iseed, iter, msglvl, orth, rnorm0
save first, iseed, inits, iter, msglvl, orth, rnorm0
c
c %----------------------%
c | External Subroutines |
Expand All @@ -183,6 +183,12 @@ subroutine dgetv0
c
intrinsic abs, sqrt
c
c %-----------------%
c | Data Statements |
c %-----------------%
c
data inits /.true./
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
Expand All @@ -193,10 +199,13 @@ subroutine dgetv0
c | random number generator |
c %-----------------------------------%
c
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
if (inits) then
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
inits = .false.
end if
c
if (ido .eq. 0) then
c
Expand Down
21 changes: 15 additions & 6 deletions SRC/sgetv0.f
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ subroutine sgetv0
c | Local Scalars & Arrays |
c %------------------------%
c
logical first, orth
logical first, inits, orth
integer idist, iseed(4), iter, msglvl, jj
Real
& rnorm0
save first, iseed, iter, msglvl, orth, rnorm0
save first, iseed, inits, iter, msglvl, orth, rnorm0
c
c %----------------------%
c | External Subroutines |
Expand All @@ -183,6 +183,12 @@ subroutine sgetv0
c
intrinsic abs, sqrt
c
c %-----------------%
c | Data Statements |
c %-----------------%
c
data inits /.true./
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
Expand All @@ -193,10 +199,13 @@ subroutine sgetv0
c | random number generator |
c %-----------------------------------%
c
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
if (inits) then
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
inits = .false.
end if
c
if (ido .eq. 0) then
c
Expand Down
21 changes: 15 additions & 6 deletions SRC/zgetv0.f
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ subroutine zgetv0
c | Local Scalars & Arrays |
c %------------------------%
c
logical first, orth
logical first, inits, orth
integer idist, iseed(4), iter, msglvl, jj
Double precision
& rnorm0
Complex*16
& cnorm
save first, iseed, iter, msglvl, orth, rnorm0
save first, iseed, inits, iter, msglvl, orth, rnorm0
c
c %----------------------%
c | External Subroutines |
Expand All @@ -180,6 +180,12 @@ subroutine zgetv0
& zzdotc
external zzdotc, dznrm2, dlapy2
c
c %-----------------%
c | Data Statements |
c %-----------------%
c
data inits /.true./
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
Expand All @@ -190,10 +196,13 @@ subroutine zgetv0
c | random number generator |
c %-----------------------------------%
c
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
if (inits) then
iseed(1) = 1
iseed(2) = 3
iseed(3) = 5
iseed(4) = 7
inits = .false.
end if
c
if (ido .eq. 0) then
c
Expand Down

0 comments on commit 0996200

Please sign in to comment.