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

Returns a string describing the PAPI error code. More...

Detailed Description

C Interface:
#include <papi.h>
char * PAPI_strerror( int errorCode );
Parameters
[in]code
– the error code to interpret
Return values
*error– a pointer to the error string.
NULL– the input error code to PAPI_strerror() is invalid.

PAPI_strerror() returns a pointer to the error message corresponding to the error code code. If the call fails the function returns the NULL pointer. This function is not implemented in Fortran.

Example:
int ret;
int native = 0x0;
char error_str[PAPI_MAX_STR_LEN];
if (ret != PAPI_OK)
{
fprintf(stderr, "PAPI error %d: %s\n", ret, PAPI_strerror(retval));
exit(1);
}
// Add Total Instructions Executed to our EventSet
if (ret != PAPI_OK)
{
PAPI_perror( "PAPI_add_event");
fprintf(stderr,"PAPI_error %d: %s\n", ret, error_str);
exit(1);
}
// Start counting
if (ret != PAPI_OK) handle_error(ret);
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
Produces a string on standard error, describing the last library error.
Start counting hardware events in an event set.
Returns a string describing the PAPI error code.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_NULL
Definition: f90papi.h:78
#define PAPI_MAX_STR_LEN
Definition: f90papi.h:77
#define PAPI_TOT_INS
Definition: f90papi.h:317
static int EventSet
Definition: init_fini.c:8
FILE * stderr
static int native
int retval
Definition: zero_fork.c:53
See also
PAPI_perror PAPI_set_opt PAPI_get_opt PAPI_shutdown PAPI_set_debug

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