PetscPreLoadBegin#
Begin a segment of code that may be preloaded (run twice) to get accurate timings
Synopsis#
#include <petsclog.h>
void PetscPreLoadBegin(PetscBool flag, char *name);
Not Collective
Input Parameters#
flag -
PETSC_TRUEto run twice,PETSC_FALSEto run once, may be overridden with command line option-preload true|falsename - name of first stage (lines of code timed separately with
-log_view) to be preloaded
Example Usage#
PetscPreLoadBegin(PETSC_TRUE, "first stage");
// lines of code
PetscPreLoadStage("second stage");
// lines of code
PetscPreLoadEnd();
Note#
Only works in C/C++, not Fortran
Flags available within the macro:
PetscPreLoadingUsed -
PETSC_TRUEif we are or have done preloadingPetscPreLoadingOn -
PETSC_TRUEif it is CURRENTLY doing preloadPetscPreLoadIt -
0for the first computation (with preloading turned off it is only0)1for the secondPetscPreLoadMax - number of times it will do the computation, only one when preloading is turned on
The first two variables are available throughout the program, the second two only between the
PetscPreLoadBegin() and PetscPreLoadEnd()
See Also#
Profiling, PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadEnd(), PetscPreLoadStage()
Level#
intermediate
Location#
Examples#
Index of all Profiling routines
Table of Contents for all manual pages
Index of all manual pages