- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to port a working OpenMP code to Cluster OpenMP. For a Monte-Carlo simulation I generate random numbers in parallel with the MKL VSL routines employing the block-splitting technique to split random number streams and sample from them independently. Thus I use several vslNewStream() calls to create an array of stream pointers dynamically, depending on the number of threads available.
For dynamically allocated sharable arrays the Cluster OpenMP manual advises to use kmp_sharable_malloc / kmp_sharable_free pairs instead of malloc / free.
My question is the following. Are there corresponding Cluster-OpenMP-compatible calls to create random number streams that create sharable streams? Or is there any other way to resolve this issue?
Thank you,
Jozsef
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jozsef,
There are currently no versions of Cluster-OpenMP-compatible create new shareable stream functions.
If I understand you right you are currently usingVSL in the following way:
- Allocatean array of stream state descriptors
- Loop of calling vslNewStream to initialize descriptors
- Cluster OpenMP section:
{
- SkipAhead / Leapfrogfor theStream used in this thread
- Generating and using random numbers
}
Thus you will definetely obtain problems because there are some unshareable memory allocated by vslNewStream. Though if you modify your code by the following way:
-Declare1 stream state descriptors (say, LocalStream)
- Cluster OpenMP section, where LocalStream isdeclared asprivate
{
- Call vslNewStream to initialize private LocalStream
- SkipAhead / Leapfrogfor theLocalStream to be used in this thread
- Generating and using random numbers
- Delete LocalStream
}
Thus vslNewStream does not need to allocate shareable memory...
Does it solve your problem?
Thank you,
Ilya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
excellent! Works like a charm and it also scales very similarly, even with Cluster OpenMP.
Thank you, your answer was very helpful.
Jozsef
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page