C Interface
#include <papi.h>
const PAPI_hw_info_t *PAPI_get_hardware_info(void);
Fortran Interface
#include fpapi.h
PAPIF_get_hardware_info(C_INT ncpu, C_INT nnodes,
C_INT totalcpus, C_INT vendor,
C_STRING vendor_string, C_INT model,
C_STRING model_string,
C_FLOAT revision, C_FLOAT mhz)
The following arguments are implicit in the structure returned by the C function,
or explicitly returned by Fortran.
ncpu -- number of CPUs in an SMP Node
nnodes -- number of Nodes in the entire system
totalcpus -- total number of CPUs in the entire system
vendor -- vendor id number of CPU
vendor_string -- vendor id string of CPU
model -- model number of CPU
model_string -- model string of CPU
revision -- Revision number of CPU
mhz -- Cycle time of this CPU; *may* be an estimate
generated at init time with a quick timing routine
const PAPI_hw_info_t *hwinfo = NULL;
if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
exit(1);
if ((hwinfo = PAPI_get_hardware_info()) == NULL)
exit(1);
printf("%d CPUs at %f Mhz.\n",hwinfo->totalcpus,hwinfo->mhz);