API

Vernier’s API consists of three primary functions; start, stop, and write. A timed region is defined by a start-stop pair.

How calls to these functions are made differs slightly between C++ and Fortran, but the core functionality is the same.

C++

Vernier
members:

start, stop, write

Fortran

vernier_start

vernier_stop

vernier_write

Dos and don’ts

Do:

  • Initialise MPI before profiling.

  • Nest timed regions nicely (no overlap).

Don’t:

  • Use a singular hash (or “handle”) for all regions.

  • Have a stop calliper after any return statements.

Examples

C++:

#include "vernier.h"

// Start
auto vernier_handle = vernier.start("Main region");

// Stop
vernier.stop(vernier_handle);

// Write
vernier.write();

Fortran:

use vernier_mod
integer (kind=pik) :: vernier_handle

! Start
call vernier_start(vernier_handle, "Main region")

! Stop
call vernier_stop(vernier_handle)

! Write
call vernier_write()