Commits

Matt Knepley committed 61e3a0e Merge

Merge branch 'master' into knepley/feature-da-repartition

* master: (31 commits)
VecView_MPI_DA: fix gsizes bug (bad conversion in parent commit)
Make SNESJacobianFunction docs & code consistent.
IS: Fix comm for ISLocalToGlobalMappingApplyIS() Reported-by: Vincent Frans Maria De Groof <Vincent.De-Groof@uibk.ac.at>
TSARKIMEX: needs equation type to be specified when not mass matrix
remove all use of configuretime
make petscconfigureruntime not static so compiler won't compile when it is not used in errtrace.c
only color the begin and end line for traceback error messages
DMPlex: Need to protect this Free()
Revert "mpich: use latest mpich tarball with gcov but use '--enable-coverage' mpich configure option."
MatCreateTranspose: fix for lazy block size
Shorten default error message printed by PETSc to hopefully get people to read it and email it all Enclosed entire message with ---------- lines Color the begin and end lines and error message :-) Jed and Satish will hate this, I am open to removing it or making it optional?
mpich: use latest mpich tarball with gcov but use '--enable-coverage' mpich configure option.
configure: add FC_DEFINE_FLAG to petscvariables
removed unneeded includes in include files added findvisibleprivatefunctions for finding symbols in libraries that might not belong removed a couple of global symbols named spaced a couple of Tao functions
DMPlex: Fixes for CGNS - Fixed loop bounds since CGNS uses closed intervals - Bug with mixed cell types - Typo with coordinates
DMPlex: Added braindead simple parallel orientation solver - This gathers the graph to proc 0, solves, and scatters the answer - Need to store neighbor ranks and matches for each neighbor - This should be replaced with a parallel BFS
DMPlex: For 1D orientation, you have to use cone position rather than face orientation
makefile: Added 'make includegraph' to create an inclusion dependency graph.
Contrib: Updated include-graph.sh script to ignore *.hh files
introduced nonlinear solver HTML table changed gs and pc in SNES to ngs and npc for consistency and clarity
...

Comments (0)

Files changed (74)

bin/petsclogformat.py

          "MatAssemblyBegin",
          "MatAssemblyEnd",
 
-         "SNESGSEval",
-         "SNESGSFuncEval",
+         "SNESNGSEval",
+         "SNESNGSFuncEval",
          "SNESLineSearch",
          "SNESNPCSolve",
 

config/BuildSystem/config/compilers.py

     for flag in ['-D', '-WF,-D']:
       if self.setCompilers.checkCompilerFlag(flag+'Testing', body = '#define dummy \n           dummy\n#ifndef Testing\n       fooey\n#endif'):
         self.FortranDefineCompilerOption = flag
+        self.framework.addMakeMacro('FC_DEFINE_FLAG',self.FortranDefineCompilerOption)
         self.setCompilers.popLanguage()
         self.logPrint('Fortran uses '+flag+' for defining macro', 3, 'compilers')
         return

config/PETSc/Configure.py

   def dumpConfigInfo(self):
     import time
     fd = file(os.path.join(self.arch.arch,'include','petscconfiginfo.h'),'w')
-    fd.write('static const char *petscconfigureruntime = "'+time.ctime(time.time())+'";\n')
     fd.write('static const char *petscconfigureoptions = "'+self.framework.getOptionsString(['configModules', 'optionsModule']).replace('\"','\\"')+'";\n')
     fd.close()
     return

include/petsc-private/snesimpl.h

 
 PetscErrorCode SNESScaleStep_Private(SNES,Vec,PetscReal*,PetscReal*,PetscReal*,PetscReal*);
 
-PETSC_EXTERN PetscLogEvent SNES_Solve, SNES_LineSearch, SNES_FunctionEval, SNES_JacobianEval, SNES_GSEval, SNES_GSFuncEval, SNES_NPCSolve;
+PETSC_EXTERN PetscLogEvent SNES_Solve, SNES_LineSearch, SNES_FunctionEval, SNES_JacobianEval, SNES_NGSEval, SNES_NGSFuncEval, SNES_NPCSolve;
 
 extern PetscBool SNEScite;
 extern const char SNESCitation[];

include/petsc-private/taodmimpl.h

 #ifndef __TAODM_IMPL_H
 #define __TAODM_IMPL_H
-#include <petscdm.h>
+
 #include <petscdmda.h>
-#include <petsctaodm.h>
+#include <petsctao.h>
 
 struct _TaoDMOps {
   PetscErrorCode (*computeobjectiveandgradientlocal)(DMDALocalInfo*,PetscReal **, PetscReal *, PetscReal **, void*);

include/petscbt.h

   return 0;
 }
 
+PETSC_STATIC_INLINE PetscErrorCode PetscBTNegate(PetscBT array,PetscInt index)
+{
+  const PetscInt BT_idx  = (index)/PETSC_BITS_PER_BYTE;
+  const char     BT_mask = (char)1 << ((index)%PETSC_BITS_PER_BYTE);
+
+  array[BT_idx] ^= BT_mask;
+  return 0;
+}
+
 PETSC_STATIC_INLINE char PetscBTLookupClear(PetscBT array,PetscInt index)
 {
   char      BT_mask,BT_c;

include/petsccusp.h

 #if !defined(__PETSCCUSP_H)
 #define __PETSCCUSP_H
 
-#include <petscsys.h>
-#include <petscmath.h>
 #include <petscvec.h>
 #include <cusp/array1d.h>
 

include/petscdmda.h

 #define __PETSCDMDA_H
 
 #include <petscdm.h>
-#include <petscdt.h>
-#include <petscfetypes.h>
 #include <petscdmdatypes.h>
 #include <petscpf.h>
 #include <petscao.h>

include/petscis.h

 #if !defined(__PETSCIS_H)
 #define __PETSCIS_H
 #include <petscsys.h>
-#include <petscviewertypes.h>
 #include <petscsftypes.h>
 
 #define IS_FILE_CLASSID 1211218

include/petscmat.h

 PETSC_EXTERN PetscErrorCode MatSetLocalToGlobalMappingBlock(Mat,ISLocalToGlobalMapping,ISLocalToGlobalMapping);
 PETSC_EXTERN PetscErrorCode MatGetLocalToGlobalMapping(Mat,ISLocalToGlobalMapping*,ISLocalToGlobalMapping*);
 PETSC_EXTERN PetscErrorCode MatGetLocalToGlobalMappingBlock(Mat,ISLocalToGlobalMapping*,ISLocalToGlobalMapping*);
+PETSC_EXTERN PetscErrorCode MatGetLayouts(Mat,PetscLayout*,PetscLayout*);
 PETSC_EXTERN PetscErrorCode MatZeroRowsLocal(Mat,PetscInt,const PetscInt [],PetscScalar,Vec,Vec);
 PETSC_EXTERN PetscErrorCode MatZeroRowsLocalIS(Mat,IS,PetscScalar,Vec,Vec);
 PETSC_EXTERN PetscErrorCode MatZeroRowsColumnsLocal(Mat,PetscInt,const PetscInt [],PetscScalar,Vec,Vec);

include/petscsnes.h

 #define SNESNGMRES       "ngmres"
 #define SNESQN           "qn"
 #define SNESSHELL        "shell"
-#define SNESGS           "gs"
+#define SNESNGS          "ngs"
 #define SNESNCG          "ncg"
 #define SNESFAS          "fas"
 #define SNESMS           "ms"
 PETSC_EXTERN PetscErrorCode SNESSetFunctionType(SNES,SNESFunctionType);
 PETSC_EXTERN PetscErrorCode SNESGetFunctionType(SNES,SNESFunctionType*);
 
-PETSC_EXTERN PetscErrorCode SNESSetGS(SNES,PetscErrorCode (*SNESGSFunction)(SNES,Vec,Vec,void*),void*);
-PETSC_EXTERN PetscErrorCode SNESGetGS(SNES,PetscErrorCode (**SNESGSFunction)(SNES,Vec,Vec,void*),void**);
-PETSC_EXTERN PetscErrorCode SNESSetUseGS(SNES,PetscBool);
-PETSC_EXTERN PetscErrorCode SNESGetUseGS(SNES,PetscBool *);
-PETSC_EXTERN PetscErrorCode SNESComputeGS(SNES,Vec,Vec);
+PETSC_EXTERN PetscErrorCode SNESSetNGS(SNES,PetscErrorCode (*)(SNES,Vec,Vec,void*),void*);
+PETSC_EXTERN PetscErrorCode SNESGetNGS(SNES,PetscErrorCode (**)(SNES,Vec,Vec,void*),void**);
+PETSC_EXTERN PetscErrorCode SNESSetUseNGS(SNES,PetscBool);
+PETSC_EXTERN PetscErrorCode SNESGetUseNGS(SNES,PetscBool *);
+PETSC_EXTERN PetscErrorCode SNESComputeNGS(SNES,Vec,Vec);
 
-PETSC_EXTERN PetscErrorCode SNESGSSetSweeps(SNES,PetscInt);
-PETSC_EXTERN PetscErrorCode SNESGSGetSweeps(SNES,PetscInt *);
-PETSC_EXTERN PetscErrorCode SNESGSSetTolerances(SNES,PetscReal,PetscReal,PetscReal,PetscInt);
-PETSC_EXTERN PetscErrorCode SNESGSGetTolerances(SNES,PetscReal*,PetscReal*,PetscReal*,PetscInt*);
+PETSC_EXTERN PetscErrorCode SNESNGSSetSweeps(SNES,PetscInt);
+PETSC_EXTERN PetscErrorCode SNESNGSGetSweeps(SNES,PetscInt *);
+PETSC_EXTERN PetscErrorCode SNESNGSSetTolerances(SNES,PetscReal,PetscReal,PetscReal,PetscInt);
+PETSC_EXTERN PetscErrorCode SNESNGSGetTolerances(SNES,PetscReal*,PetscReal*,PetscReal*,PetscInt*);
 
 PETSC_EXTERN PetscErrorCode SNESUpdateCheckJacobian(SNES,PetscInt);
 
 
 PETSC_EXTERN PetscErrorCode SNESSetDM(SNES,DM);
 PETSC_EXTERN PetscErrorCode SNESGetDM(SNES,DM*);
-PETSC_EXTERN PetscErrorCode SNESSetPC(SNES,SNES);
-PETSC_EXTERN PetscErrorCode SNESGetPC(SNES,SNES*);
-PETSC_EXTERN PetscErrorCode SNESApplyPC(SNES,Vec,Vec,Vec);
-PETSC_EXTERN PetscErrorCode SNESGetPCFunction(SNES,Vec,PetscReal*);
-PETSC_EXTERN PetscErrorCode SNESComputeFunctionDefaultPC(SNES,Vec,Vec);
-PETSC_EXTERN PetscErrorCode SNESSetPCSide(SNES,PCSide);
-PETSC_EXTERN PetscErrorCode SNESGetPCSide(SNES,PCSide*);
+PETSC_EXTERN PetscErrorCode SNESSetNPC(SNES,SNES);
+PETSC_EXTERN PetscErrorCode SNESGetNPC(SNES,SNES*);
+PETSC_EXTERN PetscErrorCode SNESApplyNPC(SNES,Vec,Vec,Vec);
+PETSC_EXTERN PetscErrorCode SNESGetNPCFunction(SNES,Vec,PetscReal*);
+PETSC_EXTERN PetscErrorCode SNESComputeFunctionDefaultNPC(SNES,Vec,Vec);
+PETSC_EXTERN PetscErrorCode SNESSetNPCSide(SNES,PCSide);
+PETSC_EXTERN PetscErrorCode SNESGetNPCSide(SNES,PCSide*);
 PETSC_EXTERN PetscErrorCode SNESSetLineSearch(SNES,SNESLineSearch);
 PETSC_EXTERN PetscErrorCode SNESGetLineSearch(SNES,SNESLineSearch*);
 PETSC_EXTERN PetscErrorCode SNESRestrictHookAdd(SNES,PetscErrorCode (*)(SNES,SNES,void*),void*);
 PETSC_EXTERN PetscErrorCode SNESSetUpMatrices(SNES);
 PETSC_EXTERN PetscErrorCode DMSNESSetFunction(DM,PetscErrorCode(*)(SNES,Vec,Vec,void*),void*);
 PETSC_EXTERN PetscErrorCode DMSNESGetFunction(DM,PetscErrorCode(**)(SNES,Vec,Vec,void*),void**);
-PETSC_EXTERN PetscErrorCode DMSNESSetGS(DM,PetscErrorCode(*)(SNES,Vec,Vec,void*),void*);
-PETSC_EXTERN PetscErrorCode DMSNESGetGS(DM,PetscErrorCode(**)(SNES,Vec,Vec,void*),void**);
+PETSC_EXTERN PetscErrorCode DMSNESSetNGS(DM,PetscErrorCode(*)(SNES,Vec,Vec,void*),void*);
+PETSC_EXTERN PetscErrorCode DMSNESGetNGS(DM,PetscErrorCode(**)(SNES,Vec,Vec,void*),void**);
 PETSC_EXTERN PetscErrorCode DMSNESSetJacobian(DM,PetscErrorCode(*)(SNES,Vec,Mat,Mat,void*),void*);
 PETSC_EXTERN PetscErrorCode DMSNESGetJacobian(DM,PetscErrorCode(**)(SNES,Vec,Mat,Mat,void*),void**);
 PETSC_EXTERN PetscErrorCode DMSNESSetPicard(DM,PetscErrorCode(*)(SNES,Vec,Vec,void*),PetscErrorCode(*)(SNES,Vec,Mat,Mat,void*),void*);

include/petsctao.h

 
 PetscErrorCode VecFischer(Vec, Vec, Vec, Vec, Vec);
 PetscErrorCode VecSFischer(Vec, Vec, Vec, Vec, PetscReal, Vec);
-PetscErrorCode D_Fischer(Mat, Vec, Vec, Vec, Vec, Vec, Vec, Vec, Vec);
-PetscErrorCode D_SFischer(Mat, Vec, Vec, Vec, Vec, PetscReal, Vec, Vec, Vec, Vec, Vec);
+PetscErrorCode MatDFischer(Mat, Vec, Vec, Vec, Vec, Vec, Vec, Vec, Vec);
+PetscErrorCode MatDSFischer(Mat, Vec, Vec, Vec, Vec, PetscReal, Vec, Vec, Vec, Vec, Vec);
 
 
 /*E
 
 PETSC_EXTERN const char **TaoConvergedReasons;
 
-#include <petsctaolinesearch.h>
 
 PETSC_EXTERN PetscErrorCode TaoInitializePackage(void);
 PETSC_EXTERN PetscErrorCode TaoFinalizePackage(void);
 PETSC_EXTERN PetscErrorCode TaoResetStatistics(Tao);
 
 PETSC_EXTERN PetscErrorCode TaoGetKSP(Tao, KSP*);
+
+#include <petsctaolinesearch.h>
+PETSC_EXTERN PetscErrorCode TaoLineSearchUseTaoRoutines(TaoLineSearch, Tao);
 PETSC_EXTERN PetscErrorCode TaoGetLineSearch(Tao, TaoLineSearch*);
 
 PETSC_EXTERN PetscErrorCode TaoSetHistory(Tao,PetscReal*,PetscReal*,PetscReal*,PetscInt,PetscBool);
 PETSC_EXTERN PetscErrorCode TaoLCLSetStateDesignIS(Tao, IS, IS);
 PETSC_EXTERN PetscErrorCode TaoMonitor(Tao, PetscInt, PetscReal, PetscReal, PetscReal, PetscReal, TaoConvergedReason*);
 
+typedef struct _p_TaoDM* TaoDM;
+PETSC_EXTERN PetscClassId TAODM_CLASSID;
+
+PETSC_EXTERN PetscErrorCode TaoDMSetMatType(TaoDM *, const MatType);
+PETSC_EXTERN PetscErrorCode TaoDMCreate(MPI_Comm, PetscInt, void*, TaoDM**);
+PETSC_EXTERN PetscErrorCode TaoDMSetSolverType(TaoDM*, const TaoType);
+PETSC_EXTERN PetscErrorCode TaoDMSetOptionsPrefix(TaoDM *, const char []);
+PETSC_EXTERN PetscErrorCode TaoDMDestroy(TaoDM*);
+PETSC_EXTERN PetscErrorCode TaoDMDestroyLevel(TaoDM);
+PETSC_EXTERN PetscErrorCode TaoDMSetFromOptions(TaoDM*);
+PETSC_EXTERN PetscErrorCode TaoDMSetTolerances(TaoDM*,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal);
+PETSC_EXTERN PetscErrorCode TaoDMSetUp(TaoDM*);
+PETSC_EXTERN PetscErrorCode TaoDMSolve(TaoDM*);
+PETSC_EXTERN PetscErrorCode TaoDMView(TaoDM*, PetscViewer);
+PETSC_EXTERN PetscErrorCode TaoDMSetDM(TaoDM *, DM);
+PETSC_EXTERN PetscErrorCode TaoDMGetDM(TaoDM , DM*);
+PETSC_EXTERN PetscErrorCode TaoDMSetContext(TaoDM , void*);
+PETSC_EXTERN PetscErrorCode TaoDMGetContext(TaoDM , void**);
+
+PETSC_EXTERN PetscErrorCode TaoDMSetPreLevelMonitor(TaoDM*,PetscErrorCode(*)(TaoDM, PetscInt, void*),void*);
+PETSC_EXTERN PetscErrorCode TaoDMSetPostLevelMonitor(TaoDM*,PetscErrorCode(*)(TaoDM, PetscInt, void*),void*);
+PETSC_EXTERN PetscErrorCode TaoDMSetInitialGuessRoutine(TaoDM*,PetscErrorCode(*)(TaoDM,Vec));
+PETSC_EXTERN PetscErrorCode TaoDMSetVariableBoundsRoutine(TaoDM*,PetscErrorCode(*)(TaoDM,Vec, Vec));
+PETSC_EXTERN PetscErrorCode TaoDMSetObjectiveAndGradientRoutine(TaoDM*,PetscErrorCode(*)(Tao, Vec, PetscReal*, Vec, void*));
+PETSC_EXTERN PetscErrorCode TaoDMSetObjectiveRoutine(TaoDM*,PetscErrorCode(*)(Tao, Vec, PetscReal*, void*));
+PETSC_EXTERN PetscErrorCode TaoDMSetGradientRoutine(TaoDM*,PetscErrorCode(*)(Tao, Vec, Vec, void*));
+PETSC_EXTERN PetscErrorCode TaoDMSetHessianRoutine(TaoDM*,PetscErrorCode(*)(Tao, Vec, Mat*, Mat*, MatStructure*,void*));
+
+#include <petscdmda.h>
+
+PETSC_EXTERN PetscErrorCode TaoDMSetLocalObjectiveRoutine(TaoDM*,PetscErrorCode(*)(DMDALocalInfo*,PetscReal**,PetscReal*,void*));
+PETSC_EXTERN PetscErrorCode TaoDMSetLocalGradientRoutine(TaoDM*,PetscErrorCode(*)(DMDALocalInfo*,PetscReal**,PetscReal**,void*));
+PETSC_EXTERN PetscErrorCode TaoDMSetLocalObjectiveAndGradientRoutine(TaoDM*,PetscErrorCode(*)(DMDALocalInfo*,PetscReal**,PetscReal*,PetscReal**,void*));
+PETSC_EXTERN PetscErrorCode TaoDMSetLocalHessianRoutine(TaoDM*,PetscErrorCode(*)(DMDALocalInfo*,PetscReal**,Mat,void*));
+
+PETSC_EXTERN PetscErrorCode TaoDMFormFunctionLocal(Tao, Vec, PetscReal *, void*);
+PETSC_EXTERN PetscErrorCode TaoDMFormGradientLocal(Tao, Vec, Vec, void*);
+PETSC_EXTERN PetscErrorCode TaoDMFormFunctionGradientLocal(Tao, Vec, PetscReal *, Vec, void*);
+PETSC_EXTERN PetscErrorCode TaoDMFormHessianLocal(Tao, Vec, Mat*, Mat*, MatStructure*,void*);
+PETSC_EXTERN PetscErrorCode TaoDMFormBounds(Tao, Vec, Vec, void*);
+
 #endif

include/petsctaodm.h

-#ifndef __TAODM_H
-#define __TAODM_H
-#include <petscmat.h>
-#include <petscdm.h>
-#include <petsctao.h>
-
-typedef struct _p_TaoDM* TaoDM;
-PETSC_EXTERN PetscClassId TAODM_CLASSID;
-
-PETSC_EXTERN PetscErrorCode TaoDMSetMatType(TaoDM *, const MatType);
-PETSC_EXTERN PetscErrorCode TaoDMCreate(MPI_Comm, PetscInt, void*, TaoDM**);
-PETSC_EXTERN PetscErrorCode TaoDMSetSolverType(TaoDM*, const TaoType);
-PETSC_EXTERN PetscErrorCode TaoDMSetOptionsPrefix(TaoDM *, const char []);
-PETSC_EXTERN PetscErrorCode TaoDMDestroy(TaoDM*);
-PETSC_EXTERN PetscErrorCode TaoDMDestroyLevel(TaoDM);
-PETSC_EXTERN PetscErrorCode TaoDMSetFromOptions(TaoDM*);
-PETSC_EXTERN PetscErrorCode TaoDMSetTolerances(TaoDM*,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal);
-PETSC_EXTERN PetscErrorCode TaoDMSetUp(TaoDM*);
-PETSC_EXTERN PetscErrorCode TaoDMSolve(TaoDM*);
-PETSC_EXTERN PetscErrorCode TaoDMView(TaoDM*, PetscViewer);
-PETSC_EXTERN PetscErrorCode TaoDMSetDM(TaoDM *, DM);
-PETSC_EXTERN PetscErrorCode TaoDMGetDM(TaoDM , DM*);
-PETSC_EXTERN PetscErrorCode TaoDMSetContext(TaoDM , void*);
-PETSC_EXTERN PetscErrorCode TaoDMGetContext(TaoDM , void**);
-
-PETSC_EXTERN PetscErrorCode TaoDMSetPreLevelMonitor(TaoDM*,PetscErrorCode(*)(TaoDM, PetscInt, void*),void*);
-PETSC_EXTERN PetscErrorCode TaoDMSetPostLevelMonitor(TaoDM*,PetscErrorCode(*)(TaoDM, PetscInt, void*),void*);
-PETSC_EXTERN PetscErrorCode TaoDMSetInitialGuessRoutine(TaoDM*,PetscErrorCode(*)(TaoDM,Vec));
-PETSC_EXTERN PetscErrorCode TaoDMSetVariableBoundsRoutine(TaoDM*,PetscErrorCode(*)(TaoDM,Vec, Vec));
-PETSC_EXTERN PetscErrorCode TaoDMSetObjectiveAndGradientRoutine(TaoDM*,PetscErrorCode(*)(Tao, Vec, PetscReal*, Vec, void*));
-PETSC_EXTERN PetscErrorCode TaoDMSetObjectiveRoutine(TaoDM*,PetscErrorCode(*)(Tao, Vec, PetscReal*, void*));
-PETSC_EXTERN PetscErrorCode TaoDMSetGradientRoutine(TaoDM*,PetscErrorCode(*)(Tao, Vec, Vec, void*));
-PETSC_EXTERN PetscErrorCode TaoDMSetHessianRoutine(TaoDM*,PetscErrorCode(*)(Tao, Vec, Mat*, Mat*, MatStructure*,void*));
-
-PETSC_EXTERN PetscErrorCode TaoDMSetLocalObjectiveRoutine(TaoDM*,PetscErrorCode(*)(DMDALocalInfo*,PetscReal**,PetscReal*,void*));
-PETSC_EXTERN PetscErrorCode TaoDMSetLocalGradientRoutine(TaoDM*,PetscErrorCode(*)(DMDALocalInfo*,PetscReal**,PetscReal**,void*));
-PETSC_EXTERN PetscErrorCode TaoDMSetLocalObjectiveAndGradientRoutine(TaoDM*,PetscErrorCode(*)(DMDALocalInfo*,PetscReal**,PetscReal*,PetscReal**,void*));
-PETSC_EXTERN PetscErrorCode TaoDMSetLocalHessianRoutine(TaoDM*,PetscErrorCode(*)(DMDALocalInfo*,PetscReal**,Mat,void*));
-
-PETSC_EXTERN PetscErrorCode TaoDMFormFunctionLocal(Tao, Vec, PetscReal *, void*);
-PETSC_EXTERN PetscErrorCode TaoDMFormGradientLocal(Tao, Vec, Vec, void*);
-PETSC_EXTERN PetscErrorCode TaoDMFormFunctionGradientLocal(Tao, Vec, PetscReal *, Vec, void*);
-PETSC_EXTERN PetscErrorCode TaoDMFormHessianLocal(Tao, Vec, Mat*, Mat*, MatStructure*,void*);
-PETSC_EXTERN PetscErrorCode TaoDMFormBounds(Tao, Vec, Vec, void*);
-
-#endif

include/petsctaolinesearch.h

 PETSC_EXTERN PetscErrorCode TaoLineSearchGetType(TaoLineSearch, const TaoLineSearchType *);
 PETSC_EXTERN PetscErrorCode TaoLineSearchSetType(TaoLineSearch, const TaoLineSearchType);
 
-PETSC_EXTERN PetscErrorCode TaoLineSearchUseTaoRoutines(TaoLineSearch, Tao);
 PETSC_EXTERN PetscErrorCode TaoLineSearchIsUsingTaoRoutines(TaoLineSearch, PetscBool *);
 PETSC_EXTERN PetscErrorCode TaoLineSearchSetObjectiveAndGTSRoutine(TaoLineSearch, PetscErrorCode(*)(TaoLineSearch, Vec, Vec, PetscReal*, PetscReal*, void*), void*);
 PETSC_EXTERN PetscErrorCode TaoLineSearchSetObjectiveRoutine(TaoLineSearch, PetscErrorCode(*)(TaoLineSearch, Vec, PetscReal*,void*), void*);

include/petscviennacl.h

 
 #define VIENNACL_WITH_OPENCL
 
-#include <petscsys.h>
-#include <petscmath.h>
 #include <petscvec.h>
 #include <viennacl/vector.hpp>
 
 mergegcov:
 	-@${PETSC_DIR}/bin/maint/gcov.py -merge_gcov ${LOC} *.tar.gz
 
-# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
-allrcslabel:
-	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
+########################
+#
+# Create the include dependency graph (requires graphviz to be available)
+#
+includegraph:
+	-@${PETSC_DIR}/src/contrib/style/include-graph.sh includegraph.pdf
+	-@echo Include dependency graph written to includegraph.pdf
+
 #
 # -------------------------------------------------------------------------------
 #

src/contrib/style/include-graph.sh

 #
 
 # Set labels
-for f in `ls include/*.{h,hh}`
+for f in `ls include/*.h`
 do
   f2=${f#include/}
   f3=${f2/%.hh/2}
 # Set connections
 echo "  " >> $dotfilename
 echo "  //Connections to petsc-private:" >> $dotfilename
-for f in `ls include/*.{h,hh}`
+for f in `ls include/*.h`
 do
   f2=${f#include/}
   f3=${f2/%.hh/2}

src/dm/impls/da/dadestroy.c

 #include <petsc-private/dmdaimpl.h>    /*I   "petscdmda.h"   I*/
 
 /* Logging support */
-PetscClassId  ADDA_CLASSID;
 PetscLogEvent DMDA_LocalADFunction;
 
 #undef __FUNCT__

src/dm/impls/da/gr2.c

   gsizes[0]  = dof;
   ierr       = PetscMPIIntCast(dd->M,gsizes+1);CHKERRQ(ierr);
   ierr       = PetscMPIIntCast(dd->N,gsizes+2);CHKERRQ(ierr);
-  ierr       = PetscMPIIntCast(dd->P,gsizes+1);CHKERRQ(ierr);
+  ierr       = PetscMPIIntCast(dd->P,gsizes+3);CHKERRQ(ierr);
   lsizes[0]  = dof;
   ierr       = PetscMPIIntCast((dd->xe-dd->xs)/dof,lsizes+1);CHKERRQ(ierr);
   ierr       = PetscMPIIntCast(dd->ye-dd->ys,lsizes+2);CHKERRQ(ierr);

src/dm/impls/plex/plex.c

     ierr = PetscBTSet(seenCells, support[0]-cStart);CHKERRQ(ierr);
     ierr = PetscBTSet(seenCells, support[1]-cStart);CHKERRQ(ierr);
   }
+  /* Now all subdomains are oriented, but we need a consistent parallel orientation */
+  {
+    /* Find a representative face (edge) separating pairs of procs */
+    PetscSF            sf;
+    const PetscInt    *lpoints;
+    const PetscSFNode *rpoints;
+    PetscInt          *neighbors, *nranks;
+    PetscInt           numLeaves, numRoots, numNeighbors = 0, l, n;
+
+    ierr = DMGetPointSF(dm, &sf);CHKERRQ(ierr);
+    ierr = PetscSFGetGraph(sf, &numRoots, &numLeaves, &lpoints, &rpoints);CHKERRQ(ierr);
+    if (numLeaves >= 0) {
+      const PetscInt *cone, *ornt, *support;
+      PetscInt        coneSize, supportSize;
+      int            *rornt, *lornt; /* PetscSF cannot handle smaller than int */
+      PetscBool      *match, flipped = PETSC_FALSE;
+
+      ierr = PetscMalloc1(numLeaves,&neighbors);CHKERRQ(ierr);
+      /* I know this is p^2 time in general, but for bounded degree its alright */
+      for (l = 0; l < numLeaves; ++l) {
+        const PetscInt face = lpoints[l];
+        if ((face >= fStart) && (face < fEnd)) {
+          const PetscInt rank = rpoints[l].rank;
+          for (n = 0; n < numNeighbors; ++n) if (rank == rpoints[neighbors[n]].rank) break;
+          if (n >= numNeighbors) {
+            PetscInt supportSize;
+            ierr = DMPlexGetSupportSize(dm, face, &supportSize);CHKERRQ(ierr);
+            if (supportSize != 1) SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Boundary faces should see one cell, not %d", supportSize);
+            neighbors[numNeighbors++] = l;
+          }
+        }
+      }
+      ierr = PetscCalloc4(numNeighbors,&match,numNeighbors,&nranks,numRoots,&rornt,numRoots,&lornt);CHKERRQ(ierr);
+      for (face = fStart; face < fEnd; ++face) {
+        ierr = DMPlexGetSupportSize(dm, face, &supportSize);CHKERRQ(ierr);
+        if (supportSize != 1) continue;
+        ierr = DMPlexGetSupport(dm, face, &support);CHKERRQ(ierr);
+
+        ierr = DMPlexGetCone(dm, support[0], &cone);CHKERRQ(ierr);
+        ierr = DMPlexGetConeSize(dm, support[0], &coneSize);CHKERRQ(ierr);
+        ierr = DMPlexGetConeOrientation(dm, support[0], &ornt);CHKERRQ(ierr);
+        for (c = 0; c < coneSize; ++c) if (cone[c] == face) break;
+        if (dim == 1) {
+          /* Use cone position instead, shifted to -1 or 1 */
+          rornt[face] = c*2-1;
+        } else {
+          if (PetscBTLookup(flippedCells, support[0]-cStart)) rornt[face] = ornt[c] < 0 ? -1 :  1;
+          else                                                rornt[face] = ornt[c] < 0 ?  1 : -1;
+        }
+      }
+      /* Mark each edge with match or nomatch */
+      ierr = PetscSFBcastBegin(sf, MPI_INT, rornt, lornt);CHKERRQ(ierr);
+      ierr = PetscSFBcastEnd(sf, MPI_INT, rornt, lornt);CHKERRQ(ierr);
+      for (n = 0; n < numNeighbors; ++n) {
+        const PetscInt face = lpoints[neighbors[n]];
+
+        if (rornt[face]*lornt[face] < 0) match[n] = PETSC_TRUE;
+        else                             match[n] = PETSC_FALSE;
+        nranks[n] = rpoints[neighbors[n]].rank;
+      }
+      /* Collect the graph on 0 */
+      {
+        MPI_Comm     comm = PetscObjectComm((PetscObject) sf);
+        PetscBT      seenProcs, flippedProcs;
+        PetscInt    *procFIFO, pTop, pBottom;
+        PetscInt    *adj = NULL;
+        PetscBool   *val = NULL;
+        PetscMPIInt *recvcounts = NULL, *displs = NULL, p;
+        PetscMPIInt  N = numNeighbors, numProcs = 0, rank;
+        PetscInt     debug = 0;
+
+        ierr = MPI_Comm_rank(comm, &rank);CHKERRQ(ierr);
+        if (!rank) {ierr = MPI_Comm_size(comm, &numProcs);CHKERRQ(ierr);}
+        ierr = PetscCalloc2(numProcs,&recvcounts,numProcs+1,&displs);CHKERRQ(ierr);
+        ierr = MPI_Gather(&N, 1, MPI_INT, recvcounts, 1, MPI_INT, 0, comm);CHKERRQ(ierr);
+        for (p = 0; p < numProcs; ++p) {
+          displs[p+1] = displs[p] + recvcounts[p];
+        }
+        if (!rank) {ierr = PetscMalloc2(displs[numProcs],&adj,displs[numProcs],&val);CHKERRQ(ierr);}
+        ierr = MPI_Gatherv(nranks, numNeighbors, MPIU_INT, adj, recvcounts, displs, MPIU_INT, 0, comm);CHKERRQ(ierr);
+        ierr = MPI_Gatherv(match, numNeighbors, MPIU_BOOL, val, recvcounts, displs, MPIU_BOOL, 0, comm);CHKERRQ(ierr);
+        if (debug) {
+          for (p = 0; p < numProcs; ++p) {
+            ierr = PetscPrintf(comm, "Proc %d:\n", p);
+            for (n = 0; n < recvcounts[p]; ++n) {
+              ierr = PetscPrintf(comm, "  edge %d (%d):\n", adj[displs[p]+n], val[displs[p]+n]);
+            }
+          }
+        }
+        ierr = PetscBTCreate(numProcs, &seenProcs);CHKERRQ(ierr);
+        ierr = PetscBTMemzero(numProcs, seenProcs);CHKERRQ(ierr);
+        ierr = PetscBTCreate(numProcs, &flippedProcs);CHKERRQ(ierr);
+        ierr = PetscBTMemzero(numProcs, flippedProcs);CHKERRQ(ierr);
+        ierr = PetscMalloc1(numProcs,&procFIFO);CHKERRQ(ierr);
+        pTop = pBottom = 0;
+        for (p = 0; p < numProcs; ++p) {
+          if (PetscBTLookup(seenProcs, p)) continue;
+          /* Initialize FIFO with next proc */
+          procFIFO[pBottom++] = p;
+          ierr = PetscBTSet(seenProcs, p);CHKERRQ(ierr);
+          /* Consider each proc in FIFO */
+          while (pTop < pBottom) {
+            PetscInt proc, nproc, seen, flippedA, flippedB, mismatch;
+
+            proc     = procFIFO[pTop++];
+            flippedA = PetscBTLookup(flippedProcs, proc) ? 1 : 0;
+            /* Loop over neighboring procs */
+            for (n = 0; n < recvcounts[proc]; ++n) {
+              nproc    = adj[displs[proc]+n];
+              mismatch = val[displs[proc]+n] ? 0 : 1;
+              seen     = PetscBTLookup(seenProcs, nproc);
+              flippedB = PetscBTLookup(flippedProcs, nproc) ? 1 : 0;
+
+              if (mismatch ^ (flippedA ^ flippedB)) {
+                if (seen) SETERRQ2(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Previously seen procs %d and %d do not match: Fault mesh is non-orientable", proc, nproc);
+                if (!flippedB) {
+                  ierr = PetscBTSet(flippedProcs, nproc);CHKERRQ(ierr);
+              } else SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Inconsistent mesh orientation: Fault mesh is non-orientable");
+              } else if (mismatch && flippedA && flippedB) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Attempt to flip already flipped cell: Fault mesh is non-orientable");
+              if (!seen) {
+                procFIFO[pBottom++] = nproc;
+                ierr = PetscBTSet(seenProcs, nproc);CHKERRQ(ierr);
+              }
+            }
+          }
+        }
+        ierr = PetscFree(procFIFO);CHKERRQ(ierr);
 
+        ierr = PetscFree2(recvcounts,displs);CHKERRQ(ierr);
+        ierr = PetscFree2(adj,val);CHKERRQ(ierr);
+        {
+          PetscBool *flips;
+
+          ierr = PetscMalloc1(numProcs,&flips);CHKERRQ(ierr);
+          for (p = 0; p < numProcs; ++p) {
+            flips[p] = PetscBTLookup(flippedProcs, p) ? PETSC_TRUE : PETSC_FALSE;
+            if (debug && flips[p]) {ierr = PetscPrintf(comm, "Flipping Proc %d:\n", p);}
+          }
+          ierr = MPI_Scatter(flips, 1, MPIU_BOOL, &flipped, 1, MPIU_BOOL, 0, comm);CHKERRQ(ierr);
+          ierr = PetscFree(flips);CHKERRQ(ierr);
+        }
+        ierr = PetscBTDestroy(&seenProcs);CHKERRQ(ierr);
+        ierr = PetscBTDestroy(&flippedProcs);CHKERRQ(ierr);
+      }
+      ierr = PetscFree4(match,nranks,rornt,lornt);CHKERRQ(ierr);
+      ierr = PetscFree(neighbors);CHKERRQ(ierr);
+      if (flipped) {for (c = cStart; c < cEnd; ++c) {ierr = PetscBTNegate(flippedCells, c-cStart);CHKERRQ(ierr);}}
+    }
+  }
+  /* Reverse flipped cells in the mesh */
   ierr = DMPlexGetMaxSizes(dm, &maxConeSize, NULL);CHKERRQ(ierr);
   ierr = DMGetWorkArray(dm, maxConeSize, PETSC_INT, &revcone);CHKERRQ(ierr);
   ierr = DMGetWorkArray(dm, maxConeSize, PETSC_INT, &revconeO);CHKERRQ(ierr);

src/dm/impls/plex/plexcgns.c

         ierr = cg_ElementDataSize(cgid, 1, z, 1, &elementDataSize);CHKERRQ(ierr);
         ierr = PetscMalloc1(elementDataSize, &elements);CHKERRQ(ierr);
         ierr = cg_elements_read(cgid, 1, z, 1, elements, NULL);CHKERRQ(ierr);
-        for (c_loc = start, off = 0; c_loc < end; ++c_loc, ++c) {
+        for (c_loc = start, off = 0; c_loc <= end; ++c_loc, ++c) {
           switch (elements[off]) {
           case TRI_3:   numCorners = 3;break;
           case QUAD_4:  numCorners = 4;break;
         case HEXA_8:  numCorners = 8;break;
         default: SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Invalid cell type %d", (int) cellType);
         }
-        for (c_loc = start; c_loc < end; ++c_loc, ++c) {
+        for (c_loc = start; c_loc <= end; ++c_loc, ++c) {
           ierr = DMPlexSetConeSize(*dm, c, numCorners);CHKERRQ(ierr);
         }
       }
       ierr = cg_elements_read(cgid, 1, z, 1, elements, NULL);CHKERRQ(ierr);
       if (cellType == MIXED) {
         /* CGNS uses Fortran-based indexing, sieve uses C-style and numbers cell first then vertices. */
-        for (c_loc = 0, v = 0; c_loc < numc; ++c_loc, ++c) {
+        for (c_loc = 0, v = 0; c_loc <= numc; ++c_loc, ++c) {
           switch (elements[v]) {
           case TRI_3:   numCorners = 3;break;
           case QUAD_4:  numCorners = 4;break;
             cone[v_loc] = elements[v]+numCells-1;
           }
           /* Tetrahedra are inverted */
-          if (cellType == TETRA_4) {
+          if (elements[v] == TETRA_4) {
             PetscInt tmp = cone[0];
             cone[0] = cone[1];
             cone[1] = tmp;
           }
           /* Hexahedra are inverted */
-          if (cellType == HEXA_8) {
+          if (elements[v] == HEXA_8) {
             PetscInt tmp = cone[1];
             cone[1] = cone[3];
             cone[3] = tmp;
         }
 
         /* CGNS uses Fortran-based indexing, sieve uses C-style and numbers cell first then vertices. */
-        for (c_loc = 0, v = 0; c_loc < numc; ++c_loc, ++c) {
+        for (c_loc = 0, v = 0; c_loc <= numc; ++c_loc, ++c) {
           for (v_loc = 0; v_loc < numCorners; ++v_loc, ++v) {
             cone[v_loc] = elements[v]+numCells-1;
           }
   if (!rank) {
     PetscInt off = 0;
     float   *x[3];
-    int      z, c, d;
+    int      z, d;
 
     ierr = PetscMalloc3(numVertices,&x[0],numVertices,&x[1],numVertices,&x[2]);CHKERRQ(ierr);
-    for (z = 1, c = 0; z <= nzones; ++z) {
+    for (z = 1; z <= nzones; ++z) {
       DataType_t datatype;
       cgsize_t   sizes[3]; /* Number of vertices, number of cells, number of boundary vertices */
       cgsize_t   range_min[3] = {1, 1, 1};
       ierr = cg_ncoords(cgid, 1, z, &ncoords);CHKERRQ(ierr);
       if (ncoords != dim) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"CGNS file must have a coordinate array for each dimension, not %d\n",ncoords);
       for (d = 0; d < dim; ++d) {
-        ierr = cg_coord_info(cgid, 1, z, 1, &datatype, buffer);CHKERRQ(ierr);
+        ierr = cg_coord_info(cgid, 1, z, 1+d, &datatype, buffer);CHKERRQ(ierr);
         ierr = cg_coord_read(cgid, 1, z, buffer, RealSingle, range_min, range_max, x[d]);CHKERRQ(ierr);
       }
       if (dim > 0) {

src/docs/website/documentation/changes/dev.html

         <li>The <tt>MatStructure</tt> argument to the user functions provided with <tt>SNESSetJacobian()</tt> and  <tt>SNESSetPicard()</tt> are gone.</li>
         <li><tt>SNESSetInitialFunctionNorm()</tt> is removed as it's not necessary given that the norm is cached on the Vec.  Use only <tt>SNESSetInitialFunction()</tt>.</li>
         <li><tt>SNESSkipConverged()</tt> renamed to <tt>SNESConvergedSkip()</tt>.</li>
+        <li><tt>GS</tt> and _gs used for nonlinear Gauss-Sidel changed to <tt>NGS</tt> and _ngs to match all the other nonlinear solver names.</li>
       </ul>
       <h4>SNESLineSearch:</h4>
       <h4>TS:</h4>

src/docs/website/documentation/faq.html

-www.m<!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">
+<!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">
 <html>
   <head>
     <meta http-equiv="content-type" content="text/html;charset=utf-8">
 
       <h3><a name="gpus">Can PETSc use GPUs to speedup computations?</a></h3>
 
-      PETSc-dev has some support for running portions of the computation on
-      Nvidia GPUs. See <a href="http://www.mcs.anl.gov/petsc/features/gpus.html">PETSc GPUs</a> for
-      more information. PETSc has a Vec class VECCUSP that performs almost all
-      the vector operations on the GPU. The Mat class MATCUSP performs
-      matrix-vector products on the GPU but does not have matrix assembly on the
+      The <a href="https://bitbucket.org/petsc/petsc">PETSc developer repository</a> has some support for running portions of the computation on
+      GPUs. See <a href="http://www.mcs.anl.gov/petsc/features/gpus.html">PETSc GPUs</a> for
+      more information. PETSc has Vec classes VECCUSP and VECVIENNACL which perform almost all
+      the vector operations on the GPU. The Mat classes AIJCUSP and AIJVIENNACL perform
+      matrix-vector products on the GPU but do not have matrix assembly on the
       GPU yet. Both of these classes run in parallel with MPI. All KSP methods,
       except KSPIBCGS, run all their vector operations on the GPU thus, for
       example Jacobi preconditioned Krylov methods run completely on the GPU.

src/docs/website/documentation/index.html

             <li><a href="faq.html">FAQ</a></li>
             <li><a href="copyright.html">License</a></li>
             <li><a href="linearsolvertable.html">Linear Solver Table</a></li>
+            <li><a href="nonlinearsolvertable.html">Nonlinear Solver Table</a></li>
           </ul>
         </li>
         <li><a href="../publications/index.html">Applications/Publications</a></li>
         <li>
           <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/index.html">Nonlinear Solvers (SNES)</a>
           <ul>
+            <li><a href="nonlinearsolvertable.html">Summary table of all nonlinear solvers</a></li>
             <li><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/MatCreateSNESMF.html">Matrix-free nonlinear solvers (MATMFFD)</a></li>
           </ul>
 

src/docs/website/documentation/installation.html

             Thrust has been included in CUDA since the 4.0 release - so a separate install is not needed.
           </li>
 
-          <li>Currently using CUDA-4.1 or CUDA-4.2 with Cusp-v0.3.1</li>
+          <li>Currently using CUDA-4.1 or CUDA-4.2 with Cusp-v0.3.1 or CUDA-5 with Cusp-v0.4.0.</li>
 
           <li>
             On Linux - make sure you have  compatible <a href="http://developer.nvidia.com/cuda-downloads"> NVidia driver</a>
 
       <hr>
 
+      <div>
+        <h3><a name="cuda">Installing PETSc to use GPUs and accelerators via OpenCL (NVIDIA, AMD, Intel MIC)</a></h3>
+
+        <ul>
+          <li>
+            Requires <a href="http://viennacl.sourceforge.net/">ViennaCL</a> and the OpenCL shared library, which is shipped in the vendor graphics driver.
+            Make sure the OpenCL headers are available on your system by e.g. downloading them from the <a href="https://www.khronos.org/opencl/">Khronos Group</a> directly.
+            Package managers on Linux provide these headers through a package named 'opencl-headers' or similar.
+          </li>
+
+          <li>
+            Always make sure you have the latest GPU driver installed. There are several known issues with older driver versions.
+          </li>
+
+          <li>check <code>config/examples/arch-viennacl.py</code> for example usage.</li>
+        </ul>
+
+        <p>
+          OpenCL/ViennaCL builds of PETSc currently work on Apple OSX, Linux, and Microsoft Windows. OpenCL is less a burden on the build system than CUDA, so installation is often easier and works with any host compiler.
+        </p>
+
+        <a href="#" target="_top">Return to Installation Instructions</a>
+      </div> <!-- #opencl -->
+
+      <hr>
+
       <div id="threads">
         <h3><a name="threads">Installing PETSc to use Threads</a></h3>
 	<p>

src/docs/website/documentation/linearsolvertable.html

           <tr>
             <td></td>
             <td></td>
-            <td><a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM.html">geometric (DMDA for structured grid)</a></td>
+            <td><a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/PC/PCMG.html">geometric (DMDA for structured grid)</a></td>
             <td></td>
             <td></td>
             <td>X</td>

src/docs/website/documentation/nonlinearsolvertable.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html;charset=utf-8">
+    <link href="../style.css" rel="stylesheet" type="text/css">
+    <title>PETSc: Summary of Nonlinear Solvers Available from PETSc</title>
+  </head>
+  <body>
+
+    <div id="logo">
+      <h1>PETSc</h1>
+    </div>
+
+    <div id="header">
+      <h1><!--begin-->Summary of Nonlinear Solvers Available from PETSc<!--end--></h1>
+    </div>
+
+    <hr>
+
+    <div id="sidebar">
+      <ul>
+        <li><a href="../index.html">Home</a></li>
+        <li><a href="../download/index.html">Download</a></li>
+        <li><a href="../features/index.html">Features</a></li>
+        <li>
+          <a href="../documentation/index.html">Documentation</a>
+          <ul>
+            <li><a href="index.html">Manual pages and Users Manual</a></li>
+            <li><a href="referencing.html">Citing PETSc</a></li>
+            <li><a href="tutorials/index.html">Tutorials</a></li>
+            <li><a href="installation.html">Installation</a></li>
+            <li><a href="SAWs.html">SAWs</a></li>
+            <li><a href="changes/index.html">Changes</a></li>
+            <li><a href="bugreporting.html">Bug Reporting</a></li>
+            <li><a href="codemanagement.html">Code Management</a></li>
+            <li><a href="faq.html">FAQ</a></li>
+            <li><a href="copyright.html">License</a></li>
+            <li><span class="current">Linear Solver Table</span></li>
+          </ul>
+        </li>
+        <li><a href="../publications/index.html">Applications/Publications</a></li>
+        <li><a href="../miscellaneous/index.html">Miscellaneous</a></li>
+        <li><a href="../miscellaneous/external.html">External Software</a></li>
+        <li><a href="../developers/index.html">Developers Site</a></li>
+      </ul>
+    </div>
+
+    <!--begin-->
+
+    <!--This controls the style for the 6th and 7th column-->
+    <style type="text/css">
+      tr > td:nth-child(6), tr > td:nth-child(7) {
+        text-align: center;
+      }
+    </style>
+
+    <div align="center" id="main" >
+
+      <h2>Summary of Nonlinear Solvers Available from PETSc</h2>
+<h3>See the paper <a href="http://www.mcs.anl.gov/papers/P2010-0112.pdf">Composing Scalable Nonlinear Algebraic Solvers</a> or the PETSc users manual for details on the algorithms</h3>
+      <h3>Requests and contributions welcome</h3>
+
+      <table border="1" summary="Summary of Nonlinear Solvers Available from PETSc">
+
+        <thead>
+          <tr>
+            <th>Algorithm</th>
+            <th><a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESType.html">Name of solver</a></th>
+          </tr>
+            <th></th>
+        </thead>
+
+        <!-- The tfoot *must* be before tbody!!!! -->
+        <tfoot>
+          <tr>
+            <td colspan="7">
+
+              <p>
+                <a name="nolinesearch">*</a> Does not support a line search</a>
+              </p>
+
+            </td>
+          </tr>
+        </tfoot>
+
+        <tbody>
+          <tr>
+            <td>Newton's method</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESNEWTONLS.html">newtonls</a>
+            </td>
+            <th>Use -snes_mf for matrix-free linear solvers</th>
+          </tr>
+
+          <tr>
+            <td>Newton's method with trust region<a href="#nolinesearch">*</a></td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESNEWTONTR.html">newtontr</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Single linearization<a href="#nolinesearch">*</a></td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESKSPONLY.html">ksponly</a>
+            </td>
+            <th>Essentially one step of Newtwon without a line search</th>
+          </tr>
+
+          <tr>
+            <td>Quasi-Newton method (BFGS)</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESNEWTONQN.html">qn</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Nonlinear CG</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESNCG.html">ncg</a>
+            </td>
+            <th>Requires nearly symmetric Jacobian for good convergence</th>
+          </tr>
+
+          <tr>
+            <td>Nonlinear GMRES</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESNGMRES.html">ngmres</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Anderson mixing</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESANDERSON.html">anderson</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Nonlinear Richardson</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESNRICHARDSON.html">nrichardson</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Nonlinear Gauss-Siedel<a href="#nolinesearch">*</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESNGS.html">ngs</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Full Approximation Scheme (nonlinear multigrid)</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESFAS.html">fas</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Nonlinear additive Schwarz method<a href="#nolinesearch">*</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESNASM.html">nasm</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Nonlinear additive Schwarz preconditioned inexact Newton (ASPIN) methods</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESASPIN.html">aspin</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Composite; combine several nonlinear solvers</td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESCOMPOSITE.html">composite</a>
+            </td>
+            <th></th>
+          </tr>
+
+          <tr>
+            <td>Preconditioned nonlinear solver/td>
+            <td>
+              <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/SNES/SNESGetPC.html">SNESGetPC()</a>
+            </td>
+            <th>Can be combined to accelerate many of the solvers</th>
+          </tr>
+
+        </tbody>
+      </table>
+
+
+    </div>
+
+    <!--end-->
+  </body>
+</html>

src/docs/website/features/details.html

             <li><span class="current">Component Details</span></li>
             <li><a href="diagram.html">Diagram</a></li>
             <li><a href="gpus.html">GPUs</a></li>
-            <li><a href="threads.html">Theads</a></li>
+            <li><a href="threads.html">Threads</a></li>
           </ul>
         </li>
         <li><a href="../documentation/index.html">Documentation</a></li>

src/docs/website/features/diagram.html

             <li><a href="details.html">Component Details</a></li>
             <li><span class="current">Diagram</span></li>
             <li><a href="gpus.html">GPUs</a></li>
-            <li><a href="threads.html">Theads</a></li>
+            <li><a href="threads.html">Threads</a></li>
           </ul>
         </li>
         <li><a href="../documentation/index.html">Documentation</a></li>

src/docs/website/features/gpus.html

   <head>
     <meta http-equiv="content-type" content="text/html;charset=utf-8">
     <link href="../style.css" rel="stylesheet" type="text/css">
-    <title>PETSc: Features: Nvidia GPU support</title>
+    <title>PETSc: Features: GPU support</title>
   </head>
   <body>
 
     </div>
 
     <div id="header">
-      <h1>Features: Nvidia GPU support</h1>
+      <h1>Features: GPU support</h1>
     </div>
 
     <hr>
             <li><a href="details.html">Component Details</a></li>
             <li><a href="diagram.html">Diagram</a></li>
             <li><span class="current">GPUs</span></li>
-            <li><a href="threads.html">Theads</a></li>
+            <li><a href="threads.html">Threads</a></li>
           </ul>
         </li>
         <li><a href="../documentation/index.html">Documentation</a></li>
     <div id="main">
 
       <p>
-        PETSc algebraic solvers now run on Nvidia GPU systems. This sometimes provides an
+        PETSc algebraic solvers now run on GPU systems from NVIDIA and AMD. This sometimes provides an
         alternative high-performance, low-cost solution technique.
       </p>
 
       </span>
 
       <ul>
-        <li><a href="http://www.mcs.anl.gov/petsc/documentation/installation.html#CUDA">Installing PETSc to use the Nvidia GPUs</a></li>
+        <li><a href="http://www.mcs.anl.gov/petsc/documentation/installation.html#CUDA">Installing PETSc to use NVIDIA GPUs (CUDA)</a></li>
+        <li><a href="http://www.mcs.anl.gov/petsc/documentation/installation.html#OpenCL">Installing PETSc to use GPUs independent of the vendor (OpenCL)</a></li>
         <li><a href="gpus.pdf">How the GPU solvers are implemented in PETSc</a></li>
         <li><a href="http://www.mcs.anl.gov/petsc/petsc-dev/src/snes/examples/tutorials/ex47cu.cu.html">Example that uses CUSP directly in the user function evaluation</a></li>
         <li><a href="http://vimeo.com/18768859">Presentation on some aspects of GPU usage from PETSc</a></li>
 
         <li>
-          Quick summary of usage:
+          Quick summary of usage with CUDA (provided by the <a href="http://cusplibrary.github.io/" title="CUSP library">CUSP library</a>):
           <ul>
             <li>
               The VecType <code>VECSEQCUSP</code>, <code>VECMPICUSP</code>, or
               If you are creating the vectors and matrices with a
               DM, you can use -dm_vec_type cusp and -dm_mat_type aijcusp
             </li>
+          </ul>
+        </li>
+
+        <li>
+          Quick summary of usage with OpenCL (provided by the <a href="http://viennacl.sourceforge.net/" title="ViennaCL">ViennaCL library</a>):
+          <ul>
+            <li>
+              The VecType <code>VECSEQVIENNACL</code>, <code>VECMPIVIENNACL</code>, or
+              <code>VECVIENNACL</code> may be used with <code>VecSetType()</code> or
+              -vec_type seqviennacl,mpiviennacl, or viennacl when <code>VecSetFromOptions()</code> is used.
+            </li>
 
             <li>
+              The MatType <code>MATSEQAIJVIENNACL</code>, <code>MATMPIAIJVIENNACL</code>, or
+              <code>MATAIJVIENNACL</code> maybe used with MatSetType or -mat_type
+              seqaijviennacl,mpiaijviennacl, or aijviennacl when <code>MatSetOptions()</code>
+              is used.
+            </li>
+
+            <li>
+              If you are creating the vectors and matrices with a
+              DM, you can use -dm_vec_type viennacl and -dm_mat_type aijviennacl
+            </li>
+          </ul>
+        </li>
+
+        <li>
+          General hints:
+          <ul>
+            <li>
               It is useful to develop your code with the default
               vectors and then run production runs with the command
               line options to use the GPU since debugging on GPUs is difficult.

src/docs/website/index.html

         structures and routines for the scalable (parallel) solution of
         scientific applications modeled by partial differential equations. It
         supports MPI, <a href="features/threads.html">shared memory pthreads</a>,
-        and <a href="features/gpus.html">NVIDIA GPUs</a>, as well as hybrid
+        and <a href="features/gpus.html">GPUs through CUDA or OpenCL</a>, as well as hybrid
         MPI-shared memory pthreads or MPI-GPU parallelism.
       </p>
 

src/docs/website/miscellaneous/external.html

 
         <li>BLAS and LAPACK</li>
 
+
+        <li><a href="http://cusplibrary.github.io/"> CUSP</a> - a C++ templated sparse matrix library for CUDA GPUs.</li>
+
         <li><a href="http://www.cs.sandia.gov/CRF/chac.html"> Chaco</a> - a graph partitioning package.</li>
 
         <li>ESSL - IBM's math library for fast sparse direct LU factorization.</li>
           - sparse direct solvers, developed by Timothy A. Davis.
         </li>
 
+        <li>
+          <a href="http://viennacl.sourceforge.net/">ViennaCL</a>
+          - Linear algebra library providing matrix and vector operations using OpenMP, CUDA, and OpenCL.
+        </li>
+
       </ul>
 
       <p> PETSc contains modifications of routines from</p>

src/mat/color/impls/jp/jp.c

   const PetscInt *degrees;
   PetscReal      *ewts,*wtsrow=jp->wtsrow,*wtscol=jp->wtscol;
   PetscSF        etoc=jp->etoc,etor=jp->etor;
+  MPI_Datatype   rtype;
   PetscErrorCode ierr;
 
   PetscFunctionBegin;
+  ierr = PetscDataTypeToMPIDataType(PETSC_REAL,&rtype);CHKERRQ(ierr);
   nentries=0;
   ierr = PetscSFGetGraph(etor,&nrows,&nleafrows,NULL,NULL);CHKERRQ(ierr);
   ierr = PetscSFGetGraph(etoc,&ncols,&nleafcols,NULL,NULL);CHKERRQ(ierr);
 
       if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
       ierr = PetscLogEventBegin(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
-      ierr = PetscSFReduceBegin(etoc,MPI_DOUBLE,ewts,wtscol,MPI_MAX);CHKERRQ(ierr);
-      ierr = PetscSFReduceEnd(etoc,MPI_DOUBLE,ewts,wtscol,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceBegin(etoc,rtype,ewts,wtscol,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceEnd(etoc,rtype,ewts,wtscol,MPI_MAX);CHKERRQ(ierr);
       ierr = PetscLogEventEnd(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
     } else {
       /* first step takes the column weights to the row weights */
       }
       if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
       ierr = PetscLogEventBegin(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
-      ierr = PetscSFReduceBegin(etor,MPI_DOUBLE,ewts,wtsrow,MPI_MAX);CHKERRQ(ierr);
-      ierr = PetscSFReduceEnd(etor,MPI_DOUBLE,ewts,wtsrow,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceBegin(etor,rtype,ewts,wtsrow,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceEnd(etor,rtype,ewts,wtsrow,MPI_MAX);CHKERRQ(ierr);
       ierr = PetscLogEventEnd(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
     }
   }
   PetscInt       *estate,*mask,mskvalue,*staterow,*statecol;
   PetscSF        etoc=jp->etoc,etor=jp->etor;
   ISColoringValue curmin;
+  MPI_Datatype   itype;
   PetscErrorCode ierr;
   PetscBool      minfound;
 
   PetscFunctionBegin;
+  ierr = PetscDataTypeToMPIDataType(PETSC_INT,&itype);CHKERRQ(ierr);
   ierr = PetscSFGetGraph(etoc,&ncols,&nleafcols,NULL,NULL);CHKERRQ(ierr);
   ierr = PetscSFGetGraph(etor,&nrows,&nleafrows,NULL,NULL);CHKERRQ(ierr);
   /* reallocate so that we can create new size bitmasks */
         }
         if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
         ierr = PetscLogEventBegin(Mat_Coloring_Comm,etoc,0,0,0);CHKERRQ(ierr);
-        ierr = PetscSFReduceBegin(etoc,MPIU_INT,estate,&statecol[i*ncols],MPI_BOR);CHKERRQ(ierr);
-        ierr = PetscSFReduceEnd(etoc,MPIU_INT,estate,&statecol[i*ncols],MPI_BOR);CHKERRQ(ierr);
+        ierr = PetscSFReduceBegin(etoc,itype,estate,&statecol[i*ncols],MPI_BOR);CHKERRQ(ierr);
+        ierr = PetscSFReduceEnd(etoc,itype,estate,&statecol[i*ncols],MPI_BOR);CHKERRQ(ierr);
         ierr = PetscLogEventEnd(Mat_Coloring_Comm,etoc,0,0,0);CHKERRQ(ierr);
       }
     } else {
         }
         if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
         ierr = PetscLogEventBegin(Mat_Coloring_Comm,etoc,0,0,0);CHKERRQ(ierr);
-        ierr = PetscSFReduceBegin(etor,MPIU_INT,estate,&staterow[i*ncols],MPI_BOR);CHKERRQ(ierr);
-        ierr = PetscSFReduceEnd(etor,MPIU_INT,estate,&staterow[i*ncols],MPI_BOR);CHKERRQ(ierr);
+        ierr = PetscSFReduceBegin(etor,itype,estate,&staterow[i*ncols],MPI_BOR);CHKERRQ(ierr);
+        ierr = PetscSFReduceEnd(etor,itype,estate,&staterow[i*ncols],MPI_BOR);CHKERRQ(ierr);
         ierr = PetscLogEventEnd(Mat_Coloring_Comm,etoc,0,0,0);CHKERRQ(ierr);
       }
     }

src/mat/color/impls/mis/miscoloring.c

   PetscReal      *ewts,*wtsrow=mis->wtsrow,*wtscol=mis->wtscol;
   PetscSF        etoc=mis->etoc,etor=mis->etor;
   PetscErrorCode ierr;
+  MPI_Datatype   rtype;
 
   PetscFunctionBegin;
   nentries=0;
   ierr = PetscSFGetGraph(etor,&nrows,NULL,NULL,NULL);CHKERRQ(ierr);
   ierr = PetscSFGetGraph(etoc,&ncols,NULL,NULL,NULL);CHKERRQ(ierr);
+  ierr = PetscDataTypeToMPIDataType(PETSC_REAL,&rtype);CHKERRQ(ierr);
   for (i=0;i<ncols;i++) {
     wtscol[i] = wtsin[i];
   }
       }
       if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
       ierr = PetscLogEventBegin(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
-      ierr = PetscSFReduceBegin(etoc,MPI_DOUBLE,ewts,wtscol,MPI_MAX);CHKERRQ(ierr);
-      ierr = PetscSFReduceEnd(etoc,MPI_DOUBLE,ewts,wtscol,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceBegin(etoc,rtype,ewts,wtscol,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceEnd(etoc,rtype,ewts,wtscol,MPI_MAX);CHKERRQ(ierr);
       ierr = PetscLogEventEnd(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
     } else {
       /* first step takes the column weights to the row weights */
       }
       if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
       ierr = PetscLogEventBegin(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
-      ierr = PetscSFReduceBegin(etor,MPI_DOUBLE,ewts,wtsrow,MPI_MAX);CHKERRQ(ierr);
-      ierr = PetscSFReduceEnd(etor,MPI_DOUBLE,ewts,wtsrow,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceBegin(etor,rtype,ewts,wtsrow,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceEnd(etor,rtype,ewts,wtsrow,MPI_MAX);CHKERRQ(ierr);
       ierr = PetscLogEventEnd(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
     }
   }
   PetscInt       *estate;
   PetscInt       *staterow=mis->staterow,*statecol=mis->statecol;
   PetscSF        etoc=mis->etoc,etor=mis->etor;
+  MPI_Datatype   itype;
   PetscErrorCode ierr;
 
   PetscFunctionBegin;
+  ierr = PetscDataTypeToMPIDataType(PETSC_INT,&itype);CHKERRQ(ierr);
   ierr = PetscSFGetGraph(etoc,&ncols,NULL,NULL,NULL);CHKERRQ(ierr);
   ierr = PetscSFGetGraph(etor,&nrows,NULL,NULL,NULL);CHKERRQ(ierr);
   for (i=0;i<ncols;i++) {
       }
       if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
       ierr = PetscLogEventBegin(Mat_Coloring_Comm,etoc,0,0,0);CHKERRQ(ierr);
-      ierr = PetscSFReduceBegin(etoc,MPIU_INT,estate,statecol,MPIU_MAX);CHKERRQ(ierr);
-      ierr = PetscSFReduceEnd(etoc,MPIU_INT,estate,statecol,MPIU_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceBegin(etoc,itype,estate,statecol,MPIU_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceEnd(etoc,itype,estate,statecol,MPIU_MAX);CHKERRQ(ierr);
       ierr = PetscLogEventEnd(Mat_Coloring_Comm,etoc,0,0,0);CHKERRQ(ierr);
     } else {
       ierr = PetscLogEventBegin(Mat_Coloring_Comm,etoc,0,0,0);CHKERRQ(ierr);
       }
       if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
       ierr = PetscLogEventBegin(Mat_Coloring_Comm,etor,0,0,0);CHKERRQ(ierr);
-      ierr = PetscSFReduceBegin(etor,MPIU_INT,estate,staterow,MPI_MAX);CHKERRQ(ierr);
-      ierr = PetscSFReduceEnd(etor,MPIU_INT,estate,staterow,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceBegin(etor,itype,estate,staterow,MPI_MAX);CHKERRQ(ierr);
+      ierr = PetscSFReduceEnd(etor,itype,estate,staterow,MPI_MAX);CHKERRQ(ierr);
       ierr = PetscLogEventEnd(Mat_Coloring_Comm,etor,0,0,0);CHKERRQ(ierr);
     }
   }

src/mat/color/utils/valid.c

   PetscInt       dist=mc->dist;
   const PetscInt *degrees;
   PetscInt       *stateleafrow,*stateleafcol,nleafrows,nleafcols,idx,nentries;
+  MPI_Datatype   itype;
 
   PetscFunctionBegin;
+  ierr = PetscDataTypeToMPIDataType(PETSC_INT,&itype);CHKERRQ(ierr);
   /* get the communication structures and the colors */
   ierr = MatColoringCreateBipartiteGraph(mc,&etoc,&etor);CHKERRQ(ierr);
   ierr = ISColoringGetIS(coloring,&ncolors,&colors);CHKERRQ(ierr);
         }
         if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
         ierr = PetscLogEventBegin(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
-        ierr = PetscSFReduceBegin(etoc,MPIU_INT,stateleafrow,statecol,MPI_MAX);CHKERRQ(ierr);
-        ierr = PetscSFReduceEnd(etoc,MPIU_INT,stateleafrow,statecol,MPI_MAX);CHKERRQ(ierr);
+        ierr = PetscSFReduceBegin(etoc,itype,stateleafrow,statecol,MPI_MAX);CHKERRQ(ierr);
+        ierr = PetscSFReduceEnd(etoc,itype,stateleafrow,statecol,MPI_MAX);CHKERRQ(ierr);
         ierr = PetscLogEventEnd(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
         statespread = statecol;
       } else {
         }
         if (idx != nentries) SETERRQ2(PetscObjectComm((PetscObject)mc),PETSC_ERR_NOT_CONVERGED,"Bad number of entries %d vs %d",idx,nentries);
         ierr = PetscLogEventBegin(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
-        ierr = PetscSFReduceBegin(etor,MPIU_INT,stateleafcol,staterow,MPI_MAX);CHKERRQ(ierr);
-        ierr = PetscSFReduceEnd(etor,MPIU_INT,stateleafcol,staterow,MPI_MAX);CHKERRQ(ierr);
+        ierr = PetscSFReduceBegin(etor,itype,stateleafcol,staterow,MPI_MAX);CHKERRQ(ierr);
+        ierr = PetscSFReduceEnd(etor,itype,stateleafcol,staterow,MPI_MAX);CHKERRQ(ierr);
         ierr = PetscLogEventEnd(Mat_Coloring_Comm,mc,0,0,0);CHKERRQ(ierr);
         statespread = staterow;
       }

src/mat/impls/transpose/transm.c

   ierr = MatGetLocalSize(A,&m,&n);CHKERRQ(ierr);
   ierr = MatCreate(PetscObjectComm((PetscObject)A),N);CHKERRQ(ierr);
   ierr = MatSetSizes(*N,n,m,PETSC_DECIDE,PETSC_DECIDE);CHKERRQ(ierr);
+  ierr = PetscLayoutSetUp((*N)->rmap);CHKERRQ(ierr);
+  ierr = PetscLayoutSetUp((*N)->cmap);CHKERRQ(ierr);
   ierr = PetscObjectChangeTypeName((PetscObject)*N,MATTRANSPOSEMAT);CHKERRQ(ierr);
 
   ierr       = PetscNewLog(*N,&Na);CHKERRQ(ierr);

src/mat/interface/matrix.c

 }
 
 #undef __FUNCT__
+#define __FUNCT__ "MatGetLayouts"
+/*@
+   MatGetLayouts - Gets the PetscLayout objects for rows and columns
+
+   Not Collective
+
+   Input Parameters:
+.  A - the matrix
+
+   Output Parameters:
++ rmap - row layout
+- cmap - column layout
+
+   Level: advanced
+
+.seealso:  MatGetVecs(), MatGetLocalToGlobalMapping()
+@*/
+PetscErrorCode  MatGetLayouts(Mat A,PetscLayout *rmap,PetscLayout *cmap)
+{
+  PetscFunctionBegin;
+  PetscValidHeaderSpecific(A,MAT_CLASSID,1);
+  PetscValidType(A,1);
+  if (rmap) PetscValidPointer(rmap,2);
+  if (cmap) PetscValidPointer(cmap,3);
+  if (rmap) *rmap = A->rmap;
+  if (cmap) *cmap = A->cmap;
+  PetscFunctionReturn(0);
+}
+
+#undef __FUNCT__
 #define __FUNCT__ "MatSetValuesLocal"
 /*@
    MatSetValuesLocal - Inserts or adds values into certain locations of a matrix,

src/snes/examples/tutorials/ex15.c

      Customize nonlinear solver; set runtime options
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
   ierr = SNESSetFromOptions(snes);CHKERRQ(ierr);
-  ierr = SNESSetGS(snes,NonlinearGS,&user);CHKERRQ(ierr);
+  ierr = SNESSetNGS(snes,NonlinearGS,&user);CHKERRQ(ierr);
   ierr = SNESGetLineSearch(snes, &linesearch);CHKERRQ(ierr);
   /* Set up the precheck context if requested */
   if (use_precheck == 1) {      /* Use the precheck routines in this file */
   hydhx  = hy/hx;
 
   tot_its = 0;
-  ierr    = SNESGSGetSweeps(snes,&sweeps);CHKERRQ(ierr);
-  ierr    = SNESGSGetTolerances(snes,&atol,&rtol,&stol,&its);CHKERRQ(ierr);
+  ierr    = SNESNGSGetSweeps(snes,&sweeps);CHKERRQ(ierr);
+  ierr    = SNESNGSGetTolerances(snes,&atol,&rtol,&stol,&its);CHKERRQ(ierr);
   ierr    = DMGetLocalVector(da,&localX);CHKERRQ(ierr);
   if (B) {
     ierr = DMGetLocalVector(da,&localB);CHKERRQ(ierr);

src/snes/examples/tutorials/ex16.c

   ierr = DMDACreate3d(PETSC_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_BOX,-21,-3,-3,PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,3,1,NULL,NULL,NULL,&da);CHKERRQ(ierr);
   ierr = SNESSetDM(snes,(DM)da);CHKERRQ(ierr);
 
-  ierr = SNESSetGS(snes,NonlinearGS,&user);CHKERRQ(ierr);
+  ierr = SNESSetNGS(snes,NonlinearGS,&user);CHKERRQ(ierr);
 
   ierr = DMDAGetInfo(da,0,&mx,&my,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,
                      PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE);CHKERRQ(ierr);
   PetscReal      fnorm0,fnorm,ynorm,xnorm;
 
   PetscFunctionBegin;
-  ierr    = SNESGSGetSweeps(snes,&sweeps);CHKERRQ(ierr);
-  ierr    = SNESGSGetTolerances(snes,&atol,&rtol,&stol,&its);CHKERRQ(ierr);
+  ierr    = SNESNGSGetSweeps(snes,&sweeps);CHKERRQ(ierr);
+  ierr    = SNESNGSGetTolerances(snes,&atol,&rtol,&stol,&its);CHKERRQ(ierr);
 
   ierr = SNESGetDM(snes,&da);CHKERRQ(ierr);
   ierr = DMGetLocalVector(da,&Xl);CHKERRQ(ierr);

src/snes/examples/tutorials/ex19.c

   */
   ierr = DMDACreate2d(PETSC_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,-4,-4,PETSC_DECIDE,PETSC_DECIDE,4,1,0,0,&da);CHKERRQ(ierr);
   ierr = SNESSetDM(snes,(DM)da);CHKERRQ(ierr);
-  ierr = SNESSetGS(snes, NonlinearGS, (void*)&user);CHKERRQ(ierr);
+  ierr = SNESSetNGS(snes, NonlinearGS, (void*)&user);CHKERRQ(ierr);
 
   ierr = DMDAGetInfo(da,0,&mx,&my,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,
                      PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE);CHKERRQ(ierr);
   prandtl = user->prandtl;
   lid     = user->lidvelocity;
   tot_its = 0;
-  ierr    = SNESGSGetTolerances(snes,&rtol,&atol,&stol,&max_its);CHKERRQ(ierr);
-  ierr    = SNESGSGetSweeps(snes,&sweeps);CHKERRQ(ierr);
+  ierr    = SNESNGSGetTolerances(snes,&rtol,&atol,&stol,&max_its);CHKERRQ(ierr);
+  ierr    = SNESNGSGetSweeps(snes,&sweeps);CHKERRQ(ierr);
   ierr    = SNESGetDM(snes,(DM*)&da);CHKERRQ(ierr);
   ierr    = DMGetLocalVector(da,&localX);CHKERRQ(ierr);
   if (B) {

src/snes/examples/tutorials/ex35.c

   ierr = PetscOptionsGetBool(NULL,"-use_ngs",&use_ngs,0);CHKERRQ(ierr);
 
   if (use_ngs) {
-    ierr = SNESGetPC(snes,&psnes);CHKERRQ(ierr);
+    ierr = SNESGetNPC(snes,&psnes);CHKERRQ(ierr);
     ierr = SNESSetType(psnes,SNESSHELL);CHKERRQ(ierr);
     ierr = SNESShellSetSolve(psnes,NonlinearGS);CHKERRQ(ierr);
   }

src/snes/examples/tutorials/ex5.c

      Create nonlinear solver context
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
   ierr = SNESCreate(PETSC_COMM_WORLD,&snes);CHKERRQ(ierr);
-  ierr = SNESSetGS(snes, NonlinearGS, NULL);CHKERRQ(ierr);
+  ierr = SNESSetNGS(snes, NonlinearGS, NULL);CHKERRQ(ierr);
 
   /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Create distributed array (DMDA) to manage parallel grid and vectors
 
   PetscFunctionBeginUser;
   tot_its = 0;
-  ierr    = SNESGSGetSweeps(snes,&sweeps);CHKERRQ(ierr);
-  ierr    = SNESGSGetTolerances(snes,&atol,&rtol,&stol,&its);CHKERRQ(ierr);
+  ierr    = SNESNGSGetSweeps(snes,&sweeps);CHKERRQ(ierr);
+  ierr    = SNESNGSGetTolerances(snes,&atol,&rtol,&stol,&its);CHKERRQ(ierr);
   ierr    = SNESGetDM(snes,&da);CHKERRQ(ierr);
   ierr    = DMGetApplicationContext(da,(void**)&user);CHKERRQ(ierr);
 

src/snes/examples/tutorials/makefile

 	   ${RM} -f ex5_5_nrichardson.tmp
 
 runex5_5_ngmres_ngs:
-	-@${CSD_BASIC_COMMAND_LINE} -snes_type ngmres -npc_snes_type gs -npc_snes_max_it 1 \
+	-@${CSD_BASIC_COMMAND_LINE} -snes_type ngmres -npc_snes_type ngs -npc_snes_max_it 1 \
            > ex5_5_ngmres_ngs.tmp 2>&1; \
 	   if (${DIFF} output/ex5_5_ngmres_ngs.out ex5_5_ngmres_ngs.tmp) then true; \
 	   else  printf "${PWD}\nPossible problem with with ex5_5_ngmres_ngs, diffs above\n=========================================\n"; fi; \
 	   ${DIFF} output/ex15_3.out ex15_3.tmp || printf "${PWD}\nPossible problem with with ex15_3, diffs above\n=========================================\n"; \
 	   ${RM} -f ex15_3.tmp
 runex15_4:
-	-@${MPIEXEC} -n 1 ./ex15 -snes_monitor_short -snes_type newtonls -npc_snes_type gs -snes_npc_side left -da_grid_x 20 -da_grid_y 20 -p 1.3 -lambda 1 -ksp_monitor_short > ex15_4.tmp 2>&1; \
+	-@${MPIEXEC} -n 1 ./ex15 -snes_monitor_short -snes_type newtonls -npc_snes_type ngs -snes_npc_side left -da_grid_x 20 -da_grid_y 20 -p 1.3 -lambda 1 -ksp_monitor_short > ex15_4.tmp 2>&1; \
 	   ${DIFF} output/ex15_4.out ex15_4.tmp || printf "${PWD}\nPossible problem with with ex15_4, diffs above\n=========================================\n"; \
         ${RM} -f ex15_4.tmp
 runex15_lag_jac:
 
 runex19_fas: #test ex19 with FAS and pointwise GS smoother
 	-@${MPIEXEC} -n 1 ./ex19 -da_refine 4 -snes_monitor_short -snes_type fas \
-        -fas_levels_snes_type gs -fas_levels_snes_gs_sweeps 3 -fas_levels_snes_gs_rtol 1e-15 -fas_levels_snes_gs_atol 0.0 -fas_levels_snes_gs_stol 0.0 \
+        -fas_levels_snes_type ngs -fas_levels_snes_ngs_sweeps 3 -fas_levels_snes_ngs_rtol 1e-15 -fas_levels_snes_ngs_atol 0.0 -fas_levels_snes_ngs_stol 0.0 \
         -grashof 4e4 -snes_fas_smoothup 6 -snes_fas_smoothdown 6 -lidvelocity 100 > ex19_fas.tmp 2>&1; \
 	   ${DIFF} output/ex19_fas.out ex19_fas.tmp || printf "${PWD}\nPossible problem with ex19_fas, diffs above\n=========================================\n"; \
            ${RM} -f ex19_fas.tmp
 
 runex19_fas_full: #test ex19 with FAS and pointwise GS smoother
 	-@${MPIEXEC} -n 1 ./ex19 -da_refine 4 -snes_monitor_short -snes_type fas -snes_fas_type full -snes_fas_full_downsweep \
-        -fas_levels_snes_type gs -fas_levels_snes_gs_sweeps 3 -fas_levels_snes_gs_rtol 1e-15 -fas_levels_snes_gs_atol 0.0 -fas_levels_snes_gs_stol 0.0 \
+        -fas_levels_snes_type ngs -fas_levels_snes_ngs_sweeps 3 -fas_levels_snes_ngs_rtol 1e-15 -fas_levels_snes_ngs_atol 0.0 -fas_levels_snes_ngs_stol 0.0 \
         -grashof 4e4 -snes_fas_smoothup 6 -snes_fas_smoothdown 6 -lidvelocity 100 > ex19_fas_full.tmp 2>&1; \
 	   ${DIFF} output/ex19_fas_full.out ex19_fas_full.tmp || printf "${PWD}\nPossible problem with ex19_fas, diffs above\n=========================================\n"; \
         #           ${RM} -f ex19_fas_full.tmp
 
 runex19_ngmres_fas: #test ex19 with NGMRES preconditioned by FAS with pointwise GS smoother
 	-@${MPIEXEC} -n 1 ./ex19 -da_refine 4 -snes_monitor_short -snes_type ngmres \
-        -npc_fas_levels_snes_type gs -npc_fas_levels_snes_gs_sweeps 3 -npc_fas_levels_snes_gs_rtol 1e-15 -npc_fas_levels_snes_gs_atol 0.0 -npc_fas_levels_snes_gs_stol 0.0 \
-        -npc_snes_type fas -npc_fas_levels_snes_type gs -npc_snes_max_it 1 -npc_snes_fas_smoothup 6 -npc_snes_fas_smoothdown 6  \
+        -npc_fas_levels_snes_type ngs -npc_fas_levels_snes_ngs_sweeps 3 -npc_fas_levels_snes_ngs_rtol 1e-15 -npc_fas_levels_snes_ngs_atol 0.0 -npc_fas_levels_snes_ngs_stol 0.0 \
+        -npc_snes_type fas -npc_fas_levels_snes_type ngs -npc_snes_max_it 1 -npc_snes_fas_smoothup 6 -npc_snes_fas_smoothdown 6  \
         -lidvelocity 100 -grashof 4e4 \
          > ex19_ngmres_fas.tmp 2>&1; \
 	   ${DIFF} output/ex19_ngmres_fas.out ex19_ngmres_fas.tmp || printf "${PWD}\nPossible problem with ex19_ngmres_fas, diffs above\n=========================================\n"; \
 
 runex19_ngmres_fas_gssecant: #test ex19 with NGMRES preconditioned by FAS with pointwise GS smoother
 	-@${MPIEXEC} -n 1 ./ex19 -da_refine 3 -snes_monitor_short -snes_type ngmres -npc_snes_type fas \
-        -npc_fas_levels_snes_type gs -npc_fas_levels_snes_max_it 6 -npc_fas_levels_snes_gs_secant -npc_fas_levels_snes_gs_max_it 1 -npc_fas_coarse_snes_max_it 1 \
+        -npc_fas_levels_snes_type ngs -npc_fas_levels_snes_max_it 6 -npc_fas_levels_snes_ngs_secant -npc_fas_levels_snes_ngs_max_it 1 -npc_fas_coarse_snes_max_it 1 \
         -lidvelocity 100 -grashof 4e4 \
          > ex19_ngmres_fas_gssecant.tmp 2>&1; \
 	   ${DIFF} output/ex19_ngmres_fas_gssecant.out ex19_ngmres_fas_gssecant.tmp || echo  ${PWD} "\nPossible problem with ex19_ngmres_fas_gssecant, diffs above \n========================================="; \
 
 runex19_composite_gs_newton: #test additive composite SNES
 	-@${MPIEXEC} -n 2 ./ex19 -da_refine 3 -grashof 4e4 -lidvelocity 100 -snes_monitor_short \
-        -snes_type composite -snes_composite_type additiveoptimal -snes_composite_sneses gs,newtonls -sub_0_snes_max_it 20 -sub_1_pc_type mg > ex19_composite_gs_newton.tmp 2>&1; \
+        -snes_type composite -snes_composite_type additiveoptimal -snes_composite_sneses ngs,newtonls -sub_0_snes_max_it 20 -sub_1_pc_type mg > ex19_composite_gs_newton.tmp 2>&1; \
 	${DIFF} output/ex19_composite_gs_newton.out ex19_composite_gs_newton.tmp || printf "${PWD}\nPossible problem with ex19_composite_gs_newton, diffs above\n=========================================\n"; \
         ${RM} -f ex19_composite_gs_newton.tmp
 

src/snes/examples/tutorials/output/ex58_1.out

     0 KSP Residual norm 2.68694 
     1 KSP Residual norm 0.000633499 
     2 KSP Residual norm 1.44908e-05 
-Nonlinear solve did not converge due to DIVERGED_LINE_SEARCH iterations 0
+  1 SNES VI Function norm 8.163372808705e-02 Active lower constraints 7053/7235 upper constraints 0/0 Percent of total 0.749601 Percent of bounded 0
+    0 KSP Residual norm 2.673 
+    1 KSP Residual norm 0.000724555 
+    2 KSP Residual norm 2.04155e-05 
+  2 SNES VI Function norm 7.069074423947e-02 Active lower constraints 6867/7053 upper constraints 0/0 Percent of total 0.729833 Percent of bounded 0
+    0 KSP Residual norm 2.6202 
+    1 KSP Residual norm 0.000660539 
+    2 KSP Residual norm 2.24854e-05 
+  3 SNES VI Function norm 6.507423547610e-02 Active lower constraints 6677/6867 upper constraints 0/0 Percent of total 0.70964 Percent of bounded 0
+    0 KSP Residual norm 2.66047 
+    1 KSP Residual norm 0.000737759 
+    2 KSP Residual norm 1.94446e-05 
+  4 SNES VI Function norm 6.003760298551e-02 Active lower constraints 6487/6677 upper constraints 0/0 Percent of total 0.689446 Percent of bounded 0
+    0 KSP Residual norm 2.57967 
+    1 KSP Residual norm 0.000687075 
+    2 KSP Residual norm 1.86555e-05 
+  5 SNES VI Function norm 5.546429354257e-02 Active lower constraints 6297/6487 upper constraints 0/0 Percent of total 0.669253 Percent of bounded 0
+    0 KSP Residual norm 2.38229 
+    1 KSP Residual norm 0.000797866 
+    2 KSP Residual norm 2.02051e-05 
+  6 SNES VI Function norm 5.127650993745e-02 Active lower constraints 6107/6297 upper constraints 0/0 Percent of total 0.649059 Percent of bounded 0
+    0 KSP Residual norm 2.13299 
+    1 KSP Residual norm 0.000868182 
+    2 KSP Residual norm 2.05078e-05 
+  7 SNES VI Function norm 4.743647017370e-02 Active lower constraints 5917/6107 upper constraints 0/0 Percent of total 0.628866 Percent of bounded 0
+    0 KSP Residual norm 1.91998 
+    1 KSP Residual norm 0.000940245 
+    2 KSP Residual norm 2.11283e-05 
+    3 KSP Residual norm 4.4243e-07 
+  8 SNES VI Function norm 4.393250901758e-02 Active lower constraints 5723/5917 upper constraints 0/0 Percent of total 0.608247 Percent of bounded 0
+    0 KSP Residual norm 1.78644 
+    1 KSP Residual norm 0.000937063 
+    2 KSP Residual norm 1.98631e-05 
+    3 KSP Residual norm 4.2512e-07 
+  9 SNES VI Function norm 4.074814326705e-02 Active lower constraints 5533/5723 upper constraints 0/0 Percent of total 0.588054 Percent of bounded 0
+    0 KSP Residual norm 1.71837 
+    1 KSP Residual norm 0.000896483 
+    2 KSP Residual norm 2.00187e-05 
+    3 KSP Residual norm 4.43605e-07 
+ 10 SNES VI Function norm 3.743247300657e-02 Active lower constraints 5343/5533 upper constraints 0/0 Percent of total 0.567861 Percent of bounded 0
+    0 KSP Residual norm 1.59926 
+    1 KSP Residual norm 0.000803251 
+    2 KSP Residual norm 1.83603e-05 
+    3 KSP Residual norm 4.14208e-07 
+ 11 SNES VI Function norm 3.486905663351e-02 Active lower constraints 5153/5343 upper constraints 0/0 Percent of total 0.547667 Percent of bounded 0
+    0 KSP Residual norm 1.44285 
+    1 KSP Residual norm 0.00065968 
+    2 KSP Residual norm 1.73149e-05 
+    3 KSP Residual norm 4.06698e-07 
+ 12 SNES VI Function norm 3.302767841299e-02 Active lower constraints 4963/5153 upper constraints 0/0 Percent of total 0.527474 Percent of bounded 0
+    0 KSP Residual norm 1.31481 
+    1 KSP Residual norm 0.000539611 
+    2 KSP Residual norm 1.4902e-05 
+    3 KSP Residual norm 3.53455e-07 
+ 13 SNES VI Function norm 3.145463312750e-02 Active lower constraints 4773/4963 upper constraints 0/0 Percent of total 0.50728 Percent of bounded 0
+    0 KSP Residual norm 1.21457 
+    1 KSP Residual norm 0.00045629 
+    2 KSP Residual norm 1.33211e-05 
+    3 KSP Residual norm 3.04759e-07 
+ 14 SNES VI Function norm 3.004175705451e-02 Active lower constraints 4583/4773 upper constraints 0/0 Percent of total 0.487087 Percent of bounded 0
+    0 KSP Residual norm 1.13291 
+    1 KSP Residual norm 0.000395063 
+    2 KSP Residual norm 1.15424e-05 
+    3 KSP Residual norm 2.60715e-07 
+ 15 SNES VI Function norm 2.876325782773e-02 Active lower constraints 4393/4583 upper constraints 0/0 Percent of total 0.466893 Percent of bounded 0
+    0 KSP Residual norm 1.06417 
+    1 KSP Residual norm 0.000364522 
+    2 KSP Residual norm 1.04747e-05 
+ 16 SNES VI Function norm 2.760470906286e-02 Active lower constraints 4203/4393 upper constraints 0/0 Percent of total 0.4467 Percent of bounded 0
+    0 KSP Residual norm 1.00549 
+    1 KSP Residual norm 0.000326304 
+    2 KSP Residual norm 9.34975e-06 
+ 17 SNES VI Function norm 2.655295309475e-02 Active lower constraints 4013/4203 upper constraints 0/0 Percent of total 0.426507 Percent of bounded 0
+    0 KSP Residual norm 0.954332 
+    1 KSP Residual norm 0.00032105 
+    2 KSP Residual norm 9.08764e-06 
+ 18 SNES VI Function norm 2.559478787209e-02 Active lower constraints 3823/4013 upper constraints 0/0 Percent of total 0.406313 Percent of bounded 0
+    0 KSP Residual norm 0.909227 
+    1 KSP Residual norm 0.000291792 
+    2 KSP Residual norm 8.23083e-06 
+ 19 SNES VI Function norm 2.471758098038e-02 Active lower constraints 3633/3823 upper constraints 0/0 Percent of total 0.38612 Percent of bounded 0
+    0 KSP Residual norm 0.868511 
+    1 KSP Residual norm 0.000296352 
+    2 KSP Residual norm 8.17352e-06 
+ 20 SNES VI Function norm 2.390947757013e-02 Active lower constraints 3443/3633 upper constraints 0/0 Percent of total 0.365926 Percent of bounded 0
+    0 KSP Residual norm 0.831379 
+    1 KSP Residual norm 0.000268578 
+    2 KSP Residual norm 7.42438e-06 
+ 21 SNES VI Function norm 2.315991829410e-02 Active lower constraints 3253/3443 upper constraints 0/0 Percent of total 0.345733 Percent of bounded 0
+    0 KSP Residual norm 0.796738 
+    1 KSP Residual norm 0.000276534 
+    2 KSP Residual norm 7.76815e-06 
+ 22 SNES VI Function norm 2.245961364031e-02 Active lower constraints 3063/3253 upper constraints 0/0 Percent of total 0.325539 Percent of bounded 0
+    0 KSP Residual norm 0.764265 
+    1 KSP Residual norm 0.000253254 
+    2 KSP Residual norm 7.11779e-06 
+ 23 SNES VI Function norm 2.180076317055e-02 Active lower constraints 2873/3063 upper constraints 0/0 Percent of total 0.305346 Percent of bounded 0
+    0 KSP Residual norm 0.733311 
+    1 KSP Residual norm 0.000262892 
+    2 KSP Residual norm 7.42147e-06 
+    3 KSP Residual norm 1.70668e-07 
+ 24 SNES VI Function norm 2.117696491401e-02 Active lower constraints 2683/2873 upper constraints 0/0 Percent of total 0.285153 Percent of bounded 0
+    0 KSP Residual norm 0.70386 
+    1 KSP Residual norm 0.000238463 
+    2 KSP Residual norm 6.68442e-06 
+ 25 SNES VI Function norm 2.058276052251e-02 Active lower constraints 2493/2683 upper constraints 0/0 Percent of total 0.264959 Percent of bounded 0
+    0 KSP Residual norm 0.675486 
+    1 KSP Residual norm 0.00024684 
+    2 KSP Residual norm 7.06238e-06 
+    3 KSP Residual norm 1.58775e-07 
+ 26 SNES VI Function norm 2.001420296192e-02 Active lower constraints 2303/2493 upper constraints 0/0 Percent of total 0.244766 Percent of bounded 0
+    0 KSP Residual norm 0.648322 
+    1 KSP Residual norm 0.000225464 
+    2 KSP Residual norm 6.39275e-06 
+ 27 SNES VI Function norm 1.946781276950e-02 Active lower constraints 2113/2303 upper constraints 0/0 Percent of total 0.224572 Percent of bounded 0
+    0 KSP Residual norm 0.622075 
+    1 KSP Residual norm 0.000234544 
+    2 KSP Residual norm 6.71026e-06 
+    3 KSP Residual norm 1.51711e-07 
+ 28 SNES VI Function norm 1.894178583484e-02 Active lower constraints 1924/2113 upper constraints 0/0 Percent of total 0.204485 Percent of bounded 0
+    0 KSP Residual norm 0.597384 
+    1 KSP Residual norm 0.000212331 
+    2 KSP Residual norm 5.95886e-06 
+ 29 SNES VI Function norm 1.852853457183e-02 Active lower constraints 1750/1924 upper constraints 0/0 Percent of total 0.185992 Percent of bounded 0
+    0 KSP Residual norm 0.706391 
+    1 KSP Residual norm 0.000567233 
+    2 KSP Residual norm 8.53669e-06 
+    3 KSP Residual norm 1.60828e-07 
+ 30 SNES VI Function norm 1.754837946320e-02 Active lower constraints 1598/1750 upper constraints 0/0 Percent of total 0.169837 Percent of bounded 0
+    0 KSP Residual norm 0.93473 
+    1 KSP Residual norm 0.000481754 
+    2 KSP Residual norm 8.20417e-06 
+ 31 SNES VI Function norm 1.676862871617e-02 Active lower constraints 1460/1598 upper constraints 0/0 Percent of total 0.155171 Percent of bounded 0
+    0 KSP Residual norm 1.13488 
+    1 KSP Residual norm 0.000316585 
+    2 KSP Residual norm 6.62239e-06 
+ 32 SNES VI Function norm 1.610357401180e-02 Active lower constraints 1332/1460 upper constraints 0/0 Percent of total 0.141567 Percent of bounded 0
+    0 KSP Residual norm 1.27503 
+    1 KSP Residual norm 0.000313096 
+    2 KSP Residual norm 6.45606e-06 
+ 33 SNES VI Function norm 1.554556363635e-02 Active lower constraints 1212/1332 upper constraints 0/0 Percent of total 0.128813 Percent of bounded 0
+    0 KSP Residual norm 1.40972 
+    1 KSP Residual norm 0.000346543 
+    2 KSP Residual norm 7.29207e-06 
+ 34 SNES VI Function norm 1.507695154631e-02 Active lower constraints 1100/1212 upper constraints 0/0 Percent of total 0.116909 Percent of bounded 0
+    0 KSP Residual norm 1.53275 
+    1 KSP Residual norm 0.000344637 
+    2 KSP Residual norm 7.28707e-06 
+ 35 SNES VI Function norm 1.467826644359e-02 Active lower constraints 996/1100 upper constraints 0/0 Percent of total 0.105856 Percent of bounded 0
+    0 KSP Residual norm 1.63198 
+    1 KSP Residual norm 0.000482512 
+    2 KSP Residual norm 1.11167e-05 
+ 36 SNES VI Function norm 1.430075723485e-02 Active lower constraints 898/996 upper constraints 0/0 Percent of total 0.0954405 Percent of bounded 0
+    0 KSP Residual norm 1.66151 
+    1 KSP Residual norm 0.000497652 
+    2 KSP Residual norm 9.82946e-06 
+ 37 SNES VI Function norm 1.403299538346e-02 Active lower constraints 806/898 upper constraints 0/0 Percent of total 0.0856627 Percent of bounded 0
+    0 KSP Residual norm 1.7498 
+    1 KSP Residual norm 0.000465016 
+    2 KSP Residual norm 8.49879e-06 
+ 38 SNES VI Function norm 1.379741363892e-02 Active lower constraints 722/806 upper constraints 0/0 Percent of total 0.076735 Percent of bounded 0
+    0 KSP Residual norm 1.80458 
+    1 KSP Residual norm 0.000350757 
+    2 KSP Residual norm 7.49573e-06 
+ 39 SNES VI Function norm 1.353352026518e-02 Active lower constraints 644/722 upper constraints 0/0 Percent of total 0.0684451 Percent of bounded 0
+    0 KSP Residual norm 1.78002 
+    1 KSP Residual norm 0.000343092 
+    2 KSP Residual norm 6.23949e-06 
+ 40 SNES VI Function norm 1.335390302483e-02 Active lower constraints 572/644 upper constraints 0/0 Percent of total 0.0607929 Percent of bounded 0
+    0 KSP Residual norm 1.80355 
+    1 KSP Residual norm 0.000489046 
+    2 KSP Residual norm 1.05897e-05 
+ 41 SNES VI Function norm 1.311312784283e-02 Active lower constraints 506/572 upper constraints 0/0 Percent of total 0.0537783 Percent of bounded 0
+    0 KSP Residual norm 1.74734 
+    1 KSP Residual norm 0.000502745 
+    2 KSP Residual norm 8.79623e-06 
+ 42 SNES VI Function norm 1.294474696796e-02 Active lower constraints 446/506 upper constraints 0/0 Percent of total 0.0474014 Percent of bounded 0
+    0 KSP Residual norm 1.73656 
+    1 KSP Residual norm 0.000331689 
+    2 KSP Residual norm 6.99813e-06 
+ 43 SNES VI Function norm 1.266967929972e-02 Active lower constraints 392/446 upper constraints 0/0 Percent of total 0.0416622 Percent of bounded 0
+    0 KSP Residual norm 1.64508 
+    1 KSP Residual norm 0.00041459 
+    2 KSP Residual norm 8.87392e-06 
+ 44 SNES VI Function norm 1.240587912714e-02 Active lower constraints 342/392 upper constraints 0/0 Percent of total 0.0363482 Percent of bounded 0
+    0 KSP Residual norm 1.5587 
+    1 KSP Residual norm 0.00049759 
+    2 KSP Residual norm 8.2924e-06 
+ 45 SNES VI Function norm 1.221158994128e-02 Active lower constraints 298/342 upper constraints 0/0 Percent of total 0.0316718 Percent of bounded 0
+    0 KSP Residual norm 1.51519 
+    1 KSP Residual norm 0.000295973 
+    2 KSP Residual norm 6.4029e-06 
+ 46 SNES VI Function norm 1.184530415181e-02 Active lower constraints 260/298 upper constraints 0/0 Percent of total 0.0276331 Percent of bounded 0
+    0 KSP Residual norm 1.39666 
+    1 KSP Residual norm 0.000400467 
+    2 KSP Residual norm 8.17937e-06 
+ 47 SNES VI Function norm 1.147776854301e-02 Active lower constraints 226/260 upper constraints 0/0 Percent of total 0.0240196 Percent of bounded 0
+    0 KSP Residual norm 1.28758 
+    1 KSP Residual norm 0.000516693 
+    2 KSP Residual norm 8.76134e-06 
+ 48 SNES VI Function norm 1.128662875528e-02 Active lower constraints 206/226 upper constraints 0/0 Percent of total 0.0218939 Percent of bounded 0
+    0 KSP Residual norm 1.34679 
+    1 KSP Residual norm 0.00018716 
+    2 KSP Residual norm 4.46395e-06 
+ 49 SNES VI Function norm 1.023414773592e-02 Active lower constraints 200/206 upper constraints 0/0 Percent of total 0.0212562 Percent of bounded 0
+    0 KSP Residual norm 0.733538 
+    1 KSP Residual norm 5.37841e-05 
+    2 KSP Residual norm 1.92659e-06 
+ 50 SNES VI Function norm 7.901146653359e-03 Active lower constraints 198/200 upper constraints 0/0 Percent of total 0.0210437 Percent of bounded 0
+    0 KSP Residual norm 0.386062 
+    1 KSP Residual norm 0.000108925 
+    2 KSP Residual norm 2.31172e-06 
+ 51 SNES VI Function norm 2.512634771404e-04 Active lower constraints 198/198 upper constraints 0/0 Percent of total 0.0210437 Percent of bounded 0
+    0 KSP Residual norm 0.00408659 
+    1 KSP Residual norm 2.92958e-05 
+    2 KSP Residual norm 1.02766e-06 
+    3 KSP Residual norm 5.54081e-08 
+    4 KSP Residual norm 1.7915e-09 
+ 52 SNES VI Function norm 9.542675739256e-07 Active lower constraints 198/198 upper constraints 0/0 Percent of total 0.0210437 Percent of bounded 0
+    0 KSP Residual norm 3.21206e-06 
+    1 KSP Residual norm 5.05625e-08 
+    2 KSP Residual norm 1.99096e-09 
+    3 KSP Residual norm 5.646e-11 
+    4 KSP Residual norm < 1.e-11
+ 53 SNES VI Function norm 8.424847616443e-12 Active lower constraints 198/198 upper constraints 0/0 Percent of total 0.0210437 Percent of bounded 0
+    0 KSP Residual norm 1.852e-11 
+    1 KSP Residual norm < 1.e-11
+    2 KSP Residual norm < 1.e-11
+    3 KSP Residual norm < 1.e-11
+    4 KSP Residual norm < 1.e-11
+ 54 SNES VI Function norm 2.608460603904e-15 Active lower constraints 198/198 upper constraints 0/0 Percent of total 0.0210437 Percent of bounded 0
+Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE iterations 54

src/snes/impls/composite/snescomposite.c

       }
     }
   } else if (snes->normschedule == SNES_NORM_ALWAYS) {
-    SNESComputeFunction(snes,X,F);CHKERRQ(ierr);
+    ierr = SNESComputeFunction(snes,X,F);CHKERRQ(ierr);
     if (snes->domainerror) {
       snes->reason = SNES_DIVERGED_FUNCTION_DOMAIN;
       PetscFunctionReturn(0);
   ierr = PetscFree(jac->beta);CHKERRQ(ierr);
   ierr = PetscFree(jac->work);CHKERRQ(ierr);
   ierr = PetscFree(jac->rwork);CHKERRQ(ierr);
-
   PetscFunctionReturn(0);
 }
 

src/snes/impls/gs/gsimpl.h

   PetscReal stol;       /* step tolerance of the inner pointblock solver */
   PetscReal h;          /* differencing for secant variants */
   PetscBool secant_mat; /* use the Jacobian to get the coloring for the secant */
-} SNES_GS;
+} SNES_NGS;
 
-PETSC_EXTERN PetscErrorCode SNESComputeGSDefaultSecant(SNES,Vec,Vec,void *);
+PETSC_EXTERN PetscErrorCode SNESComputeNGSDefaultSecant(SNES,Vec,Vec,void *);
 
 #endif

src/snes/impls/gs/gssecant.c

 #include <../src/snes/impls/gs/gsimpl.h>
 
 #undef __FUNCT__
-#define __FUNCT__ "GSDestroy_Private"
-PetscErrorCode GSDestroy_Private(ISColoring coloring)
+#define __FUNCT__ "SNESNGSDestroy_Private"
+static PetscErrorCode SNESNGSDestroy_Private(ISColoring coloring)
 {
   PetscErrorCode ierr;
 
   PetscFunctionBegin;
   ierr = ISColoringDestroy(&coloring);CHKERRQ(ierr);
   PetscFunctionReturn(0);
-
 }
 
 #undef __FUNCT__
-#define __FUNCT__ "SNESComputeGSDefaultSecant"
-PETSC_EXTERN PetscErrorCode SNESComputeGSDefaultSecant(SNES snes,Vec X,Vec B,void *ctx)
+#define __FUNCT__ "SNESComputeNGSDefaultSecant"
+PETSC_EXTERN PetscErrorCode SNESComputeNGSDefaultSecant(SNES snes,Vec X,Vec B,void *ctx)
 {
   PetscErrorCode ierr;
-  SNES_GS *gs = (SNES_GS*)snes->data;
+  SNES_NGS       *gs = (SNES_NGS*)snes->data;
   PetscInt       i,j,k,ncolors;
   DM             dm;
   PetscBool      flg;
   G = snes->work[1];
   F = snes->work[2];
   ierr = VecGetOwnershipRange(X,&s,NULL);CHKERRQ(ierr);
-  ierr = SNESGSGetTolerances(snes,&atol,&rtol,&stol,&its);CHKERRQ(ierr);
+  ierr = SNESNGSGetTolerances(snes,&atol,&rtol,&stol,&its);CHKERRQ(ierr);
   ierr = SNESGetDM(snes,&dm);CHKERRQ(ierr);
   ierr = SNESGetFunction(snes,NULL,&func,&fctx);CHKERRQ(ierr);
-  ierr = PetscObjectQuery((PetscObject)snes,"SNESGSColoring",(PetscObject*)&colorcontainer);CHKERRQ(ierr);
+  ierr = PetscObjectQuery((PetscObject)snes,"SNESNGSColoring",(PetscObject*)&colorcontainer);CHKERRQ(ierr);
   if (!colorcontainer) {
     /* create the coloring */
     ierr = DMHasColoring(dm,&flg);CHKERRQ(ierr);
     }
     ierr = PetscContainerCreate(PetscObjectComm((PetscObject)snes),&colorcontainer);CHKERRQ(ierr);
     ierr = PetscContainerSetPointer(colorcontainer,(void *)coloring);CHKERRQ(ierr);
-    ierr = PetscContainerSetUserDestroy(colorcontainer,(PetscErrorCode (*)(void *))GSDestroy_Private);CHKERRQ(ierr);
-    ierr = PetscObjectCompose((PetscObject)snes,"SNESGSColoring",(PetscObject)colorcontainer);CHKERRQ(ierr);
+    ierr = PetscContainerSetUserDestroy(colorcontainer,(PetscErrorCode (*)(void *))SNESNGSDestroy_Private);CHKERRQ(ierr);
+    ierr = PetscObjectCompose((PetscObject)snes,"SNESNGSColoring",(PetscObject)colorcontainer);CHKERRQ(ierr);
     ierr = PetscContainerDestroy(&colorcontainer);CHKERRQ(ierr);
   } else {
     ierr = PetscContainerGetPointer(colorcontainer,(void **)&coloring);CHKERRQ(ierr);
     /* assume that the function is already computed */
     ierr = VecCopy(snes->vec_func,F);CHKERRQ(ierr);
   } else {
-    ierr = PetscLogEventBegin(SNES_GSFuncEval,snes,X,B,0);CHKERRQ(ierr);
+    ierr = PetscLogEventBegin(SNES_NGSFuncEval,snes,X,B,0);CHKERRQ(ierr);
     ierr = (*func)(snes,X,F,fctx);CHKERRQ(ierr);
-    ierr = PetscLogEventEnd(SNES_GSFuncEval,snes,X,B,0);CHKERRQ(ierr);
+    ierr = PetscLogEventEnd(SNES_NGSFuncEval,snes,X,B,0);CHKERRQ(ierr);
     if (B) {ierr = VecAXPY(F,-1.0,B);CHKERRQ(ierr);}
   }
   ierr = VecGetArray(X,&xa);CHKERRQ(ierr);
     for (j=0;j<size;j++) {
       wa[idx[j]-s] += h;
     }
-    ierr = PetscLogEventBegin(SNES_GSFuncEval,snes,X,B,0);CHKERRQ(ierr);
+    ierr = PetscLogEventBegin(SNES_NGSFuncEval,snes,X,B,0);CHKERRQ(ierr);