Skip to content

Conversation

@JamesMcClung
Copy link
Collaborator

Hacky way to seed rngs with constant values. Useful for e.g. initializing the same realization of magnetic turbulence across all processes.

Copy link
Contributor

@germasch germasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

As I'm looking at the code, I'm wondering if it wouldn't be better to have these as singletons, though. Since there's, I suppose, one ProcessGenerator per process, singleton would seem appropriate ;) I think the implementation already actually follows the singleton pattern, but then it seems unnecessary to make a shared_ptr, since the use count will never go back down to zero, anyway.

@JamesMcClung JamesMcClung merged commit d6e378e into psc-code:main Nov 21, 2025
6 checks passed
@JamesMcClung JamesMcClung deleted the pr/const-seed-rng branch November 21, 2025 18:49
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