+ All Categories
Home > Documents > Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... ·...

Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... ·...

Date post: 25-Mar-2021
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
12
Meeting 12 - MAGMA - sparse matrix Gabriel Wlazłowski
Transcript
Page 1: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

Meeting 12

- MAGMA- sparse matrix

GabrielWlazłowski

Page 2: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

https://icl.cs.utk.edu/magma/

Page 3: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

Extensive library of examples:

https://developer.nvidia.com/sites/default/files/akamai/cuda/files/Misc/mygpu.pdf

See:inversion-magma.cSee:inversion-magma.c

Page 4: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

I took such code…

see:google_inversion.c

Page 5: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

Consider heat equation (1D):

Using finite difference:

discretization

Updating scheme

Matrix is sparse!

→ Sparse matrices are very common to problems that utilize finite difference methods

Page 6: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

Consider Poisson’s equation:

Algebraic problem: sparse linear system

3D case

Page 7: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl
Page 8: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

Sparse matrix - representation

The COO format is a particularly simple storage scheme.

It is defined by the three arrays.

Page 9: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

Sparse matrix - representation

The CSR format is the most popular sparse matrix representation.

It stores column indices and nonzero values in two arrays and uses a third array of row pointers, to mark the boundaries of each row

Analogous CSC (Compressed Sparse Column)

Page 10: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

See:example_sparse.cfrom MAGMA library

See:example_sparse.cfrom MAGMA library

Page 11: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

Preparation for lab 13:

1) Register to PL-Grid:

https://portal.plgrid.pl/registration/form

For more info see: https://docs.cyfronet.pl/display/PLGDoc/User+Manual#UserManual-Basicinformation

To confirm affilition, you can use my data as “Supervisor’s affiliation”:

Name: GabrielSurname: WlazlowskiE-mail: [email protected]: 225935

2) Create trial grant

3) Activate service: access to Zeus supercomputer, or access to Eagle supercomputr, or other

4) Try to login to the granted supercomputer

Page 12: Meeting 12 - MAGMA - sparse matrixwlazlowski.fizyka.pw.edu.pl/pdfs/dydaktyka/NTO/meeting... · 2020. 5. 27. · Name: Gabriel Surname: Wlazlowski E-mail: gabriel.wlazlowski@pw.edu.pl

Task for lab 13:

1) Execute strong scaling of MPI code (preferably your code constructed for matrix diagonalization, if you do not have this code working yet, use demonstration code for matrix inversion inversion-scalapack.c)

2) Execute strong scaling using one of computers provided by PL-Grid (via trial grant)

3) Suppose that your problem requires 100 diagonalizations (inversions) of matrix of size 25,000 x 25,000.

For such problem propose parameters of runs (how many nodes/cores), estimate time-to-solution, and estimate needed budget (CPU-hours),

4) Deadline: will be provided during lab. Weight: 2 In the report provide:

→ compilation script / command and sample of your submission script, → strong scaling plot, → Proposition of execution parameters with time-to-solution and cost estimation

with short justification, why you selected these parameters.

Time-to-solution: time needed by a computer to solve you problem (hr, min, sec, …) strongly depends on running parameters like number of processes

Computing cost = Time-to-solution x number of processes (CPU-hr, Node-hr, GPU-hr…) Example: if your code was running for 1 hour using 100 CPUs then computing cost was 100 CPU-hr.


Recommended