Skip to content

JuliaParallel/PETSc.jl

Repository files navigation

PETSc

Build Status doc dev

PETSc.jl provides an interface to the PETSc library, allowing the combination of Julia features (such as automatic differentiation) with the PETSc's infrastructure, including linear, nonlinear, and optimization solvers, timesteppers, domain management (DM), and more, in a distributed-memory (MPI) environment.

This package comprises two main components:

  1. An automatically generated, low-level interface for large parts of the PETSc API.
  2. A curated, high-level, more Julianic interface for selected functionality.

The low-level interface covers the entire PETSc API, but may be awkward to work with and likely requires previous experience with PETSc to use effectively. The high level interface is designed to be more familiar and convenient for Julia users but exposes only a small portion of the functionality of the underlying library. This high-level interface should be considered unstable, as its implementation involves design decisions which may be revisited - note the low version number of this package if relying on these high-level features.

Installation

This package can be added with the julia command:

]add PETSc

The installation can be tested with

]test PETSc

BinaryBuilder Version

By default, the package uses a pre-built binary of PETSc along with a default installation of MPI.jl. Note that the distributed version of PETSc is using real, Float64 numbers; build details can be found here

System Builds

If you want to use the package with custom builds of the PETSc library, this can be done by specifying the environment variable JULIA_PETSC_LIBRARY. This is a colon separated list of paths to custom builds of PETSc; the reason for using multiple builds is to enable single, double, and complex numbers in the same julia session. These should be built against the same version of MPI as used with MPI.jl

After setting the variable you should

]build PETSc

and the library will be persistently set until the next time the build command is issued.

To see the currently set library use

using PETSc
PETSc.libs