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 blacklight.
- Prepare a batch script containing commands to do the following:
- Set up the module command for batch usage, depending on the shell you use.
- Load the PETSc module with
module load petsc
which defines the necessary environment variables. Note that you can determine which versions of PETSc are available with
module avail petsc
You can determine the default version of PETSc by typing:
module show petsc
- Load the gcc module with
module load gcc
Note that you can determine which versions of gcc are available with
module avail gcc
You can determine the default version of gcc by typing:
module show gcc
- Compile your program. Use the appropriate version of PETSc:
For example, to use the debug version, in the C shell:
setenv BOPT g
or, when compiling:
make BOPT=g prog
- Use mpirun to execute the program.
mpirun -np $PBS_NCPUS prog
where $PBS_NCPUS will be set to the number of cores requested with the PBS ncpus directive.
- Submit the batch job with the qsub command.