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

Using Scalapack/COSMA from Breeze #814

Open
lion241 opened this issue Jun 29, 2021 · 5 comments
Open

Using Scalapack/COSMA from Breeze #814

lion241 opened this issue Jun 29, 2021 · 5 comments

Comments

@lion241
Copy link

lion241 commented Jun 29, 2021

Hi!!

I have been looking into your repo and i wanted to understand if you are using BLAS/Lapack (perhaps calling C or Fortran) to perform matrix multiplication and in the case that the computer allows, do you also multithread in case the matrix size is big enough?

Finally is it possible with some installation in the cloud or locally to use the BLAS/Lapack library to ensure that operation can happen through that (assuming you do it through these packages)?

Sorry if this question is simple but I cant seem to be able to find a clear answer on this by looking around in the repo code.

@dlwh
Copy link
Member

dlwh commented Jun 30, 2021 via email

@luhenry
Copy link
Contributor

luhenry commented Jul 5, 2021

With https://github.com/luhenry/netlib, as long as you've OpenBLAS installed and on the dynamic loader path (see LD_LIBRARY_PATH and man dlopen), you should automatically use OpenBLAS. It can also work with Intel MKL when you specify -Ddev.ludovic.netlib.blas.nativeLibPath=/path/to/libmkl_rt.so

@lion241
Copy link
Author

lion241 commented Aug 24, 2021

Assuming that i want to modify the BLAS/LApack library a little bit. Is there a way to ensure that breeze will use the modified version.

I am interested in using this to further speed up matrix multiplication:

https://github.com/eth-cscs/COSMA#cosma-in-production

I am sorry, I am not very familiar with such tasks, but my understanding is that I need to install scalapack or blas/lapack and then modify it based on the github above and then make sure breeze is pointing to the modified version.

I am not sure how I can make sure that breeze is pointing to the new version.

@dlwh
Copy link
Member

dlwh commented Aug 24, 2021

It looks like COSMA exposes a Scalapack api, which I don't think @luhenry's library (nor Breeze) directly invokes. most of Breeze (at least the linear algebra parts) is just a fancy wrapper around BLAS/LAPACK/ARPACK (via https://github.com/luhenry/netlib). I've not done anything to make it work with scalapack.

I'd be happy to help provide some pointers, or you might be able to follow what @luhenry did for, e.g., LAPACK.

@luhenry
Copy link
Contributor

luhenry commented Sep 2, 2021

https://github.com/luhenry/netlib supports calling into a BLAS/LAPACK/ARPACK library, whatever the implementation (OpenBLAS, Intel MKL, or others for example). If Scalapack provides such API, then you can call into it, but if it doesn't then it doesn't support calling into it.

This is the JNI wrapper file for LAPACK: https://github.com/luhenry/netlib/blob/master/lapack/src/main/native/jni.c

@dlwh dlwh changed the title Basic question on matrix calculation Using Scalapack/COSMA from Breeze Jan 27, 2022
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

No branches or pull requests

3 participants