PAPI 7.1.0.0
Loading...
Searching...
No Matches
papi_error_codes.c
Go to the documentation of this file.
1/*
2 * This utility loops through all the PAPI error codes and displays them in
3 * table format
4*/
5
31#include <stdio.h>
32
33#include "papi.h"
34
35int
36main( int argc, char **argv )
37{
38 int i=0;
39 int retval;
40
41 (void)argc;
42 (void)argv;
43
45 if (retval != PAPI_VER_CURRENT ) {
46 fprintf(stderr,"Error with PAPI_library_init!\n");
47 return retval;
48 }
49
50 printf( "\n----------------------------------\n" );
51 printf( "For PAPI Version: %d.%d.%d.%d\n",
56 printf( "----------------------------------\n" );
57 while ( 1 ) {
58 char *errstr;
59 errstr = PAPI_strerror( -i );
60
61 if ( NULL == errstr ) {
62 break;
63 }
64
65 printf( "Error code %4d: %s\n", -i, errstr );
66 i++;
67 }
68 printf( "There are %d error codes defined\n", i );
69 printf( "----------------------------------\n\n" );
70
71 return 0;
72}
int i
initialize the PAPI library.
Returns a string describing the PAPI error code.
#define PAPI_VER_CURRENT
Definition: f90papi.h:54
#define PAPI_VERSION
Definition: f90papi.h:193
Return codes and api definitions.
#define PAPI_VERSION_REVISION(x)
Definition: papi.h:221
#define PAPI_VERSION_MAJOR(x)
Definition: papi.h:219
#define PAPI_VERSION_INCREMENT(x)
Definition: papi.h:222
#define PAPI_VERSION_MINOR(x)
Definition: papi.h:220
FILE * stderr
int main()
Definition: pernode.c:20
int retval
Definition: zero_fork.c:53