#define SLEEPTIME 2
program fmarkerapi
include "omp_lib.h"
INTEGER :: nr_events
DOUBLE PRECISION, DIMENSION(10) :: events
DOUBLE PRECISION :: time
INTEGER :: c
nr_events = 10
call likwid_markerinit()
call likwid_markerthreadinit()
call likwid_markerregisterregion("example")
print '(a,i0,a,i0,a)', "Thread ", omp_get_thread_num()," sleeps now for ", sleeptime," seconds"
call likwid_markerstartregion("example")
call sleep(sleeptime)
call likwid_markerstopregion("example")
print '(a,i0,a)', "Thread ", omp_get_thread_num()," wakes up again"
call likwid_markernextgroup();
call likwid_markergetregion("example", nr_events, events, time, c)
print '(a,i0,a,f9.3)', "Region example measures ", nr_events, " events, total measurement time is ", time
print '(a,i0,a)', "The region was called ", c, " times"
do i=1,nr_events
print '(a,i0,a,e13.7)', "Event ",i,": ",events(i)
end do
call likwid_markerclose()
end program fmarkerapi