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 all message-passing communication.
Access and Usage:
PETSc version 3.16.3 has been installed on JURECA (on the current default stage: Stages/2022).
It is not available on JURECA Booster.
PETSc/3.16.3 is configured with standard double precision and integer values.
Other configurations can also be installed on request.
Older versions including other configurations are still available on older stages.
Preparations necessary to use PETSc on JURECA
First you have to load the PETSc version you want, for example with the GCC compiler and ParaStationMPI the latest PETSc version can be loaded with:
module load GCC/11.2.0
module load ParaStationMPI/5.5.0-1
module load PETSc/3.16.3
With that command the variables PETSC_DIR and PETSC_ARCH are set.
If you don't want to use the PETSc makefiles make sure that your makefile contains the statements
include $PETSC_DIR/$PETSC_ARCH/lib/petsc/conf/petscvariables
include $PETSC_DIR/$PETSC_ARCH/lib/petsc/conf/petscrules
Examples
Examples are available in $PETSC_DIR/share/petsc/examples/src/vec/vec/tutorials/ex1.c .
To run for instance ex1 from $PETSC_DIR/share/petsc/examples/src/vec/vec/tutorials you have to do the following:
# load the PETSc you want
see “Preparations”
# copy ex1.c and the makefile to the current directory
cp $PETSC_DIR/share/petsc/examples/src/vec/vec/tutorials/ex1.c .
cp $PETSC_DIR/share/petsc/examples/src/vec/vec/tutorials/makefile .
# compile and link the example code
make ex1
To execute the example on 2 processors you have to write a batchfile runex1.exe with the following commands:
#!/bin/bash -x
#SBATCH --nodes=1
#SBATCH --ntasks=2
#SBATCH --partition=dc-cpu
#SBATCH --account=<your project>
srun -np 2 ex1
To submit the batchfile to the slurm batchsystem say
sbatch runex1.exe
In the sources of the examples you find a section //TEST where you can see how the examples have to be executed.
Version:
optimised and debug version
real and complex version
JURECA: 3.16.3, (3.14 with downloads, complex version and version with 8Byte integer, debug versions only in Devel Stage)
JURECA Booster: not availabke
JUWELS: 3.16.3, (3.14 with downloads, complex version and version with 8Byte integer, debug versions only in Devel Stage)
JUSUF: 3.16.3, (3.14 with downloads, complex version and version with 8Byte integer, no debug version)
Documentation: PETSc on ANL WWW server