title: Using mkl_set_num_threads with numpy
body: <p>I'm trying to set the number of threads for numpy calculations with <code>mkl_set_num_threads</code> like this</p>
  
  <pre><code>import numpy
  import ctypes
  mkl_rt = ctypes.CDLL('libmkl_rt.so')
  mkl_rt.mkl_set_num_threads(4)
  </code></pre>
  
  <p>but I keep getting an segmentation fault:</p>
  
  <pre class="lang-none prettyprint-override"><code>Program received signal SIGSEGV, Segmentation fault.
  0x00002aaab34d7561 in mkl_set_num_threads__ () from /../libmkl_intel_lp64.so
  </code></pre>
  
  <p>Getting the number of threads is no problem:</p>
  
  <pre><code>print mkl_rt.mkl_get_max_threads()
  </code></pre>
  
  <p>How can I get my code working?
  Or is there another way to set the number of threads at runtime?</p>