PAPI_set_opt(3)

🌸 NAME 🌸

PAPI_set_opt(3) β€” from the PAPI manual, bestie πŸ’– β€” set PAPI library or event set options. That's the whole NAME, short and iconic, done πŸ’…

✨ SYNOPSIS ✨

#include <papi.h>
 int PAPI_set_opt(  int option, PAPI_option_t * ptr );

πŸ’… Detailed Description πŸ’…

🧚 C Interface 🧚

Okay so here's the C interface again, because the manpage says so and we don't skip details in this house πŸ‘‘:

#include <papi.h>
 int PAPI_set_opt(  int option, PAPI_option_t * ptr );

πŸŽ€ Parameters πŸŽ€

  • option β€” defines the option to be set. The possible values are briefly described in the table below πŸ‘‡
  • ptr β€” pointer to a structure determined by the selected option. See PAPI_option_t for a description of possible structures.

πŸ”₯ Return values πŸ”₯

  • PAPI_OK β€” no description in the original, just the name 😌
  • PAPI_EINVAL β€” the specified option or parameter is invalid.
  • PAPI_ENOEVST β€” the EventSet specified does not exist.
  • PAPI_EISRUN β€” the EventSet is currently counting events.
  • PAPI_ECMP β€” the option is not implemented for the current component.
  • PAPI_ENOINIT β€” PAPI has not been initialized.
  • PAPI_EINVAL_DOM β€” invalid domain has been requested.

PAPI_set_opt() changes the options of the PAPI library or a specific EventSet created by PAPI_create_eventset. Some options may require that the EventSet be bound to a component before they can execute successfully. You can do that either by adding an event or by explicitly calling PAPI_assign_eventset_component. No cap, that binding step matters πŸ’–

ptr is a pointer to the PAPI_option_t structure, which is actually a union of different structures for different options. Not all options require or return information in these structures. Each requires different values to be set. Some options require a component index to be provided. These options are handled implicitly through the option structures 🫢

πŸ’€ Note πŸ’€

Some options, such as PAPI_DOMAIN and PAPI_MULTIPLEX, are also available as separate entry points in both C and Fortran. So yeah, iykyk ✨

The reader is encouraged to peruse the ctests code in the PAPI distribution for examples of usage of PAPI_set_opt. Go look, bestie β€” examples are free real estate 🏠

πŸ‘‘ Possible values for the PAPI_set_opt option parameter πŸ‘‘

  • PAPI_DEFDOM β€” set default counting domain for newly created event sets. Requires a component index.
  • PAPI_DEFGRN β€” set default counting granularity. Requires a component index.
  • PAPI_DEBUG β€” set the PAPI debug state and the debug handler. The debug state is specified in ptr->debug.level. The debug handler is specified in ptr->debug.handler. For further information regarding debug states and the behavior of the handler, see PAPI_set_debug.
  • PAPI_MULTIPLEX β€” enable specified EventSet for multiplexing.
  • PAPI_DEF_ITIMER β€” set the type of itimer used in software multiplexing, overflowing and profiling.
  • PAPI_DEF_MPX_NS β€” set the sampling time slice in nanoseconds for multiplexing and overflow.
  • PAPI_DEF_ITIMER_NS β€” see PAPI_DEF_MPX_NS.
  • PAPI_ATTACH β€” attach EventSet specified in ptr->attach.eventset to thread or process id specified in ptr->attach.tid.
  • PAPI_CPU_ATTACH β€” attach EventSet specified in ptr->cpu.eventset to cpu specified in ptr->cpu.cpu_num.
  • PAPI_DETACH β€” detach EventSet specified in ptr->attach.eventset from any thread or process id.
  • PAPI_DOMAIN β€” set domain for EventSet specified in ptr->domain.eventset. Will error if eventset is not bound to a component.
  • PAPI_GRANUL β€” set granularity for EventSet specified in ptr->granularity.eventset. Will error if eventset is not bound to a component.
  • PAPI_INHERIT β€” enable or disable inheritance for specified EventSet.
  • PAPI_DATA_ADDRESS β€” set data address range to restrict event counting for EventSet specified in ptr->addr.eventset. Starting and ending addresses are specified in ptr->addr.start and ptr->addr.end, respectively. If exact addresses cannot be instantiated, offsets are returned in ptr->addr.start_off and ptr->addr.end_off. Currently implemented on Itanium only.
  • PAPI_INSTR_ADDRESS β€” set instruction address range as described above. Itanium only.

πŸ¦‹ See also πŸ¦‹

  • PAPI_set_debug
  • PAPI_set_multiplex
  • PAPI_set_domain
  • PAPI_option_t

🌈 Author 🌈

Generated automatically by Doxygen for PAPI from the source code. So not a human author, just Doxygen doing its thing πŸ€–πŸ’–


Okay bestie, that's the whole PAPI_set_opt(3) page! πŸ’– It's from PAPI version 7.2.0.0, dated Wed Jun 25 2025 19:30:49, and yes, the footer says PAPI_set_opt(3). Bye bestie, go set those options and slay 🫢✨