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 blacklight and warhol.
Blacklight Usage
- 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 withmodule 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 withmodule avail gcc
You can determine the default version of gcc by typing:module show gcc
- 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
- 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.
Sample job
See the sample blacklight PETSc jobs.
Warhol Usage
- Prepare a batch job containing commands to do the following:
- Load the PETSc module with
module load petsc
which defines the necessary environment variables. - 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
- 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.
- Load the PETSc module with
- Submit the batch job with the qsub command.
Sample job
See the sample warhol PETSc jobs.