PAPI_library_init(3)

πŸ’– PAPI_library_init(3) β€” from the PAPI manual, bestie πŸ’–

🌟 NAME 🌟

PAPI_library_init β€” initialize the PAPI library. That's the whole assignment, and honestly? iconic. πŸ‘‘

✨ SYNOPSIS ✨

okay so this page's synopsis is short and sweet: it hands you straight to the Detailed Description below. No extra signature line, just the full tea. πŸ“

πŸ¦‹ Detailed Description πŸ¦‹

πŸŽ€ Parameters πŸŽ€

  • version β€” upon initialization, PAPI checks the argument against the internal value of PAPI_VER_CURRENT when the library was compiled. This guards against portability problems when updating the PAPI shared libraries on your system. πŸ›‘οΈ

πŸŽ€ Return values πŸŽ€

  • PAPI_EINVAL β€” papi.h is different from the version used to compile the PAPI library.
  • PAPI_ENOMEM β€” insufficient memory to complete the operation.
  • PAPI_ECMP β€” this component does not support the underlying hardware.
  • PAPI_ESYS β€” a system or C library call failed inside PAPI, see the errno variable.

PAPI_library_init() initializes the PAPI library. PAPI_is_initialized() does the check for initialization. It must be called before any low level PAPI functions can be used.

🚨 thread bestie check: if your application is making use of threads, PAPI_thread_init must also be called prior to making any calls to the library other than PAPI_library_init().

🧚 Examples 🧚

okay bestie, here's the exact code from the page β€” copy it verbatim, no improvising:

           int retval;
           retval = PAPI_library_init(PAPI_VER_CURRENT);
           if (retval != PAPI_VER_CURRENT && retval > 0) {
               fprintf(stderr,"PAPI library version mismatch!\en");
               exit(1); }
           if (retval < 0)
               handle_error(retval);
           retval = PAPI_is_initialized();
           if (retval != PAPI_LOW_LEVEL_INITED)
               handle_error(retval)

🌈 See also 🌈

  • PAPI_thread_init
  • PAPI

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for PAPI from the source code.


πŸ’– Footer check: PAPI manual version 7.2.0.0, dated Wed Jun 25 2025 19:30:48, page PAPI_library_init(3). Bye bestie, mwah! πŸ’–