From 3bb9c8552ac3d8503d31cde13e26208ca08bd0dd Mon Sep 17 00:00:00 2001 From: "Jeffrey N. Johnson" Date: Sun, 4 Oct 2020 19:05:50 -0700 Subject: [PATCH] Moved driver initializaton into "TDycore Setup" stage. Also added a few more timers. --- src/tdycore.c | 4 ++++ src/tdydriver.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/tdycore.c b/src/tdycore.c index 71190588..2b47b659 100644 --- a/src/tdycore.c +++ b/src/tdycore.c @@ -1411,16 +1411,19 @@ PetscErrorCode TDyPostSolveSNESSolver(TDy tdy,Vec U) { PetscErrorCode TDyCreateVectors(TDy tdy) { PetscErrorCode ierr; PetscFunctionBegin; + TDY_START_FUNCTION_TIMER() ierr = DMCreateGlobalVector(tdy->dm,&tdy->solution); CHKERRQ(ierr); ierr = VecDuplicate(tdy->solution,&tdy->residual); CHKERRQ(ierr); ierr = VecDuplicate(tdy->solution,&tdy->accumulation_prev); CHKERRQ(ierr); ierr = VecDuplicate(tdy->solution,&tdy->soln_prev); CHKERRQ(ierr); + TDY_STOP_FUNCTION_TIMER() PetscFunctionReturn(0); } PetscErrorCode TDyCreateJacobian(TDy tdy) { PetscErrorCode ierr; PetscFunctionBegin; + TDY_START_FUNCTION_TIMER() ierr = DMCreateMatrix(tdy->dm,&tdy->J); CHKERRQ(ierr); ierr = MatSetOption(tdy->J,MAT_KEEP_NONZERO_PATTERN,PETSC_FALSE); CHKERRQ(ierr); ierr = MatSetOption(tdy->J,MAT_ROW_ORIENTED,PETSC_FALSE); CHKERRQ(ierr); @@ -1431,6 +1434,7 @@ PetscErrorCode TDyCreateJacobian(TDy tdy) { ierr = MatSetOption(tdy->Jpre,MAT_ROW_ORIENTED,PETSC_FALSE); CHKERRQ(ierr); ierr = MatSetOption(tdy->Jpre,MAT_NO_OFF_PROC_ZERO_ROWS,PETSC_TRUE); CHKERRQ(ierr); ierr = MatSetOption(tdy->Jpre,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE); CHKERRQ(ierr); + TDY_STOP_FUNCTION_TIMER() PetscFunctionReturn(0); } diff --git a/src/tdydriver.c b/src/tdydriver.c index e102b5b5..641b08ea 100644 --- a/src/tdydriver.c +++ b/src/tdydriver.c @@ -8,6 +8,7 @@ PetscErrorCode TDyDriverInitializeTDy(TDy tdy) { PetscErrorCode ierr; PetscFunctionBegin; + TDyEnterProfilingStage("TDycore Setup"); TDY_START_FUNCTION_TIMER() PetscReal gravity[3] = {0.,0.,0.}; SNESLineSearch linesearch; @@ -109,5 +110,6 @@ PetscErrorCode TDyDriverInitializeTDy(TDy tdy) { CHKERRQ(ierr); } TDY_STOP_FUNCTION_TIMER() + TDyExitProfilingStage("TDycore Setup"); PetscFunctionReturn(0); }