PETSc

PETSc, the Portable Extensible Toolkit for Scientific Computation, is a suite of data structures and routines for the uni- and parallel processor solution of large-scale scientific application problems modeled by partial differential equations. PETSc employs the MPI standard for all message-passing communication. The code is written in a data-structure-neutral manner to enable easy reuse and flexibility.

PETSc integrates a hierarchy of components, enabling the user to employ the level of abstraction that is most natural for a particular problem. Some of the components are:

  • Mat - a suite of data structures and code for the manipulation of parallel sparse matrices;
  • PC - a collection of preconditioners;
  • KSP - data-structure-neutral implementations of many popular Krylov space iterative methods;
  • SLES - a higher-level interface for the solution of large-scale linear systems;
  • SNES - data-structure-neutral implementations of Newton-like methods for nonlinear systems.

Installed on bigben, pople and warhol.

Bigben Usage

  • Prepare a batch job containing commands to do the following:
    1. Load the Petsc module with
      module load petsc
      which defines the necessary environment variables. Note that you can determine the default version of PETSc by typing:
      module show petsc
    2. Compile your program. Use the appropriate version of PETSc:
        -O, Optimized for Fortran or C
        -g, Debug version for Fortran or C
        -O_c++, Optimized for C++
        -g_c++, Debug version for C++

      For example, to use the debug version, in the C shell:
      setenv BOPT g
      or, when compiling:
      make BOPT=g prog
    3. Use pbsyod to execute the program.
      pbsyod -size $PBS_O_SIZE prog
  • Submit the batch job with the qsub command.

Sample job

See the sample bigben petsc jobs.

Pople Usage

  • Prepare a batch job containing commands to do the following:
    1. Set up the module command for batch usage, depending on the shell you use.
    2. Load the Petsc module with
      module load petsc
      which defines the necessary environment variables. Note that you can determine the default version of PETSc by typing:
      module show petsc
    3. Compile your program. Use the appropriate version of PETSc:
        -O, Optimized for Fortran or C
        -g, Debug version for Fortran or C
        -O_c++, Optimized for C++
        -g_c++, Debug version for C++

      For example, to use the debug version, in the C shell:
      setenv BOPT g
      or, when compiling:
      make BOPT=g prog
    4. Use the mpirun to execute the program.
      mpirun -np  x prog
      where x is the number of cores. This should be the same number set with the PBS ncpus directive.
  • Submit the batch job with the qsub command.

Sample job

See the sample pople petsc jobs.

Warhol Usage

  • Prepare a batch job containing commands to do the following:
    1. Load the Petsc module with
      module load petsc
      which defines the necessary environment variables.
    2. Compile your program. Use the appropriate version of PETSc:
        -O, Optimized for Fortran or C
        -g, Debug version for Fortran or C
        -O_c++, Optimized for C++
        -g_c++, Debug version for C++

      For example, to use the debug version, in the C shell:
      setenv BOPT g
      or, when compiling:
      make BOPT=g prog
    3. Use the mpirun to execute the program.
      mpirun -np  x prog
      where x is the number of cores. This should be the same number set with the PBS nodes=x:ppn=y directive.
  • Submit the batch job with the qsub command.

Sample job

See the sample warhol petsc jobs.

Other PETSc documentation

See also

  • Other software installed at PSC.