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

CONTENTS

Synopsis
Description
Arguments
Return Values
Errors
Examples
Authors
Bugs
See Also

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) 

PAPIF_set_multiplex(C_INT EventSet) 

DESCRIPTION

PAPI_get_multiplex Returns 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 eventset 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)

RETURN VALUES

PAPI_get_multiplex returns either TRUE (non-zero) or FALSE (zero).

On success, PAPI_get_multiplex returns PAPI_OK .
On error, a non-zero error code is returned.

ERRORS

PAPI_EINVAL
  One or more of the arguments is invalid.
PAPI_ENOEVST
  The EventSet specified does not exist.
PAPI_EISRUN
  The EventSet is currently counting events.

EXAMPLES


  int retval, i, EventSet = PAPI_NULL, max_to_add = 6, j = 0;
  long_long *values;
  PAPI_event_info_t pset;

/* Initialize the library */

retval = PAPI_library_init(PAPI_VER_CURRENT); if (retval != PAPI_VER_CURRENT) handle_error(1);

if (PAPI_multiplex_init() != PAPI_OK) handle_error(1); if (PAPI_create_eventset(&EventSet) != PAPI_OK) handle_error(1);

if (PAPI_get_multiplex(EventSet) != 0) handle_error(1);

if (PAPI_set_multiplex(EventSet) != PAPI_OK) handle_error(1);

if (PAPI_get_multiplex(EventSet) == 0) handle_error(1);

for (i = 0; i < PAPI_MAX_PRESET_EVENTS; i++) { retval = PAPI_get_event_info(i | PRESET_MASK, &pset); if (retval != PAPI_OK) test_fail(__FILE__, __LINE__, "PAPI_get_event_info", retval);

if ((pset.count) && (pset.event_code != PAPI_TOT_CYC)) { if (!TESTS_QUIET) printf("Adding %s0, pset.symbol);

retval = PAPI_add_event(EventSet, pset.event_code); if ((retval != PAPI_OK) && (retval != PAPI_ECNFLCT)) test_fail(__FILE__, __LINE__, "PAPI_add_event", retval);

if (!TESTS_QUIET) { if (retval == PAPI_OK) printf("Added %s0, pset.symbol); else printf("Could not add %s0, pset.symbol); }

if (retval == PAPI_OK) { if (++j >= max_to_add) break; } } }

values = (long_long *)malloc(max_to_add*sizeof(long_long)); if (values == NULL) handle_error(1);

if (PAPI_start(EventSet) != PAPI_OK) handle_error(1);

AUTHORS

The PAPI Team. See them at the PAPI Web Site: http://icl.cs.utk.edu/projects/papi

BUGS

This function has no known bugs.

SEE ALSO

PAPI_multiplex_init (3), PAPI_set_opt (3)


PAPI Programmer’s Reference PAPI_set_multiplex (3) November, 2003

  Innovative Computing Laboratory
2001 R&D Winner  
Contact PAPI: papi@cs.utk.edu Computer Science Department
  University of Tennessee