Derive an independent, reproducible generator for a stream id.
Parallel codes must not let the seed of a task depend on scheduling
order. stream_for maps (master_seed, stream_id) to a generator
through two SplitMix64 finalisers, so stream 7 is the same sequence
whether it runs first, last or on another rank, and different ids give
uncorrelated sequences.
Build the SplitMix64 generator belonging to stream_id.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | master_seed | |||
| integer(kind=default_int), | intent(in) | :: | stream_id | |||
| type(splitmix64_t), | intent(out) | :: | gen |
Build the PCG32 generator belonging to stream_id. The derived seed
drives a local SplitMix64 which supplies both the LCG state and the
stream selector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | master_seed | |||
| integer(kind=default_int), | intent(in) | :: | stream_id | |||
| type(pcg32_t), | intent(out) | :: | gen |