NERSCPowering Scientific Discovery Since 1974


Description and Overview

PETSc is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for parallelism.

On Cori and Edison PETSc is maintained as one of the Cray supported software packages.  

Cray PETSc includes the following packages:

  • MUMPS 
  • SuperLU 
  • SuperLU_dist 
  • ParMETIS 

How to Access PETSc at NERSC

To see all the available PETSc modules on a given machine use: module avail cray-petsc on Cori and Edison.

To select the default version use module load cray-petsc.  To select a specific version use, for example, module load petsc-complex/  

To get some specific usage information for a particular version use, for example, module help petsc-complex/3.2.02 .

Using PETSc on Edison and Cori

% module load cray-petsc
% ftn mycode.F90


On the Cray systems, after you have loaded a Cray-installed PETSc modulefile, you can use man intro_petsc to get some basic information.  More info is available in Cray's Programming Environment User's Guide.  The base document number for this is S–2529.  Cray documents are generally of the form S-xxxx-nnn, where nun relates to the release.  The June, 2014 release of the Programming Environment User's Guide is S–2529-116.

There are no man pages available with the ACTS installed versions; however, there are doc and tutorials directories with many useful documents and examples.  Use the module show version command to see the location.

Full documentation about PETSc is available on the PETSc home page.

For questions about using PETsc at NERSC contact the consultants,

Using Packages Within the Cray PETSc Release


You can view a sample MUMPS Fortran example code here.  This code happens to use double precision MUMPS routines.  To compile this code on Hopper using the Cray installation of PETSc and MUMPS you might use:

% module load cray-petsc
% ftn -Wl,-ydmumps_parallel_analysis_ dsimpletest.F

where the optional -Wl,-y compile flag simply tells the loader to state where the routine "dmumps_parallel_analysis" is loaded from and if you try this you'll see that it comes from the Cray "Third Party Software Library" (tpsl) libdmumps library, which is loaded automatically - both header files and library object archives - with the 'module load petsc' command.  A C example program is here.  Compile with cc simpletest.c.


A C example code is here.  Compile it on Hopper with cc ex11.c after loading the Cray PETSc modulefile. 


PackagePlatformCategoryVersionModuleInstall DateDate Made Default
petsc cori libraries/ math 3.4.5 petsc/3.4.5 2016-09-14
petsc cori libraries/ math 3.5.4 petsc/3.5.4 2016-09-14
petsc cori libraries/ math 3.6.4 petsc/3.6.4 2016-12-18
petsc cori libraries/ math 3.7.2 petsc/3.7.2 2016-07-19 2017-04-05
petsc cori libraries/ math 3.7.2-complex petsc/3.7.2-complex 2016-09-12
petsc cori libraries/ math 3.7.4 petsc/3.7.4 2017-05-01
petsc cori libraries/ math 3.7.4-64 petsc/3.7.4-64 2017-03-07
petsc cori libraries/ math 3.7.4-64-hugepages2m petsc/3.7.4-64-hugepages2m 2017-03-15
petsc cori libraries/ math 3.7.4-complex petsc/3.7.4-complex 2017-05-15
petsc cori libraries/ math 3.7.4-complex-v2 petsc/3.7.4-complex-v2 2017-06-09
petsc cori libraries/ math 3.7.4-hp-omp petsc/3.7.4-hp-omp 2017-05-02
petsc cori libraries/ math 3.8.4-64 petsc/3.8.4-64 2018-04-06
petsc cori libraries/ math 3.8.4-64-hdf5- petsc/3.8.4-64-hdf5- 2018-06-07
petsc cori libraries/ math 3.8.4-complex-64 petsc/3.8.4-complex-64 2018-04-05
petsc cori libraries/ math 3.8.4-complex-64-hdf5- petsc/3.8.4-complex-64-hdf5- 2018-06-11
petsc cori libraries/ math 3.9.1-64 petsc/3.9.1-64 2018-06-04
petsc cori libraries/ math 3.9.1-complex-64-hdf5- petsc/3.9.1-complex-64-hdf5- 2018-10-25
template cori other/ general 3.7.4-complex-v1 petsc/3.7.4-complex-v1 2017-05-23