Ceci est une ancienne révision du document !
MAGMA
MAGMA Matrix Algebra on GPU and Multicore Architectures
The MAGMA project aims to develop a dense linear algebra library similar to LAPACK but for heterogeneous/hybrid architectures, starting with current "Multicore+GPU" systems.
Included are routines for the following algorithms:
- LU, QR, and Cholesky factorizations in both real and complex arithmetic (single and double);
- Hessenberg, bidiagonal, and tridiagonal reductions in both real and complex arithmetic (single and double);
- Linear solvers based on LU, QR, and Cholesky in both real and complex arithmetic (single and double);
- Eigen and singular value problem solvers in both real and complex arithmetic (single and double);
- Generalized Hermitian-definite eigenproblem solvers;
- Mixed-precision iterative refinement solvers based on LU, QR, and Cholesky in both real and complex arithmetic;
- MAGMA BLAS in real arithmetic (single and double), including gemm, gemv, symv, and trsm.
MAGMA is like BLAS/LAPACK for GPU or CPU + GPU
Version installée
- magma/cuda/1.2.1 (use module avail magma)
Cette bibliothèque dépend de MKL (blas/lapack) et de CUDA bien sûr
Utilisation
Exemple : ** Factorisation QR utilisant LAPACK and MAGMA (subroutine : **DGEQRF )
... ... /* Initialize the matrix */ lapackf77_dlarnv( &ione, ISEED, &n2, h_A ); lapackf77_dlacpy( MagmaUpperLowerStr, &M, &N, h_A, &lda, h_R, &lda ); /* ===================================================================== Performs operation using LAPACK =================================================================== */ start = get_current_time(); lapackf77_dgeqrf(&M, &N, h_A, &M, tau, hwork, &lhwork, &info); end = get_current_time(); if (info < 0) printf("Argument %d of lapack_dgeqrf had an illegal value.\n", -info); cpu_perf = flops / GetTimerValue(start, end); /* ==================================================================== Performs operation using MAGMA =================================================================== */ cublasSetMatrix( M, N, sizeof(double), h_R, lda, d_A, ldda); magma_dgeqrf2_gpu( M, N, d_A, ldda, tau, &info); cublasSetMatrix( M, N, sizeof(double), h_R, lda, d_A, ldda); start = get_current_time(); magma_dgeqrf2_gpu( M, N, d_A, ldda, tau, &info); end = get_current_time(); if (info < 0) printf("Argument %d of magma_dgeqrf2 had an illegal value.\n", -info); gpu_perf = flops / GetTimerValue(start, end); ... ...
Plusieurs exemples se trouvent dans $MAGMA_HOME/testing
Compilation
Pour compiler un programme utilisant MAGMA vous devez vous connecter aux machines
tesla
qlogin -q tesla
Charger le module magma :
module load magma/1.2.1
Adapter le Makefile suivant selon vos besoins :
- Makefile
FIXME