[petsc-dev] PETSc blame digest

Satish Balay balay at mcs.anl.gov
Thu Apr 7 12:02:27 CDT 2016


Thanks for the patch. I can add it in.

Wrt TSAdaptCheckStage() - there is one more warning - its associated
with lines Jed changed - so you didn't see this.

          CC arch-linux2-c-debug/obj/src/ts/adapt/interface/tsadapt.o
/home/balay/petsc/src/ts/adapt/interface/tsadapt.c:639:7: warning: Value stored to 'new_dt' is never read
      new_dt = dt*adapt->scale_solve_failed;
      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.


Perhaps the following fix?

diff --git a/src/ts/adapt/interface/tsadapt.c b/src/ts/adapt/interface/tsadapt.c
index 2193b98..5beecdd 100644
--- a/src/ts/adapt/interface/tsadapt.c
+++ b/src/ts/adapt/interface/tsadapt.c
@@ -635,8 +635,6 @@ PetscErrorCode TSAdaptCheckStage(TSAdapt adapt,TS ts,PetscReal t,Vec Y,PetscBool
         ierr = PetscViewerASCIIPrintf(adapt->monitor,"    TSAdapt '%s': step %3D stage rejected t=%-11g+%10.3e, nonlinear solve failures %D greater than current TS allowed\n",((PetscObject)adapt)->type_name,ts->steps,(double)ts->ptime,dt,ts->num_snes_failures);CHKERRQ(ierr);
         ierr = PetscViewerASCIISubtractTab(adapt->monitor,((PetscObject)adapt)->tablevel);CHKERRQ(ierr);
       }
-    } else {
-      new_dt = dt*adapt->scale_solve_failed;
     }
   } else {
     ierr = TSFunctionDomainError(ts,t,Y,accept);CHKERRQ(ierr);


We just enabled this clang analyzer test - its showing quiet a few
things - its giving a huge list of issues to go through..

Satish

On Thu, 7 Apr 2016, Pierre Barbier de Reuille wrote:

> Hey,
> 
> I just received this blame:
> http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2016/04/07/build_next_arch-linux-analyzer_crush.log
> 
> I corrected it by initializing dt and new_dt to 0 in TSAdaptCheckStage.
> Note that dt cannot be used before is properly initialized using the
> TSGetTimeStep function.
> 
> The result is in the branch
> PierreBdR/initialized-dt-and-new_dt-in-tsadaptchec-1460047069883
> <https://bitbucket.org/PierreBdR/petsc-1/branch/PierreBdR/initialized-dt-and-new_dt-in-tsadaptchec-1460047069883>
> (sorry for the name, I used the online editor for such a small
> modification).
> 
> Cheers,
> 
> Pierre
> 




More information about the petsc-dev mailing list