Annotation API

C++ API

For the C++ API we provide the following functions in the nesmik namespace:

#include <nesmik/nesmik.hpp>
# To initialize
nesmik::init();

# To start a region
nesmik::region_start(const std::string&);

# To stop a region
nesmik::region_stop(const std::string&);

# To stop the last region started
nesmik::region_stop_last();

# To finalize
nesmik::finalize();

C API

For the C API we provide the following functions using a underscore implicit namespace:

#include <nesmik/nesmik.h>

# To initialize
nesmik_init();

# To start a region
nesmik_region_start(const char *);

# To stop a region
nesmik_region_stop(const char *);

# To stop the last region started
nesmik_region_stop_last();

# To finalize
nesmik_finalize();

Fortran API

For the Fortran API we rely on the compiler generated module. When using CMake it automagically should work, if you write Makefiles from hand, point your compiler to the nesmik installation to retrieve the nesmik.mod file.

Fortran module files are not portable between compilers. If you want to use the Fortrans bindings, make sure you compile neSmiK with the SAME Fortran compiler, you want to compiler your application with.

! To use the module
use nesmik

! To initialize:
call nesmik_init

! The interface of the region start looks like:
subroutine nesmik_region_stop(name)
    character(len=*), intent(IN) :: name
end subroutine nesmik_region_stop

! To use it call:
call nesmik_region_start("yourregion")

! The interface of the region stop looks like:
subroutine nesmik_region_start(name)
    character(len=*), intent(IN) :: name
end subroutine nesmik_region_start

! To use it call:
call nesmik_region_stop("yourregion")

! To finalize
call nesmik_finalize()