# PCBJACOBI
Use block Jacobi preconditioning, each block is (approximately) solved with its own `KSP` object. 
## Options Database Keys

- ***-pc_use_amat -*** use Amat to apply block of operator in inner Krylov method
- ***-pc_bjacobi_blocks <n> -*** use n total blocks



## Notes
See `PCJACOBI` for diagonal Jacobi, `PCVPBJACOBI` for variable point block, and `PCPBJACOBI` for fixed size point block

Each processor can have one or more blocks, or a single block can be shared by several processes. Defaults to one block per processor.

To set options on the solvers for each block append -sub_ to all the `KSP` and `PC`
options database keys. For example, -sub_pc_type ilu -sub_pc_factor_levels 1 -sub_ksp_type preonly

To set the options on the solvers separate for each block call `PCBJacobiGetSubKSP()`
and set the options directly on the resulting `KSP` object (you can access its `PC`
`KSPGetPC())`

For GPU-based vectors (`VECCUDA`, `VECViennaCL`) it is recommended to use exactly one block per MPI process for best
performance.  Different block partitioning may lead to additional data transfers
between host and GPU that lead to degraded performance.

When multiple processes share a single block, each block encompasses exactly all the unknowns owned its set of processes.




## See Also
 `PCCreate()`, `PCSetType()`, `PCType`, `PC`, `PCType`,
`PCASM`, `PCSetUseAmat()`, `PCGetUseAmat()`, `PCBJacobiGetSubKSP()`, `PCBJacobiSetTotalBlocks()`,
`PCBJacobiSetLocalBlocks()`, `PCSetModifySubMatrices()`, `PCJACOBI`, `PCVPBJACOBI`, `PCPBJACOBI`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/bjacobi/bjacobi.c.html#PCBJACOBI">src/ksp/pc/impls/bjacobi/bjacobi.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/swarm/tutorials/ex1.c.html">src/dm/impls/swarm/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex7.c.html">src/ksp/ksp/tutorials/ex7.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex7f.F90.html">src/ksp/ksp/tutorials/ex7f.F90.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/bjacobi/bjacobi.c)


[Index of all PC routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
