PetscPreLoadBegin#

Begin a block of code that is timed twice so that startup costs (such as JIT or first-touch allocation) are not attributed to the measured run

Synopsis#

#include <petsclog.h>
PetscPreLoadBegin(PetscBool flag, const char name[])

Not Collective; No Fortran Support

Input Parameters#

  • flag - whether preloading is desired (may be overridden by the command-line option -preload)

  • name - name to use for the PetscLogStage created for the measured run

Note#

Use this macro in the form

    PetscPreLoadBegin(PETSC_TRUE, "Compute");
    // ... code to be timed
    PetscPreLoadEnd();

It expands to a loop that runs the enclosed code twice when preloading is enabled and once otherwise. Pair with PetscPreLoadEnd(). Use PetscPreLoadStage() to advance to a new named stage between phases.

See Also#

PetscPreLoadEnd, PetscPreLoadStage, PetscLogStageRegister(), PetscLogStagePush()

Level#

intermediate

Location#

include/petsclog.h

Examples#

src/ksp/ksp/tutorials/ex10.c


Index of all Log routines
Table of Contents for all manual pages
Index of all manual pages