1

I just installed magma and I noticed that some routines have _mgpu version while some not. For example for LU inverse, there are 4 functions:

magma_cgetri_gpu (magma_int_t n, magmaFloatComplex_ptr dA, magma_int_t ldda, magma_int_t *ipiv, magmaFloatComplex_ptr dwork, magma_int_t lwork, magma_int_t *info)
magma_dgetri_gpu (magma_int_t n, magmaDouble_ptr dA, magma_int_t ldda, magma_int_t *ipiv, magmaDouble_ptr dwork, magma_int_t lwork, magma_int_t *info)
magma_sgetri_gpu (magma_int_t n, magmaFloat_ptr dA, magma_int_t ldda, magma_int_t *ipiv, magmaFloat_ptr dwork, magma_int_t lwork, magma_int_t *info)
magma_zgetri_gpu (magma_int_t n, magmaDoubleComplex_ptr dA, magma_int_t ldda, magma_int_t *ipiv, magmaDoubleComplex_ptr dwork, magma_int_t lwork, magma_int_t *info)

There is no _mgpu function for LU inverse, and there is also no relevant input parameter in these gpu functions that indicating the number of GPUs to use. Dose this mean there functions without '_mpu' suffix cannot use multiple GPUs? If the answer is no, how to do it?

Here is the link to the documentation: http://icl.cs.utk.edu/projectsfiles/magma/doxygen/group__magma__getri.html

Thank you very much!

talonmies
  • 70,661
  • 34
  • 192
  • 269
Han
  • 9
  • 4
  • Since there is no `magma_int_t ngpu` argument for these functions, I assume that it's not possible to use multiple gpu to compute the inverse. But there is a potential solution within MAGMA: first call `magma_dgetrf_mgpu (magma_int_t ngpu, ...)` to compute the LU factorization, then call `magma_int_t magma_dtrsm_m (magma_int_t ngpu,...)` to compute `U^-1` using the identity matrix as the right hand side. Finally, call `magma_int_t magma_dtrsm_m (magma_int_t ngpu,...)` to solve `UA^-1=L-1`. – francis Jan 11 '17 at 21:09
  • Before any attempt, make sure that your matrix is well-conditionned by calling LAPACK's `DGECON()`! Indeed, if the matrix is ill-conditionned, the accuracy will be lost and the computed inverse won't mean anything. See [How Accurate is inv(A)*b?](https://arxiv.org/pdf/1201.6035v1.pdf) for details: if the condition number is higher than 1e14, then even double precision will not be sufficient... – francis Jan 11 '17 at 21:14
  • Thank you very much Francis! I'll try your method and see how is the performance.@francis – Han Jan 12 '17 at 04:51

0 Answers0