3
$\begingroup$

Recently I am using Umfpack with Intel MKL BLAS. To link the library to a program one has to link mkl_rt.lib / mkl_rt.so. However there is no word which version: sequential or parallel of library is linked.

Anyone could help? Thanks in advance.

$\endgroup$
  • $\begingroup$ What was the precise link command? $\endgroup$ – Jeff Sep 14 '15 at 0:23
4
$\begingroup$

I believe that MKL has the threaded parallel and serial functions in one unified library. You can try setting OMP_NUM_THREADS or MKL_NUM_THREADS to a range of values and see how the performance varies. Setting either to 1 will give you the serial behavior.

$\endgroup$
  • $\begingroup$ I should add, that you probably have to pick ONE of these to set to 1 and leave the other unset. IF MKL_NUM_THREADS=m and OMP_NUM_THREADS=n, I don't know which you get. Read the manual to be sure. $\endgroup$ – Bill Barth Aug 12 '13 at 15:37
3
$\begingroup$

There is some good information here:
https://software.intel.com/en-us/mkl-linux-developer-guide-calling-intel-mkl-functions-from-multi-threaded-applications

  • set MKL_NUM_THREADS=n
  • call mkl_set_num_threads(n)
$\endgroup$
1
$\begingroup$

Use the MKL link line advisor to determine what library that corresponds to.

https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor

If you choose "Single Dynamic Library", it uses "mkl_rt.lib" and it looks like threading is active.

$\endgroup$
0
$\begingroup$

The results of these two versions should be the same. It's up to you to decide whether you want to utilize multiple cores or not.

$\endgroup$
  • $\begingroup$ My question is: If there's only one lib file for linking, how do I know if my program uses parallel or sequential functions? Or: how can I use parallel or sequential when I need one. $\endgroup$ – Misery Aug 9 '13 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.