From 5d2aff17e146972bda21c981206c03751de8ecaa Mon Sep 17 00:00:00 2001 From: Eike Mueller Date: Sat, 17 Oct 2015 22:34:04 +0100 Subject: [PATCH] Fix message on more complex BoomerAMG smoothers As spotted by Jed Brown, the format string in the Printf statement contained no %s, but was passed HYPREBoomerAMGSmoothType[jac->smoothtype]. This is actually undefined since jac->smoothtype = -1 if the else-branch is executed. This commit fixes this by removing HYPREBoomerAMGSmoothType[jac->smoothtype]. --- src/ksp/pc/impls/hypre/hypre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ksp/pc/impls/hypre/hypre.c b/src/ksp/pc/impls/hypre/hypre.c index d50ab9c..485e397 100644 --- a/src/ksp/pc/impls/hypre/hypre.c +++ b/src/ksp/pc/impls/hypre/hypre.c @@ -745,7 +745,7 @@ static PetscErrorCode PCView_HYPRE_BoomerAMG(PC pc,PetscViewer viewer) ierr = PetscViewerASCIIPrintf(viewer," HYPRE BoomerAMG: Smooth type %s\n",HYPREBoomerAMGSmoothType[jac->smoothtype]);CHKERRQ(ierr); ierr = PetscViewerASCIIPrintf(viewer," HYPRE BoomerAMG: Smooth num levels %d\n",jac->smoothnumlevels);CHKERRQ(ierr); } else { - ierr = PetscViewerASCIIPrintf(viewer," HYPRE BoomerAMG: Not using more complex smoothers.\n",HYPREBoomerAMGSmoothType[jac->smoothtype]);CHKERRQ(ierr); + ierr = PetscViewerASCIIPrintf(viewer," HYPRE BoomerAMG: Not using more complex smoothers.\n");CHKERRQ(ierr); } if (jac->smoothtype==3) { ierr = PetscViewerASCIIPrintf(viewer," HYPRE BoomerAMG: Euclid ILU(k) levels %d\n",jac->eu_level);CHKERRQ(ierr); -- 2.2.1