# PCSPAISetBlockSize

set the block size for the SPAI preconditioner

### Synopsis

    #include "petscpc.h"
    PetscErrorCode PETSCKSP_DLLEXPORT PCSPAISetBlockSize(PC pc,int block_size1)

### Input Parameters

| pc | - the preconditioner
| n | - block size (default 1)

Notes: A block size of 1 treats A as a matrix of scalar elements. A block size of s > 1 treats A as a matrix of sxs blocks. A block size of 0 treats A as a matrix with variable sized blocks, which are determined by searching for dense square diagonal blocks in A. This can be very effective for finite-element matrices.

SPAI will convert A to block form, use a block version of the preconditioner algorithm, and then convert the result back to scalar form.

In many cases the a block-size parameter other than 1 can lead to very significant improvement in performance.

### See Also

PCSPAI, PCSetType()

Level:intermediate
Location:src/ksp/pc/impls/spai/ispai.c
Index of all PC routines
Table of Contents for all manual pages
Index of all manual pages