- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, I intend to write a scientific program based on MKL.
The main question I have is: do I use C or Fortran?
I'm mainly concerned with performance, but I would like to hear general pros and cons from the experienced.
Thanks in advance,
Herbert
The main question I have is: do I use C or Fortran?
I'm mainly concerned with performance, but I would like to hear general pros and cons from the experienced.
Thanks in advance,
Herbert
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If most of the time is spent in MKL functions, performance would be the same with either calling language, if direct low level function calls are used. With care, and use of extensions, Intel C++ can give full performance in its own code as well as in MKL.
MKL is more widely used with Intel Fortran than C. Intel has recognized this in the new Fortran Professional offerings which provide both in one package.
Current MKL with non-Intel compilers has the disadvantage that OpenMP can't be used in both the compiler and in MKL, because of the different OpenMP libraries. MKL serial libraries avoid this problem, but require any threading to be performed by the calling application.
BLAS calling conventions are more awkward in C than in Fortran. MKL provides the Fortran95 wrappers to clean it up, possibly with performance penalty. As far as I know, only gfortran provides options to compile MATMUL as ?GEMM calls. gfortran is supported with MKL only on linux (and Mac?).
For C, MKL provides fft wrappers to ease implementation, apparently with a performance penalty.
MKL is more widely used with Intel Fortran than C. Intel has recognized this in the new Fortran Professional offerings which provide both in one package.
Current MKL with non-Intel compilers has the disadvantage that OpenMP can't be used in both the compiler and in MKL, because of the different OpenMP libraries. MKL serial libraries avoid this problem, but require any threading to be performed by the calling application.
BLAS calling conventions are more awkward in C than in Fortran. MKL provides the Fortran95 wrappers to clean it up, possibly with performance penalty. As far as I know, only gfortran provides options to compile MATMUL as ?GEMM calls. gfortran is supported with MKL only on linux (and Mac?).
For C, MKL provides fft wrappers to ease implementation, apparently with a performance penalty.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page