- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I find myself frustrated that the only way to save states in the RNG's seems to be to write to a file, or to use the vslCopyStreamState function to another allocated stream.
I want to be able to view the actual "seed" values (ie. the states). Is there ANY way to do this? I find that even if I use the SaveStatesF to save to a file, the data in the file does not look like the state values at all. (For example, for the Mersenne Twister generator, i initialize all 625 states to 1, but when i write it to a file, i do not see anything even close to all 1's).
I would be very interested in a way to view the states especially without writing to a file! Is this possible?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We want to avoid users directly accessing VSL internal data structures. Can you please highlight the reasons for which you would like to have an access to the state of the generators? Initialization of VSL RNGs is done according to description in VSL Notes. In particular, initialization of Mersenne Twister RNG is based on description in Sections 8.4.6.3 and 8.4.6.4.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We still would like to better understand why user may need access to internal data structures. Could you please shed a light on possible usage scenarios? PRNG state structure varies from generator to generator. Those structures may be quite complicated and impractical from usage perspective.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lets look at the Matlab/Octave rand function as an example. If you call rand('state'), it returns the state of the random number generator (ie. a vector of the seed values). With the Intel MKL, there is absolutely no way to know what the current seed values are.
Why would the user want this? Well, a better question is why not? I might want to take these seed values and feed them to another non-MKL RNG. The point is, why restrict it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is impossible to feed stream state values to non-MKL RNG without knowing exactly the internal format of the MKL stream state structure. Even if MKL and non-MKL generatorare based onthe same algorithm, the fields of stream state structure may still be different (e.g. be in different order). As we indicated earlier, we don't document details of internal structures as a) those structures may be quite complicated for understanding without giving implementation details; b) the format of the structures is optimized for performance and it is IP we don't really want to disclose.
If the only objectiveis to get RNG stream state as integers, I believe MKL provides you the required features. First, the vslGetBrngProperties allows to extract the information about stream state size (in bytes). Second, MKL manual documents general format of the stream state in section Formats for User-Designed Generators. According to this section the stream state data starts with16 bytes offset. Suppose now you have some stream s and you want get its state as array of integers. The only thing you have to do is to interpret data pointed by s as array of integers.
Please let us know if it addresses your issue.
Thanks,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply. Copying the memory starting at 16 bytes offset from the stream state pointer seems to work for me.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page