Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindMKL module: which mkl versions to prioritize #480

Closed
jjwilke opened this issue Oct 10, 2019 · 13 comments
Closed

FindMKL module: which mkl versions to prioritize #480

jjwilke opened this issue Oct 10, 2019 · 13 comments

Comments

@jjwilke
Copy link
Contributor

jjwilke commented Oct 10, 2019

CMake can be set to compile/link with MKL flags for each of the follow versions:

  • Intel10_32 (intel mkl v10 32 bit)
  • Intel10_64lp (intel mkl v10+ 64 bit, threaded code, lp64 model)
  • Intel10_64lp_seq (intel mkl v10+ 64 bit, sequential code, lp64 model)
  • Intel10_64ilp (intel mkl v10+ 64 bit, threaded code, ilp64 model)
  • Intel10_64ilp_seq (intel mkl v10+ 64 bit, sequential code, ilp64 model)
  • Intel (obsolete versions of mkl 32 and 64 bit)

We need to choose an ordering in terms of preference.

@jjwilke
Copy link
Contributor Author

jjwilke commented Oct 10, 2019

I think the only difference is that ILPL is 64-bit integers and LPL is 32-bit integers? Which integers do we want to prefer and do we want to prefer threaded MKL?
I can make this configurable, but have to pick defaults.

@crtrott @srajama1 @kyungjoo-kim @ndellingwood
Is there someone more versed in MKL that can tell me how to do the defaults?

@kyungjoo-kim
Copy link
Contributor

I would first check if the compiler is intel or not . If the compiler is intel, instead of giving compile/link flags, we can just give "-mkl". If the compiler is not intel and still we want to check mkl upon request, I would go for threaded version with 64bit int. MKL automatically turns off threading if the mkl call is made inside of opemp region.

@jjwilke
Copy link
Contributor Author

jjwilke commented Oct 10, 2019

Makefile.kokkos-kernels actually sets the include path and links to lp64 rather than using -mkl (AFAICT).

I can certainly just use the -mkl for Intel compilers, if that's how people want to do it and use whatever default the compiler gives us.

@kyungjoo-kim
Copy link
Contributor

kyungjoo-kim commented Oct 10, 2019

You can definitely follow the existing logic. I think that using "-mkl" whenever possible is the most portable way for intel compilers. I think that intel probably used to have many troubles in guiding users to use correct compile/link flags and developed the idea of using "-mkl" and it is a simple solution.

@ndellingwood
Copy link
Contributor

@jjwilke does the FindMKL module in #491 account for what was discussed here?

@ndellingwood
Copy link
Contributor

@jjwilke I think this can be closed and done as part of 3.0.00?

@jjwilke
Copy link
Contributor Author

jjwilke commented Mar 10, 2020

I believe so. The solution here was to only use MKL with Intel compiler. Can @kyungjoo-kim confirm: do we need MKL support for non-Intel?

@mhoemmen
Copy link
Contributor

@jjwilke wrote:

do we need MKL support for non-Intel?

MKL supports use with GCC, and I've often used it that way. @rrdrake , does Sierra care about that use case?

@jjwilke
Copy link
Contributor Author

jjwilke commented Mar 10, 2020

Okay. Let's keep this open. I can have two configuration paths for Intel/non-Intel. If not Intel, I am going to look for MKL Intel10_64ilp only.

@jjwilke jjwilke added this to the 3.1 Release milestone Mar 10, 2020
@jjwilke jjwilke self-assigned this Mar 10, 2020
@rrdrake
Copy link

rrdrake commented Mar 10, 2020

At this time, Sierra only uses MKL with the Intel compiler.

@jjwilke
Copy link
Contributor Author

jjwilke commented Mar 10, 2020

Okay, now I'm remembering the issues. Do we need 32-bit or 64-bit integers? I need to know whether to link LP64 or ILP64.

@mhoemmen
Copy link
Contributor

@jjwilke Trilinos uses 32-bit integers (LP64) with BLAS libraries.

@jjwilke
Copy link
Contributor Author

jjwilke commented Mar 10, 2020

So this is fun. When using GCC, it is recommended to link libmkl_gnu_thread.so, but if you do that multi-threaded tests fails. If you build with GCC and libmkl_intel_thread.so everything works.

jjwilke pushed a commit to jjwilke/kokkos-kernels that referenced this issue Mar 11, 2020
ndellingwood added a commit that referenced this issue Mar 13, 2020
Add support for GCC MKL builds: Issue #480
@crtrott crtrott closed this as completed Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants