A demo using PETSc - UC Denvermath.ucdenver.edu/~mmccourt/talks/kernel-petsc-aug10.pdf ·...

22
Distributed Kernel Finite Difference A demo using PETSc Michael McCourt [email protected]

Transcript of A demo using PETSc - UC Denvermath.ucdenver.edu/~mmccourt/talks/kernel-petsc-aug10.pdf ·...

Distributed Kernel Finite DifferenceA demo using PETSc

Michael McCourt

[email protected]

OVERVIEW

A brief demonstration of the core

PETSc tools and how localized kernel

approximations can be executed in a

distributed setting.

WHAT IS PETSc?

A freely available and supported research code for

the parallel solution of nonlinear algebraic

equations: http://www.mcs.anl.gov/petsc

Support via email: [email protected]

Usable from C, C++, Fortran 77/90, Matlab, Julia,

and Python

WHAT DOES PETSc DO?

PETSc has run implicit problems with over 500 billion unknowns

● UNIC on BG/P and XT5

● PFLOTRAN for flow in porous media

PETSc has run on over 1,500,000 cores efficiently

● Gordon Bell Prize Mantle Convection on IBM BG/Q Sequoia

PETSc applications have run at 23% of peak (600 Teraflops)

● Jed Brown on NERSC Edison

WHAT DOES PETSc DO?

● Eliminate the MPI from MPI programming!

● Provide wrappers to other useful libraries.

● Provide high level access to GPU computing.

PETSc is not a black-box PDE solver. Examples are

provided but you have to build your own solution.

WHAT DOES PETSc PROVIDE?

● Many (parallel) vector/array operations

● Numerous (parallel) matrix formats and operations

● Numerous linear solvers

● Nonlinear solvers

● Limited ODE integrators

● Limited parallel grid/data management

● Common interface for most DOE solver software ...

WHAT DOES PETSc PROVIDE?

WHAT DOES PETSc PROVIDE?

WHAT DOES PETSc PROVIDE?

PETSc STRUCTURE

PETSc PROGRAMMING IDEALS

● Distributed memory, “shared-nothing” ○ Requires only a standard compiler○ Access to data on remote machines through

MPI● Hide within objects the details of the communication● User orchestrates communication at a higher

abstract level than direct MPI calls

PETSc PDE FLOW

PETSc NUMERICAL COMPONENTS

PETSc LINEAR SOLVE STRUCTURE

BUILDING A DISTRIBUTED VECTOR

LOADING A DISTRIBUTED VECTOR

COMMUNICATING VECTOR ENTRIES

PREPARING THE DIFFERENTIATION MATRIX

Match data distribution between matrix and vector

Preallocate memoryCompressed Sparse Row

POPULATING THE DIFFERENTIATION MATRIX

INTERPOLATION MATRIX ENTRIES

FORMING THE DIFFERENTIATION MATRIX

COMPUTING THE DERIVATIVE

Confirm It Is Accurate