the lapack for clusters (lfc) project · 2007. 10. 2. · beowulf $ python setup.py install beowulf...

11
Presented by The Lapack for Clusters (LFC) Project Piotr Luszczek The MathWorks, Inc.

Upload: others

Post on 05-Mar-2021

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

Presented by

The Lapack for Clusters(LFC) Project

Piotr LuszczekThe MathWorks, Inc.

Page 2: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

2 Luszczek_LFC_SC07

LFC: Overview

• Interactive clients− Mathematica− MATLAB− Python

0,0

Tunnel (IP, TCP, ....)

Firewall

Server

Clients

Server Software

Page 3: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

3 Luszczek_LFC_SC07

LFC: Behind the scenes

InternetIntranet

Shared memory...

x = lfc.gesv(A, b)

x = b.copy()command('pdgesv', A.id, x.id)

send(c_sckt, buf) recv(s_sckt, buf)

call pdgesv(A, x)

Batch mode bypass

Page 4: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

4 Luszczek_LFC_SC07

LFC: Current functionality• Linear systems (via factorizations)

− Cholesky: A = UTU A = LLT− Gaussian: PA = LU− Least Squares: A = QR

• Singular- and eigen-value problems− A = UΣVT (thin SVD)− AV=VΛ=AHV (symmetric AEP)− AV = VΛ (non-symmetric AEP)

• Norms, condition-number estimates

• Precision, data types− Single, double− Real, complex− Mixed precision (by upcasting)

• User data routines− Loading/Saving

• MPI I/O• ...

• Generating− Plug-ins− Moving

• More to come…− Now working on sparse

matrices support

Page 5: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

5 Luszczek_LFC_SC07

LFC: Design and implementation

Client logic (Python)

Server logic (Python)

Jython PLW

PLW

Prototyping Deployment

Java

● C● MathLink● MEX

beowulf $ python setup.py installbeowulf $ mpirun python server.py

Pyrex

beowulf $ ./configurebeowulf $ makebeowulf $ make installbeowulf $ mpiexec server

Network

Page 6: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

6 Luszczek_LFC_SC07

LFC: Implemented MATLAB functionality

Explicit matrix inverse0000Inv

Condition number estimate√√√√Cond

Matrix/vector norm√√√√Norm

Matrix/vector hermitian transpose√√n/an/aHerm

Matrix/vector transpose√√√√Trans

Diagonal matrix/vector√√√√Diag

Hermitian eigenvalue problem√√n/an/aHeev

Symmetric eigenvalue problemn/an/a√√Syev

Eigenvalue problem: AX=XΛ-1-1-1-1Eig

Singular-value decomposition: A=UΣVT√√√√Svd

QR factorization+pivoting: PA=QR-1-1-1-1qrp

QR factorization: A = QR-1-1√√qr

LU factorization: PA=LU√√√√lu

Cholesky factorization: LLT, UTU√√√√chol

DescriptionD-ComplexS-ComplexDoubleSingleName

Page 7: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

7 Luszczek_LFC_SC07

Sample LFC code: Linear system solve

• MATLAB with LFC (parallel):n = lfc(1000);nrhs = 1;A = rand(n);b = rand(n, 1);x = A \ b;r = A*x – b;norm(r, ‘fro’)

• MATLAB – no LFC (sequential):n = 1000;nrhs = 1;A = rand(n);b = rand(n, 1);x = A \ b;r = A*x – b;norm(r, ‘fro’)

• Python with LFC (parallel):n = 1000nrhs = 1A = lfc.rand(n)b = lfc.rand(n, 1)x = lfc.solve(A, b)r = A*x – bprint r.norm(‘F’)

Page 8: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

8 Luszczek_LFC_SC07

LFC’s C interface: Sequential calls,parallel execution• In-memory routines

− LFC_•gels()− LFC_•gesv()− LFC_•posv()

• Limitations− Data must fit on caller

• Cluster state functions− LFC_hosts_create()− LFC_hosts_free()− LFC_get_available_CPU()− LFC_get_free_memory()

• Disk-based routines− LFC_•gels_file_all()− LFC_•gesv_file_all()− LFC_•posv_file_all()

• Limitations− Must pay I/O cost each time

Page 9: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

9 Luszczek_LFC_SC07

LFC’s ease of deployment

• Only one file to download• Just type: ./configure && make && make install

ScaLAPACK

LAPACK

BLAS (vendor)

PBLAS

BLACSMPI

LFC clients: C, Mathematica, MATLAB, Python

BLAS (LFC)

serial interface

parallel interface

global addressing

portable

local addressing

platform specific

External to LFC

External to LFC

Page 10: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

10 Luszczek_LFC_SC07

Software technology used by LFC

• Client− Python

• Sockets− MATLAB

• Embedded Java• Jython

− Reuse of Python code

− C/C++• Code:

− fork()− execvp()

• Shell (implicit)− mpirun− mpiexec

• Server− Libraries

• MPI• BLAS• BLACS• LAPACK• ScaLAPACK

− Languages• Python• Pyrex (C wrappers)• PLW

− Python compiler− Translation to C

Page 11: The Lapack for Clusters (LFC) Project · 2007. 10. 2. · beowulf $ python setup.py install beowulf $ mpirun python server.py Pyrex beowulf $ ./configure beowulf $ make beowulf $

11 Luszczek_LFC_SC07

Contact

Piotr Luszczek

The MathWorks, Inc.(508) [email protected]

http://icl.cs.utk.edu/lfc/