BarryFSmith avatar BarryFSmith committed 235162c

no we don't put calls to PetscTime() randomly in the code, that is what the logging is for

Comments (0)

Files changed (9)

src/contrib/keyes/ex15.c

 
 */
 
-#include "snes.h"
-#include <petsctime.h>
+#include <snes.h"
 #include "da.h"
 #include "mg.h"
 

src/ksp/ksp/examples/tests/ex18.c

 
 #include <petscmat.h>
 #include <petscksp.h>
-#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
 {
   PetscErrorCode ierr;
   PetscInt       its,m,n,mvec;
-  PetscLogDouble time1,time2,time;
   PetscReal      norm;
   Vec            x,b,u;
   Mat            A;
   ierr = KSPCreate(PETSC_COMM_WORLD,&ksp);CHKERRQ(ierr);
   ierr = KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr);
   ierr = KSPSetFromOptions(ksp);CHKERRQ(ierr);
-  ierr = PetscTime(&time1);CHKERRQ(ierr);
   ierr = KSPSolve(ksp,b,x);CHKERRQ(ierr);
-  ierr = PetscTime(&time2);CHKERRQ(ierr);
-  time = time2 - time1;
   ierr = PetscLogStagePop();CHKERRQ(ierr);
 
   /* Show result */
   ierr = KSPGetIterationNumber(ksp,&its);CHKERRQ(ierr);
   ierr = PetscPrintf(PETSC_COMM_WORLD,"Number of iterations = %3D\n",its);CHKERRQ(ierr);
   ierr = PetscPrintf(PETSC_COMM_WORLD,"Residual norm %G\n",norm);CHKERRQ(ierr);
-  ierr = PetscPrintf(PETSC_COMM_WORLD,"Time for solve = %5.2f seconds\n",time);CHKERRQ(ierr);
 
   /* Cleanup */
   ierr = KSPDestroy(&ksp);CHKERRQ(ierr);

src/ksp/ksp/examples/tests/ex30.c

 T*/
 
 #include <petscksp.h>
-#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
   PetscErrorCode ierr;
   PetscInt       its,num_numfac,n,M;
   PetscReal      rnorm,enorm;
-  PetscLogDouble tsetup,tsetup1,tsetup2,tsolve,tsolve1,tsolve2;
   PetscBool      preload=PETSC_TRUE,diagonalscale,isSymmetric,ckrnorm=PETSC_TRUE,Test_MatDuplicate=PETSC_FALSE,ckerror=PETSC_FALSE;
   PetscMPIInt    rank;
   PetscScalar    sigma;
   }
 
   /*
-     We also explicitly time this stage via PetscTime()
-  */
-  ierr = PetscTime(&tsetup1);CHKERRQ(ierr);
-
-  /*
      Create linear solver; set operators; set runtime options.
   */
   ierr       = KSPCreate(PETSC_COMM_WORLD,&ksp);CHKERRQ(ierr);
     */
     ierr   = KSPSetUp(ksp);CHKERRQ(ierr);
     ierr   = KSPSetUpOnBlocks(ksp);CHKERRQ(ierr);
-    ierr   = PetscTime(&tsetup2);CHKERRQ(ierr);
-    tsetup = tsetup2 - tsetup1;
 
     /*
      Tests "diagonal-scaling of preconditioned residual norm" as used
                          Solve system
       - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     /*
-     Solve linear system; we also explicitly time this stage.
+     Solve linear system; 
     */
-    ierr = PetscTime(&tsolve1);CHKERRQ(ierr);
     if (trans) {
       ierr = KSPSolveTranspose(ksp,b,x);CHKERRQ(ierr);
       ierr = KSPGetIterationNumber(ksp,&its);CHKERRQ(ierr);
       }
 
     }   /* while (num_rhs--) */
-    ierr   = PetscTime(&tsolve2);CHKERRQ(ierr);
-    tsolve = tsolve2 - tsolve1;
 
 
     /*
       ierr = PetscViewerStringOpen(PETSC_COMM_WORLD,kspinfo,120,&viewer);CHKERRQ(ierr);
       ierr = KSPView(ksp,viewer);CHKERRQ(ierr);
       ierr = PetscStrrchr(file[PetscPreLoadIt],'/',&matrixname);CHKERRQ(ierr);
-      ierr = PetscPrintf(PETSC_COMM_WORLD,"%-8.8s %3D %2.0e %2.1e %2.1e %2.1e %s \n",
-                         matrixname,its,rnorm,tsetup+tsolve,tsetup,tsolve,kspinfo);CHKERRQ(ierr);
+      ierr = PetscPrintf(PETSC_COMM_WORLD,"%-8.8s %3D %2.0e %s \n", matrixname,its,rnorm,kspinfo);CHKERRQ(ierr);
 
       /*
         Destroy the viewer

src/ksp/ksp/examples/tests/ex6.c

   -f <input_file> : file to load. For example see $PETSC_DIR/share/petsc/datafiles/matrices\n\n";
 
 #include <petscksp.h>
-#include <petsctime.h>
 #include <petsclog.h>
 
 #undef __FUNCT__
   PetscInt       its;
   PetscLogStage  stage1,stage2;
   PetscReal      norm;
-  PetscLogDouble tsetup1,tsetup2,tsetup,tsolve1,tsolve2,tsolve;
   Vec            x,b,u;
   Mat            A;
   char           file[PETSC_MAX_PATH_LEN];
 
   PetscLogStageRegister("mystage 1",&stage1);
   PetscLogStagePush(stage1);
-  ierr   = PetscTime(&tsetup1);CHKERRQ(ierr);
   ierr   = KSPCreate(PETSC_COMM_WORLD,&ksp);CHKERRQ(ierr);
   ierr   = KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr);
   ierr   = KSPSetFromOptions(ksp);CHKERRQ(ierr);
   ierr   = KSPSetUp(ksp);CHKERRQ(ierr);
   ierr   = KSPSetUpOnBlocks(ksp);CHKERRQ(ierr);
-  ierr   = PetscTime(&tsetup2);CHKERRQ(ierr);
-  tsetup = tsetup2 -tsetup1;
   PetscLogStagePop();
   ierr = PetscBarrier((PetscObject)A);CHKERRQ(ierr);
 
   PetscLogStageRegister("mystage 2",&stage2);
   PetscLogStagePush(stage2);
-  ierr   = PetscTime(&tsolve1);CHKERRQ(ierr);
   ierr   = KSPSolve(ksp,b,x);CHKERRQ(ierr);
-  ierr   = PetscTime(&tsolve2);CHKERRQ(ierr);
-  tsolve = tsolve2 - tsolve1;
   PetscLogStagePop();
 
   /* Show result */
   ierr = VecAXPY(u,-1.0,b);CHKERRQ(ierr);
   ierr = VecNorm(u,NORM_2,&norm);CHKERRQ(ierr);
   ierr = KSPGetIterationNumber(ksp,&its);CHKERRQ(ierr);
-  /*  matrix PC   KSP   Options       its    residual setuptime solvetime  */
+  /*  matrix PC   KSP   Options       its    residual  */
   if (table) {
     char        *matrixname,kspinfo[120];
     PetscViewer viewer;
     ierr = PetscViewerStringOpen(PETSC_COMM_WORLD,kspinfo,120,&viewer);CHKERRQ(ierr);
     ierr = KSPView(ksp,viewer);CHKERRQ(ierr);
     ierr = PetscStrrchr(file,'/',&matrixname);CHKERRQ(ierr);
-    ierr = PetscPrintf(PETSC_COMM_WORLD,"%-8.8s %3D %2.0e %2.1e %2.1e %2.1e %s \n",
-                       matrixname,its,norm,tsetup+tsolve,tsetup,tsolve,kspinfo);CHKERRQ(ierr);
+    ierr = PetscPrintf(PETSC_COMM_WORLD,"%-8.8s %3D %2.0e %s \n",matrixname,its,norm,kspinfo);CHKERRQ(ierr);
     ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
   } else {
     ierr = PetscPrintf(PETSC_COMM_WORLD,"Number of iterations = %3D\n",its);CHKERRQ(ierr);

src/ksp/ksp/examples/tutorials/ex10.c

      petscviewer.h - viewers               petscpc.h  - preconditioners
 */
 #include <petscksp.h>
-#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "main"
   PetscErrorCode ierr;
   PetscInt       its,num_numfac,m,n,M;
   PetscReal      norm;
-  PetscLogDouble tsetup,tsetup1,tsetup2,tsolve,tsolve1,tsolve2;
   PetscBool      preload=PETSC_TRUE,isSymmetric,cknorm=PETSC_FALSE,initialguessfile = PETSC_FALSE;
   PetscMPIInt    rank;
   char           initialguessfilename[PETSC_MAX_PATH_LEN];
   PetscPreLoadStage("KSPSetUpSolve");
 
   /*
-     We also explicitly time this stage via PetscTime()
-  */
-  ierr = PetscTime(&tsetup1);CHKERRQ(ierr);
-
-  /*
      Create linear solver; set operators; set runtime options.
   */
   ierr       = KSPCreate(PETSC_COMM_WORLD,&ksp);CHKERRQ(ierr);
     */
     ierr   = KSPSetUp(ksp);CHKERRQ(ierr);
     ierr   = KSPSetUpOnBlocks(ksp);CHKERRQ(ierr);
-    ierr   = PetscTime(&tsetup2);CHKERRQ(ierr);
-    tsetup = tsetup2 - tsetup1;
 
     /* - - - - - - - - - - - New Stage - - - - - - - - - - - - -
                          Solve system
       - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
     /*
-     Solve linear system; we also explicitly time this stage.
+     Solve linear system; 
     */
-    ierr = PetscTime(&tsolve1);CHKERRQ(ierr);
     if (trans) {
       ierr = KSPSolveTranspose(ksp,b,x);CHKERRQ(ierr);
       ierr = KSPGetIterationNumber(ksp,&its);CHKERRQ(ierr);
         }
       }
     }   /* while (num_rhs--) */
-    ierr   = PetscTime(&tsolve2);CHKERRQ(ierr);
-    tsolve = tsolve2 - tsolve1;
 
     /* - - - - - - - - - - - New Stage - - - - - - - - - - - - -
           Check error, print output, free data structures.
       ierr = PetscViewerStringOpen(PETSC_COMM_WORLD,kspinfo,120,&viewer);CHKERRQ(ierr);
       ierr = KSPView(ksp,viewer);CHKERRQ(ierr);
       ierr = PetscStrrchr(file[PetscPreLoadIt],'/',&matrixname);CHKERRQ(ierr);
-      ierr = PetscPrintf(PETSC_COMM_WORLD,"%-8.8s %3D %2.0e %2.1e %2.1e %2.1e %s \n",
-                         matrixname,its,norm,tsetup+tsolve,tsetup,tsolve,kspinfo);CHKERRQ(ierr);
+      ierr = PetscPrintf(PETSC_COMM_WORLD,"%-8.8s %3D %2.0e %s \n",matrixname,its,norm,kspinfo);CHKERRQ(ierr);
 
       /*
         Destroy the viewer

src/ksp/ksp/examples/tutorials/ex42.c

 
 #include "petscksp.h"
 #include "petscdmda.h"
-#include <petsctime.h>
 
 #define PROFILE_TIMING
 #define ASSEMBLE_LOWER_TRIANGULAR
   ierr = DMDAVecGetArray(cda,coords,&_coords);CHKERRQ(ierr);
 
   ierr = DMDAGetElementCorners(stokes_da,&sex,&sey,&sez,&mx,&my,&mz);CHKERRQ(ierr);
-  PetscTime(&t0);
   for (ek = sez; ek < sez+mz; ek++) {
     for (ej = sey; ej < sey+my; ej++) {
       for (ei = sex; ei < sex+mx; ei++) {
 
   ierr = DMDAVecRestoreArray(cda,coords,&_coords);CHKERRQ(ierr);
 
-  PetscTime(&t1);
   PetscFunctionReturn(0);
 }
 
   PetscErrorCode ierr;
 
   PetscFunctionBeginUser;
-  ierr = PetscTime(&t0);CHKERRQ(ierr);
 
   /* create file name */
   PetscObjectGetComm((PetscObject)da,&comm);
     vtk_fp = NULL;
   }
 
-  ierr = PetscTime(&t1);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 

src/mat/impls/aij/mpi/superlu_dist/superlu_dist.c

 
 #include <../src/mat/impls/aij/seq/aij.h>
 #include <../src/mat/impls/aij/mpi/mpiaij.h>
-#include <petsctime.h>
 #if defined(PETSC_HAVE_STDLIB_H) /* This is to get around weird problem with SuperLU on cray */
 #include <stdlib.h>
 #endif
   SuperLUStat_t    stat;
   double           *berr=0;
   IS               isrow;
-  PetscLogDouble   time0,time,time_min,time_max;
   Mat              F_diag=NULL;
 #if defined(PETSC_USE_COMPLEX)
   doublecomplex    *av, *bv;
   PetscFunctionBegin;
   ierr = MPI_Comm_size(PetscObjectComm((PetscObject)A),&size);CHKERRQ(ierr);
 
-  if (lu->options.PrintStat) { /* collect time for mat conversion */
-    ierr = MPI_Barrier(PetscObjectComm((PetscObject)A));CHKERRQ(ierr);
-    ierr = PetscTime(&time0);CHKERRQ(ierr);
-  }
-
   if (lu->MatInputMode == GLOBAL) { /* global mat input */
     if (size > 1) { /* convert mpi A to seq mat A */
       ierr = ISCreateStride(PETSC_COMM_SELF,M,0,1,&isrow);CHKERRQ(ierr);
     PetscStackCall("SuperLU_DIST:dCreate_CompRowLoc_Matrix_dist",dCreate_CompRowLoc_Matrix_dist(&lu->A_sup, M, N, nz, m, rstart,lu->val, lu->col, lu->row, SLU_NR_loc, SLU_D, SLU_GE));
 #endif
   }
-  if (lu->options.PrintStat) {
-    ierr  = PetscTime(&time);CHKERRQ(ierr);
-    time0 = time - time0;
-  }
 
   /* Factor the matrix. */
   PetscStackCall("SuperLU_DIST:PStatInit",PStatInit(&stat));   /* Initialize the statistics variables. */
   }
 
   if (lu->options.PrintStat) {
-    ierr = MPI_Reduce(&time0,&time_max,1,MPI_DOUBLE,MPI_MAX,0,PetscObjectComm((PetscObject)A));
-    ierr = MPI_Reduce(&time0,&time_min,1,MPI_DOUBLE,MPI_MIN,0,PetscObjectComm((PetscObject)A));
-    ierr = MPI_Reduce(&time0,&time,1,MPI_DOUBLE,MPI_SUM,0,PetscObjectComm((PetscObject)A));
-    time = time/size; /* average time */
-    ierr = PetscPrintf(PetscObjectComm((PetscObject)A), "        Mat conversion(PETSc->SuperLU_DIST) time (max/min/avg): \n                              %g / %g / %g\n",time_max,time_min,time);CHKERRQ(ierr);
     PStatPrint(&lu->options, &stat, &lu->grid);  /* Print the statistics. */
   }
   PStatFree(&stat);

src/mat/impls/aij/seq/matmatmult.c

 #include <../src/mat/utils/petscheap.h>
 #include <petscbt.h>
 #include <../src/mat/impls/dense/seq/dense.h>
-#include <petsctime.h>
 
 static PetscErrorCode MatMatMultSymbolic_SeqAIJ_SeqAIJ_LLCondensed(Mat,Mat,PetscReal,Mat*);
 

src/mat/impls/aij/seq/matrart.c

 #include <../src/mat/impls/aij/seq/aij.h>
 #include <../src/mat/utils/freespace.h>
 #include <../src/mat/impls/dense/seq/dense.h> /*I "petscmat.h" I*/
-#include <petsctime.h>
 
 #undef __FUNCT__
 #define __FUNCT__ "MatDestroy_SeqAIJ_RARt"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.