PAPI 7.1.0.0
Loading...
Searching...
No Matches
PAPI_perror Class Reference

Produces a string on standard error, describing the last library error. More...

Detailed Description

C Interface:
#include <papi.h>
void PAPI_perror( const char *s );
Parameters
[in]s– Optional message to print before the string describing the last error message.

The routine PAPI_perror() produces a message on the standard error output, describing the last error encountered during a call to PAPI. If s is not NULL, s is printed, followed by a colon and a space. Then the error message and a new-line are printed.

Example:
int ret;
int native = 0x0;
if (ret != PAPI_OK)
{
fprintf(stderr, \"PAPI error %d: %s\\n\", ret, PAPI_strerror(retval));
exit(1);
}
// Add Total Instructions Executed to our EventSet
ret = PAPI_add_event(EventSet, PAPI_TOT_INS);
if (ret != PAPI_OK)
{
PAPI_perror( "PAPI_add_event" );
exit(1);
}
// Start counting
ret = PAPI_start(EventSet);
if (ret != PAPI_OK) handle_error(ret);
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_NULL
Definition: f90papi.h:78
static int EventSet
Definition: init_fini.c:8
FILE * stderr
static int native
See also
PAPI_strerror

The documentation for this class was generated from the following file: