PAPI3:PAPI set multiplex.3
From PAPIDocs
(Redirected from PAPI3:PAPI get multiplex.3)
Jump to: navigation, search


Contents

NAME

  • PAPI_get_multiplex - get the multiplexing status of specified event set
  • PAPI_set_multiplex - convert a standard event set to a multiplexed event set

Synopsis

C Interface

#include <papi.h>
int PAPI_get_multiplex(int  EventSet );
int PAPI_set_multiplex(int  EventSet );

Fortran Interface

#include fpapi.h
PAPIF_get_multiplex(C_INT  EventSet,  C_INT  check )
PAPIF_set_multiplex(C_INT  EventSet,  C_INT  check )

Description

PAPI_get_multiplex tests the state of the PAPI_MULTIPLEXING flag in the specified event set, returning TRUE if a PAPI event set is multiplexed, or FALSE if not.

PAPI_set_multiplex converts a standard PAPI event set created by a call to PAPI_create_eventset() into an event set capable of handling multiplexed events. This must be done after calling PAPI_multiplex_init() , but prior to calling PAPI_start(). Events can be added to an event set either before or after converting it into a multiplexed set, but the conversion must be done prior to using it as a multiplexed set.

Arguments

EventSet -- an integer handle for a PAPI event set as created by PAPI_create_eventset (3)

Errors

PAPI_EINVAL One or more of the arguments is invalid, or the EventSet is already multiplexed.

PAPI_ENOEVST The EventSet specified does not exist.

PAPI_EISRUN The EventSet is currently counting events.

PAPI_ENOMEM Insufficient memory to complete the operation.

Examples

retval = PAPI_get_multiplex(EventSet);
if (retval > 0) printf("This event set is ready for multiplexing\n.")
if (retval == 0) printf("This event set is not enabled for multiplexing\n.")
if (retval < 0) handle_error(retval);
retval = PAPI_set_multiplex(EventSet);
if ((retval == PAPI_EINVAL) && (PAPI_get_multiplex(EventSet) > 0))
printf("This event set already has multiplexing enabled\n");
else if (retval != PAPI_OK) handle_error(retval);

Bugs

This function has no known bugs.

IBM POWER6 NOTES

The event set must have its domain set to PAPI_DOM_ALL or equivalently PAPI_DOM_USER | PAPI_DOM_KERNEL | PAPI_DOM_SUPERVISOR, otherwise a PAPI_ECNFLT error will result. This is due to the POWER6's cycle counting hardware being able to count only in this domain. For more details, see the IBM POWER6 NOTES in the PAPI_add_event (3) documentation.

See Also

PAPI_multiplex_init(3), PAPI_set_opt(3), PAPI_create_eventset(3)