petsc-3.7.1 2016-05-15
Report Typos and Errors

# 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 Many br

### Input Parameter

| flag | - PETSC_TRUE to run twice, PETSC_FALSE to run once, may be overridden Many brwith command line option -preload true or -preload false Many br
| name | - name of first stage (lines of code timed separately with -log_summary) to Many brbe preloaded Many br

### Usage

         PetscPreLoadBegin(PETSC_TRUE,"first stage);
           lines of code
           PetscPreLoadStage("second stage");
           lines of code
         PetscPreLoadEnd();

Many br

Notes: Only works in C/C++, not Fortran Many br

Flags available within the macro. Many br

| PetscPreLoadingUsed | - true if we are or have done preloading Many br
| PetscPreLoadingOn | - true if it is CURRENTLY doing preload Many br
| PetscPreLoadIt | - 0 for the first computation (with preloading turned off it is only 0) 1 for the second Many br
| PetscPreLoadMax | - number of times it will do the computation, only one when preloading is turned on Many brThe first two variables are available throughout the program, the second two only between the PetscPreLoadBegin() Many brand PetscPreLoadEnd() Many br

Many br

### See Also

PetscLogEventRegister(), PetscLogEventBegin(), PetscLogEventEnd(), PetscPreLoadEnd(), PetscPreLoadStage()

Level:intermediate
Location:src/sys/logging/plog.c
Index of all Profiling routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/mat/examples/tutorials/ex1.c.html
src/ksp/ksp/examples/tutorials/ex10.c.html
src/ksp/ksp/examples/tutorials/ex27.c.html