PAPI 7.1.0.0
Loading...
Searching...
No Matches
print_header.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int papi_print_header (char *prompt, const PAPI_hw_info_t **hwinfo)
 

Function Documentation

◆ papi_print_header()

int papi_print_header ( char *  prompt,
const PAPI_hw_info_t **  hwinfo 
)

Definition at line 12 of file print_header.c.

13{
14 int cnt, mpx;
15 struct utsname uname_info;
17
18 if ( ( *hwinfo = PAPI_get_hardware_info( ) ) == NULL ) {
19 return PAPI_ESYS;
20 }
21
23
24 uname(&uname_info);
25
26 printf( "%s", prompt );
27 printf
28 ( "--------------------------------------------------------------------------------\n" );
29 printf( "PAPI version : %d.%d.%d.%d\n",
34 printf( "Operating system : %s %s\n",
35 uname_info.sysname, uname_info.release);
36 printf( "Vendor string and code : %s (%d, 0x%x)\n",
37 ( *hwinfo )->vendor_string,
38 ( *hwinfo )->vendor,
39 ( *hwinfo )->vendor );
40 printf( "Model string and code : %s (%d, 0x%x)\n",
41 ( *hwinfo )->model_string,
42 ( *hwinfo )->model,
43 ( *hwinfo )->model );
44 printf( "CPU revision : %f\n", ( *hwinfo )->revision );
45 if ( ( *hwinfo )->cpuid_family > 0 ) {
46 printf( "CPUID : Family/Model/Stepping %d/%d/%d, "
47 "0x%02x/0x%02x/0x%02x\n",
48 ( *hwinfo )->cpuid_family,
49 ( *hwinfo )->cpuid_model,
50 ( *hwinfo )->cpuid_stepping,
51 ( *hwinfo )->cpuid_family,
52 ( *hwinfo )->cpuid_model,
53 ( *hwinfo )->cpuid_stepping );
54 }
55 printf( "CPU Max MHz : %d\n", ( *hwinfo )->cpu_max_mhz );
56 printf( "CPU Min MHz : %d\n", ( *hwinfo )->cpu_min_mhz );
57 printf( "Total cores : %d\n", ( *hwinfo )->totalcpus );
58
59 if ( ( *hwinfo )->threads > 0 )
60 printf( "SMT threads per core : %d\n", ( *hwinfo )->threads );
61 if ( ( *hwinfo )->cores > 0 )
62 printf( "Cores per socket : %d\n", ( *hwinfo )->cores );
63 if ( ( *hwinfo )->sockets > 0 )
64 printf( "Sockets : %d\n", ( *hwinfo )->sockets );
65 printf( "Cores per NUMA region : %d\n", ( *hwinfo )->ncpu );
66 printf( "NUMA regions : %d\n", ( *hwinfo )->nnodes );
67 printf( "Running in a VM : %s\n", ( *hwinfo )->virtualized?
68 "yes":"no");
69 if ( (*hwinfo)->virtualized) {
70 printf( "VM Vendor : %s\n", (*hwinfo)->virtual_vendor_string);
71 }
72 cnt = PAPI_get_opt( PAPI_MAX_HWCTRS, NULL );
73 mpx = PAPI_get_opt( PAPI_MAX_MPX_CTRS, NULL );
74 if ( cnt >= 0 ) {
75 printf( "Number Hardware Counters : %d\n",cnt );
76 } else {
77 printf( "Number Hardware Counters : PAPI error %d: %s\n", cnt, PAPI_strerror(cnt));
78 }
79 if ( mpx >= 0 ) {
80 printf( "Max Multiplex Counters : %d\n", mpx );
81 } else {
82 printf( "Max Multiplex Counters : PAPI error %d: %s\n", mpx, PAPI_strerror(mpx));
83 }
84 printf("Fast counter read (rdpmc): %s\n",
85 options.cmp_info->fast_counter_read?"yes":"no");
86 printf( "--------------------------------------------------------------------------------\n" );
87 printf( "\n" );
88 return PAPI_OK;
89}
get information about the system hardware
Get PAPI library or event set options.
Returns a string describing the PAPI error code.
#define PAPI_MAX_MPX_CTRS
Definition: f90papi.h:172
#define PAPI_VERSION
Definition: f90papi.h:193
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_ESYS
Definition: f90papi.h:136
#define PAPI_MAX_HWCTRS
Definition: f90papi.h:270
#define PAPI_COMPONENTINFO
Definition: f90papi.h:75
#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
static options_t options
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:843
Here is the caller graph for this function: