<?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 Segmentation Fault when I include Thread Control in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789162#M2052</link>
    <description>&lt;P&gt;You may remove the mkl_set_dynamic(1) which is not required here, since you are already setting the the # of threads to be used by using mkl_set_num_threads(). Also, please include mkl.h.&lt;BR /&gt;&lt;BR /&gt;--Vipin&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2012 05:51:23 GMT</pubDate>
    <dc:creator>VipinKumar_E_Intel</dc:creator>
    <dc:date>2012-03-19T05:51:23Z</dc:date>
    <item>
      <title>Segmentation Fault when I include Thread Control</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789161#M2051</link>
      <description>Hi,&lt;BR /&gt;I am compiling a simple BLAS program which has DGEMV. It works fine when I have no explicit thread control.&lt;BR /&gt;&lt;BR /&gt;However, when I include &lt;BR /&gt;&lt;BR /&gt;mkl_set_dynamic(1);&lt;BR /&gt;mkl_set_num_threads(4);&lt;BR /&gt;(C code)&lt;BR /&gt;&lt;BR /&gt;just before the DGEMV call. The program doesn't compile and simply spits out "Segmentation Fault"&lt;BR /&gt;&lt;BR /&gt;I have already tried ulimit -s unlimited and KMP_STACKSIZE but no use.&lt;BR /&gt;&lt;BR /&gt;I am compiling using : &lt;BR /&gt;&lt;BR /&gt;icc testing_dgemv.c -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_lp64.a $MKLROOT/lib/intel64/libmkl_intel_thread.a $MKLROOT/lib/intel64/libmkl_core.a -Wl,--end-group -openmp -lpthread -lm&lt;BR /&gt;&lt;BR /&gt;I also tried &lt;BR /&gt;&lt;BR /&gt;icc testing_dgesv.c -mkl=parallel &lt;BR /&gt;&lt;BR /&gt;Code : &lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;MKL_CBLAS.H&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;int i, j,n,n2;&lt;BR /&gt;n=1500;&lt;BR /&gt;double* m = (double*)malloc( n*n*sizeof(double));&lt;BR /&gt;double* x = (double*)malloc( n*sizeof(double));&lt;BR /&gt;double* y = (double*)malloc( n*sizeof(double));&lt;BR /&gt;&lt;BR /&gt;for(i=0;i&lt;N&gt;&lt;/N&gt;{&lt;BR /&gt;x&lt;I&gt; = (i+1)*(i+1)*1.00;&lt;BR /&gt;y&lt;I&gt; = 0;&lt;BR /&gt;for(j=0;j&lt;N&gt;&lt;/N&gt;m[i*n+j] = (i+j+2)*(j+1)*1.00;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;mkl_set_dynamic(1);&lt;BR /&gt;mkl_set_num_threads(4);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; cblas_dgemv(CblasRowMajor, CblasNoTrans, n, n, 1.0, m, n, x, 1, 0.0, y, 1);&lt;BR /&gt;&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/MKL_CBLAS.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Sun, 18 Mar 2012 11:52:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789161#M2051</guid>
      <dc:creator>nunoxic</dc:creator>
      <dc:date>2012-03-18T11:52:45Z</dc:date>
    </item>
    <item>
      <title>Segmentation Fault when I include Thread Control</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789162#M2052</link>
      <description>&lt;P&gt;You may remove the mkl_set_dynamic(1) which is not required here, since you are already setting the the # of threads to be used by using mkl_set_num_threads(). Also, please include mkl.h.&lt;BR /&gt;&lt;BR /&gt;--Vipin&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2012 05:51:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789162#M2052</guid>
      <dc:creator>VipinKumar_E_Intel</dc:creator>
      <dc:date>2012-03-19T05:51:23Z</dc:date>
    </item>
    <item>
      <title>Segmentation Fault when I include Thread Control</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789163#M2053</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;In previous postby Vipin there was not right suggestionabout using &lt;STRONG&gt;mkl_set_dynamic().&lt;BR /&gt;&lt;/STRONG&gt;This function is needed if user needs &lt;STRONG&gt;nested parallelizm&lt;/STRONG&gt; and allows or not 'soft' or 'hard' threading in MKL&lt;BR /&gt;(&lt;SPAN style="font-family: TimesNewRoman; font-size: x-small;"&gt;&lt;SPAN style="font-family: TimesNewRoman; font-size: x-small;"&gt;&lt;STRONG&gt;enables or disables dynamic adjustment of the number of threads&lt;/STRONG&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;See MKL doc.&lt;BR /&gt;&lt;BR /&gt;As to the problem:&lt;BR /&gt; Please add all needed for the test header files:&lt;BR /&gt; stdlib.h for malloc&lt;BR /&gt; mkl.h or mkl_service.h for mkl_set_dynamic and mkl_set_num_thread.&lt;BR /&gt;&lt;BR /&gt;After this correction the tests PASSED on requested 4-threads&lt;BR /&gt;&lt;P&gt;OMP: Info #147: KMP_AFFINITY: Internal thread 0 bound to OS proc set {0,12}&lt;/P&gt;&lt;P&gt;OMP: Info #147: KMP_AFFINITY: Internal thread 3 bound to OS proc set {8,20}&lt;/P&gt;&lt;P&gt;OMP: Info #147: KMP_AFFINITY: Internal thread 2 bound to OS proc set {8,20}&lt;/P&gt;&lt;P&gt;OMP: Info #147: KMP_AFFINITY: Internal thread 1 bound to OS proc set {0,12}&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Mar 2012 07:33:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789163#M2053</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2012-03-19T07:33:07Z</dc:date>
    </item>
    <item>
      <title>Segmentation Fault when I include Thread Control</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789164#M2054</link>
      <description>Adding #include &lt;MKL.H&gt; fixed it.&lt;BR /&gt;Thanks !&lt;/MKL.H&gt;</description>
      <pubDate>Mon, 19 Mar 2012 12:30:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789164#M2054</guid>
      <dc:creator>nunoxic</dc:creator>
      <dc:date>2012-03-19T12:30:18Z</dc:date>
    </item>
    <item>
      <title>Segmentation Fault when I include Thread Control</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789165#M2055</link>
      <description>OK!&lt;BR /&gt;&lt;BR /&gt;Without &lt;MKL.H&gt; mkl_set_dynamic() is as a MKL FORTRAN function which requires argument passed by reference.&lt;BR /&gt;&lt;BR /&gt;So, please add always correct header files and check your test with compiler -Wall option&lt;/MKL.H&gt;</description>
      <pubDate>Mon, 19 Mar 2012 12:59:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-Fault-when-I-include-Thread-Control/m-p/789165#M2055</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2012-03-19T12:59:03Z</dc:date>
    </item>
  </channel>
</rss>

