Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
- proper way to call MKL routines

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

nooj

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-14-2010
02:17 PM

36 Views

proper way to call MKL routines

reals are "real*8",ints "integer*4";

I use modules, intent(), allocatable arrays, and absolutely no pointers.

What is the proper way to call the higher precision eigenvalue solver for symmetric matrices (DSYEVR)?

Right now I'm calling DSYEVR directly (because I used ifort's flag "-r8"), and it's giving me problems. I suspect there is a better way. I'm looking for something fast for 3x3 matrices, and with as little fancy memory management as possible. (For instance, I don't know the difference between real*8 and real(8).)

I see the example program SYEVR_MAIN in syevr.f90 (which never uses the variable ISUPPZ). But I don't see the documentation for the exact call to SYEVR.

Help?

- Nooj

Link Copied

6 Replies

TimP

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-15-2010
09:54 PM

36 Views

MKL won't be particularly efficient for such small matrices, but it would hardly matter unless you have many of them; certainly it's not evident how "fancy memory management" could enter in.

nooj

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-16-2010
08:11 PM

36 Views

Tim -

MKL won't be particularly efficient for such small matrices,but it would hardly matter unless you have many of them

Actually, I will have many of them; tens to hundreds of millions per run, once the code is running full steam. I'm using MKL because it's the only robust eigensolver I know of. I need both eigenvalues and eigenvectors, and I can't assume the eigenvalues are all distinct. Do you have a better suggestion? Every time I look for robust solvers, I end up with solvers for large systems; mine will always be 3x3 symmetric, positive definite matrices.

I don't think your statement about "calling DSYEVR directly" makes sense

What I meant is there are at least eight ways to call ?syevr between v10.0 and 11.1 (F77_SYEVR, DSYEVR, DSYEVR_MKL95, etc.), and I wasn't sure whether to use the F95 interface, or call the underlying F77 routine.

perhaps a working example would help.

I tried to give an example athttp://software.intel.com/en-us/forums/showthread.php?t=74152, but no one had any insight.

certainly it's not evident how "fancy memory management" could enter in.

Every time I try to pull the offending code into a small test, the test never crashes. My main code crashes in random locations, so I thought perhaps I was misusing memory somewhere. I used valgrind, and it gave me thousands of false positives (use of uninitialized variable) and an error I didn't understand right before the crash. (I can post the error in the morning.)

- Nooj

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-23-2010
11:48 AM

36 Views

Please see my reply to your earlier thread .

Furthermore, if the matrices whose eigenvalues you want are never going to be anything other than 3 X 3, the characteristic equation

det ( A - \lambda I) = 0

is cubic and you can solve it directly using one of the many available cubic equation solvers.

nooj

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-24-2010
03:04 PM

36 Views

> are never going to be anything other than 3 X 3,

> the characteristic equationis cubic

> and you can solve it directly

> using one of the many available cubic equation solvers.

True, direct analytic calculation seems to be the fastest method. I also want the eigenvectors, which the intertubes agree can be computed fastest by coding up an analytic solution.

That said, the MKL is fast, even on small matrices. I ran a few tests of the MKL with computing 3x3 eigenvalues millions of times, and it was pretty consistent across matrices with different condition numbers: about 100K eigenproblems per second on a single 3.02GHz processor. This is much faster than my other bottlenecks and the serial portions of my code.

-f

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-24-2010
08:46 PM

36 Views

--Gennady

nooj

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-26-2010
07:56 AM

36 Views

For the time I quoted, I used these options:

-O3

-unroll

-ftrapuv

-traceback

-automatic

-static-intel

and these libraries:

-lmkl_solver_lp64

-lmkl_intel_lp64

-lmkl_lapack95_lp64

-lmkl_sequential

-lmkl_core

I think only -O3 is mattered here. (The loop was not unrollable.) I don't know of any chip-specific flags that apply to 64 bit Mac.

- Nooj

For more complete information about compiler optimizations, see our Optimization Notice.