Skip to content

MKL Pardiso direct linear solver support.#215

Merged
bodono merged 37 commits intomasterfrom
pardiso_mkl
Mar 7, 2022
Merged

MKL Pardiso direct linear solver support.#215
bodono merged 37 commits intomasterfrom
pardiso_mkl

Conversation

@bodono
Copy link
Member

@bodono bodono commented Mar 3, 2022

Add interface for the MKL Pardiso direct linear solver, add some tests and docs.

@bodono
Copy link
Member Author

bodono commented Mar 4, 2022

@odow @kalmarek - I'm 99.9% sure this isn't a breaking change for Julia but PTAL and let me know.

BTW - the MKL version of the direct solver can be much faster, so if the user has MKL installed in their Julia it might be worth investigating how to link against it for all the LAPACK / BLAS usages as well as the linear solver after this lands.

@kalmarek
Copy link
Contributor

kalmarek commented Mar 6, 2022

@bodono thanks, this looks great, I'm eager to try it!

Does it need something special from oneAPI, or just MKL?
If it's just MKL, we could easily ship it via another @Requires as e.g. DirectSolverMKL by adding build-time dependancy to SCS_jll build @odow.

@bodono
Copy link
Member Author

bodono commented Mar 6, 2022

It only uses pardiso, so I believe it's just MKL but would need to be tested.

@bodono bodono merged commit a543b70 into master Mar 7, 2022
@bodono bodono deleted the pardiso_mkl branch March 7, 2022 15:40
@kalmarek
Copy link
Contributor

kalmarek commented Apr 6, 2022

So I tried to make it work, and here is a proof of concept:
https://gist.github.com/kalmarek/50755885b33f6ffd9dba0959df03388f
(you will need to define JULIA_HOME and set mkldirect in SCS_MKL.jl to run it).

I managed to compile and locally deploy SCS_MKL_jll without problem, but due to "complicated relationships in mkllibs family" you can't just using MKL prior using SCS. TLDR: mklibs reference symbols which they don't define and don't link with libs that define those. Note the --no-as-needed flag. For more information you can amuse yourself by reading JuliaPackaging/Yggdrasil#1075.

Unfortunately I don't see a way around it (except manually dlopening the required libs) so I'm afraid we won't have a smooth experience with SCS & MKL in julia land. Maybe @odow has more ideas?

@bodono
Copy link
Member Author

bodono commented Apr 8, 2022

Hmmm, that's annoying. I also found it a bit tricky to get the install right on all machines that I tried, I needed quite a lot of flags, see here, and the link at the comment above that line. I'm a bit surprised that Julia isn't able to figure it out with using MKL and using SCS as you say, but you know better than I do.

@kalmarek
Copy link
Contributor

As far as I understand that's something that needs to be done at runtime (by e.g. detecting the capabilities of the cpu). That's not what julia jll system is created for. Theoretically we could dlopen the necessary libs in package __init__, but I wouldn't dare to register it in this state ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants