Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29277 Discussions

Why use the Intel Math Kernel library?

raov
Beginner
617 Views
Looking at the contents of the Intel Math Kernel Library at http://www.ncsa.uiuc.edu/UserInfo/Resources/Hardware/XeonCluster/Doc/mkl61/mklqref/index.htm,
I do not understand the purpose of much of it, if you own Intel Visual Fortran.
Most of the BLAS and Vector Mathematical Function (VML) routines can be replaced by one line of Fortran 95 code using intrinsics such as SUM. Does code using MKL run faster than the equivalent F95 code compiled with IVF with full optimization?
MKL has Lapack, but is it faster than compiling Lapack yourself with optimization?
public domain vector RNG?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
617 Views
MKL is hand-tuned assembly language for Intel CPUs, and also supports HyperThreading and multiprocessor systems. It can be quite a bit faster than compiled Fortran source in some cases, though BLAS1 doesn't show much benefit. I suggest you look at http://developer.intel.com/software/products/mkl/for more information, and you can ask follow-up questions in the MKL User Forum.
0 Kudos
TimP
Honored Contributor III
617 Views

SUM() and DOT_PRODUCT(), as implemented by the Intel compilers, are quite efficient over a range of applications. Having equivalent BLAScompatible functions in MKLmay bemainly a question of completeness for many applications. MATMUL() and DGEMM have received a great deal of attention. You may find that DGEMM has a greater advantage for problems sized such that its alternate cache blocking schemes are useful. You could always find specific cases where one or the other, or your own code, has an advantage. Other intrinsics haven't received the level of attention which you might consider deserved, and you could easily write something more efficient for your own application.

You could use your search engine tofind plenty of fodder about pre-built vs your own compilations of LAPACK. If you build it yourself, you may have to contend with problems such as the way it avoids use of Fortran intrinsics such as EPSILON() and TINY(), but instead calculatesequivalents using code which may break at full optimization. If you want performance, you will have to consider details such as comparisons against 0. which someonelong ago decided would improve performance on sparse matrices, but often hinder optimization.

Of course, you should take advantage of your browser to check up on RNG. I can't tell from your post whether you mean to benchmark for performance, or quality, or some combination. The advantages of using documented source code, rather than the compiler library versions, usually lie in having available citations on quality. The subject goes far beyond what could be covered here.

0 Kudos
Reply