1PAPI_destroy_eventset(3)             PAPI             PAPI_destroy_eventset(3)
2
3
4

NAME

6       PAPI_destroy_eventset,  PAPI_cleanup_eventset   -  empty and destroy an
7       EventSet
8
9

SYNOPSIS

11       C Interface
12       #include <papi.h>
13       int PAPI_cleanup_eventset(int EventSet);
14       int PAPI_destroy_eventset(int *EventSet);
15       Fortran Interface
16       #include fpapi.h
17       PAPIF_cleanup_eventset(C_INT EventSet, C_INT check)
18       PAPIF_destroy_eventset(C_INT EventSet, C_INT check)
19
20

DESCRIPTION

22       PAPI_cleanup_eventset() removes all events from a PAPI  event  set  and
23       turns  off  profiling and overflow for all events in the eventset. This
24       can not be called if the EventSet is not stopped.
25
26       PAPI_destroy_eventset() deallocates the memory associated with an empty
27       PAPI event set.
28
29

ARGUMENTS

31       EventSet  --   an  integer  handle  for  a PAPI event set as created by
32       PAPI_create_eventset(3).
33
34       *EventSet --  a pointer to the integer handle for a PAPI event  set  as
35       created  by  PAPI_create_eventset(3).  The value pointed to by EventSet
36       is then set to PAPI_NULL on success.
37
38

RETURN VALUES

40        On success, this function returns PAPI_OK.
41        On error, a non-zero error code is returned.
42
43

ERRORS

45       PAPI_EINVAL
46              One or more of the arguments is invalid. Attempting to destroy a
47              non-empty  event  set  or  passing  in  a  null  pointer  to  be
48              destroyed.
49
50       PAPI_ENOEVST
51              The EventSet specified does not exist.
52
53       PAPI_EISRUN
54              The EventSet is currently counting events.
55
56       PAPI_EBUG
57              Internal error, send mail to ptools-perfapi@ptools.org and  com‐
58              plain.
59
60

EXAMPLES

62       /* Remove all events in the eventset */
63
64       if (PAPI_cleanup_eventset(EventSet) != PAPI_OK)
65         handle_error(1);
66
67       /* Free all memory and data structures, EventSet must be empty. */
68
69       if (PAPI_destroy_eventset(&EventSet) != PAPI_OK)
70         handle_error(1);
71
72

BUGS

74       If  the user has set profile on an event with the PAPI_profil (3) call,
75       then when destroying the EventSet the memory allocated  by  PAPI_profil
76       (3) will not be freed. The user should turn off profiling on the Events
77       before destroying the EventSet to prevent this behavior.
78
79

SEE ALSO

81       PAPI_create_eventset(3),  PAPI_add_event(3),  PAPI_stop(3),   PAPI_pro‐
82       fil(3)
83
84
85
86PAPI Programmer's Reference     September, 2004       PAPI_destroy_eventset(3)
Impressum