Skip to content

Commit

Permalink
fm: Add comment to cp_fm_init_random about its RNG seed
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Nov 20, 2021
1 parent 11fe790 commit cd2af72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fm/cp_fm_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ SUBROUTINE cp_fm_init_random(matrix, ncol, start_col)
DEALLOCATE (buff)

! store seed before deletion (unclear if this is the proper seed)

! Note that, the initial state (rng%ig) instead of the current state (rng%cg) is stored in the
! seed variable. As a consequence, each invocation of cp_fm_init_random uses exactly the same
! stream of random numbers. While this seems odd and contrary to the original design,
! it was probably introduced to improve reproducibility.
! See also https://github.com/cp2k/cp2k/pull/506
CALL rng%get(ig=seed)

CALL timestop(handle)
Expand Down

0 comments on commit cd2af72

Please sign in to comment.