<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic vslNewStream() &amp; kmp_sharable_malloc() in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/vslNewStream-kmp-sharable-malloc/m-p/915335#M12524</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;For dynamically allocated sharable arrays the Cluster OpenMP manual advises to use kmp_sharable_malloc / kmp_sharable_free pairs instead of malloc / free.&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Jozsef&lt;BR /&gt;</description>
    <pubDate>Wed, 25 Jul 2007 18:29:53 GMT</pubDate>
    <dc:creator>jbakosi</dc:creator>
    <dc:date>2007-07-25T18:29:53Z</dc:date>
    <item>
      <title>vslNewStream() &amp; kmp_sharable_malloc()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/vslNewStream-kmp-sharable-malloc/m-p/915335#M12524</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;For dynamically allocated sharable arrays the Cluster OpenMP manual advises to use kmp_sharable_malloc / kmp_sharable_free pairs instead of malloc / free.&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Jozsef&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Jul 2007 18:29:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/vslNewStream-kmp-sharable-malloc/m-p/915335#M12524</guid>
      <dc:creator>jbakosi</dc:creator>
      <dc:date>2007-07-25T18:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: vslNewStream() &amp; kmp_sharable_malloc()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/vslNewStream-kmp-sharable-malloc/m-p/915336#M12525</link>
      <description>&lt;P&gt;Jozsef,&lt;/P&gt;
&lt;P&gt;There are currently no versions of Cluster-OpenMP-compatible create new shareable stream functions.&lt;/P&gt;
&lt;P&gt;If I understand you right you are currently usingVSL in the following way:&lt;/P&gt;
&lt;P&gt;- Allocatean array of stream state descriptors&lt;BR /&gt;- Loop of calling vslNewStream to initialize descriptors&lt;BR /&gt;- Cluster OpenMP section:&lt;BR /&gt;{&lt;BR /&gt;- SkipAhead / Leapfrogfor theStream used in this thread&lt;BR /&gt;- Generating and using random numbers&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;P&gt;-Declare1 stream state descriptors (say, LocalStream)&lt;BR /&gt;- Cluster OpenMP section, where LocalStream isdeclared asprivate&lt;BR /&gt;{&lt;BR /&gt;- Call vslNewStream to initialize private LocalStream&lt;BR /&gt;- SkipAhead / Leapfrogfor theLocalStream to be used in this thread&lt;BR /&gt;- Generating and using random numbers&lt;BR /&gt;- Delete LocalStream&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;Thus vslNewStream does not need to allocate shareable memory...&lt;/P&gt;
&lt;P&gt;Does it solve your problem?&lt;/P&gt;
&lt;P&gt;Thank you,&lt;BR /&gt;Ilya&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2007 09:50:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/vslNewStream-kmp-sharable-malloc/m-p/915336#M12525</guid>
      <dc:creator>Ilya_B_Intel</dc:creator>
      <dc:date>2007-07-26T09:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: vslNewStream() &amp; kmp_sharable_malloc()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/vslNewStream-kmp-sharable-malloc/m-p/915337#M12526</link>
      <description>Ilya,&lt;BR /&gt;&lt;BR /&gt;excellent! Works like a charm and it also scales very similarly, even with Cluster OpenMP.&lt;BR /&gt;&lt;BR /&gt;Thank you, your answer was very helpful.&lt;BR /&gt;Jozsef&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Jul 2007 18:22:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/vslNewStream-kmp-sharable-malloc/m-p/915337#M12526</guid>
      <dc:creator>jbakosi</dc:creator>
      <dc:date>2007-07-26T18:22:49Z</dc:date>
    </item>
  </channel>
</rss>

