petsc-3.4.5 2014-06-29


Merge the two inner products needed in CG into a single MPI_Allreduce() call.


#include "petscksp.h" 
PetscErrorCode  KSPCGUseSingleReduction(KSP ksp,PetscBool flg)
Logically Collective on KSP

Input Parameters

ksp - the iterative context
flg - turn on or off the single reduction

Options Database

-ksp_cg_single_reduction -

The algorithm used in this case is described as Method 1 in Lapack Working Note 56, "Conjugate Gradient Algorithms with Reduced Synchronization Overhead Distributed Memory Multiprocessors", by E. F. D'Azevedo, V. L. Eijkhout, and C. H. Romine, December 3, 1999. V. Eijkhout creates the algorithm initially to Chronopoulos and Gear.

It requires two extra work vectors than the conventional implementation in PETSc.

See also KSPPIPECG, KSPPIPECR, and KSPGROPPCG that use non-blocking reductions.


CG, conjugate gradient, Hermitian, symmetric, set, type, KSPPGMRES

Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages