PAPIf_hl_region_begin(3)
π PAPIf_hl_region_begin(3) β the PAPI manual, bestie edition π
okay so this one's from the PAPI manual (that's section 3, the library-calls girlies π
) and it's literally the "start recording" button for your Fortran code. no cap.
β¨ NAME β¨
PAPIf_hl_region_begin β reads and stores hardware events at the beginning of an instrumented code region. that's the whole vibe π
πΈ SYNOPSIS πΈ
Detailed Description
Fortran Prototype:
#include 'fpapi.h'
PAPIf_hl_region_begin( C_STRING region, C_INT check )
π Return values
PAPI_OKβ we slayed, it worked β¨PAPI_ENOTRUNβ EventSet is currently not running or could not determined.PAPI_ESYSβ a system or C library call failed inside PAPI, see theerrnovariable.PAPI_EMISCβ PAPI has been deactivated due to previous erros.PAPI_ENOMEMβ insufficient memory π
So here's the tea π: PAPIf_hl_region_begin reads hardware events and stores them internally at the beginning of an instrumented code region. If you don't specify anything via the environment variable PAPI_EVENTS, default events are used. the first call sets all counters implicitly to zero and starts counting β main character energy, honestly. and heads up: if PAPI_EVENTS is not set or cannot be interpreted, default hardware events are recorded. no cap.
π«Ά bestie reminder: the counters get zeroed implicitly on that first call, so don't come for me if your numbers start at zero β that's literally the design.
π¦ Example π¦
export PAPI_EVENTS="PAPI_TOT_INS,PAPI_TOT_CYC"
integer retval
call PAPIf_hl_region_begin("computation", retval)
if ( retval .NE. PAPI_OK ) then
write (*,*) "PAPIf_hl_region_begin failed!"
end if
!do some computation here
call PAPIf_hl_region_end("computation", retval)
if ( retval .NE. PAPI_OK ) then
write (*,*) "PAPIf_hl_region_end failed!"
end if
look at that matching begin/end pair β the way that it's giving balanced brackets π iconic. also not me checking retval .NE. PAPI_OK both times, because the vibe check on errors is mandatory π
π See also
PAPI_hl_region_begin
π§ Author
Generated automatically by Doxygen for PAPI from the source code. (yes bestie, a robot wrote it, and it still ate π )
π Version 7.2.0.0 β Wed Jun 25 2025 19:30:49 β that's the footer, babes. go instrument something iconic. periodt π
π¦ where this page comes from
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- ubuntu resolute: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- ubuntu stonking: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms