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 the errno variable.
  • 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 πŸ’œ