NAME

PAPI_set_multiplex - convert a standard event set to a multiplexed event set

CONTENTS

Synopsis
Description
Arguments
Return Values
Errors
Examples
Author
Bugs
See Also

SYNOPSIS

C Interface

#include <papi.h> 

int PAPI_set_multiplex(int *EventSet); 

Fortran Interface

#include fpapi.h 

PAPIF_set_multiplex(C_INT EventSet) 

DESCRIPTION

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 -- a pointer to an integer handle for a PAPI event set as created by PAPI_create_eventset (3)

RETURN VALUES

On success, this function 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;
  const PAPI_preset_info_t *pset;

/* Initialize the library */

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

pset = PAPI_query_all_events_verbose(); if (pset == NULL) handle_error(1);

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

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

for (i=0;i<PAPI_MAX_PRESET_EVENTS;i++) { if ((pset->avail) && (pset->event_code != PAPI_TOT_CYC))         {          retval = ;          if (PAPI_add_event(&EventSet, pset->event_code) != PAPI_OK) handle_error(1);          if (++j >= max_to_add)          break;         }         pset++; }

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);

AUTHOR

Philip J. Mucci <mucci@cs.utk.edu>

BUGS

This function has no known bugs.

SEE ALSO

PAPI_multiplex_init (3), PAPI_set_opt (3),
The PAPI Web Site: http://icl.cs.utk.edu/projects/papi


PAPI Function Reference PAPI_set_multiplex (3) December, 2001

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