NAME

PAPI_get_hardware_info - get the info about the system hardware

CONTENTS

Synopsis
Description
Arguments
Return Values
Errors
Example
Author
Bugs
See Also

SYNOPSIS

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)

DESCRIPTION

In C, this function returns a pointer to a structure containing information about the hardware on which the program runs. In Fortran, the values of the structure are returned explicitly.

ARGUMENTS

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

RETURN VALUES

On success, the C function returns a non-NULL pointer, and the Fortran function returns PAPI_OK.
On error, NULL is returned by the C function, and a non-zero error code is returned by the Fortran function.

ERRORS

PAPI_EINVAL
  One or more of the arguments is invalid.

EXAMPLE


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 CPU’s at %f Mhz.\n",hwinfo->totalcpus,hwinfo->mhz);

AUTHOR

Philip J. Mucci <mucci@cs.utk.edu>

BUGS

If called before PAPI_library_init() the behavior of the routine is undefined.

SEE ALSO

PAPI_library_init (3), PAPI_get_opt (3),
The PAPI Web Site: http://icl.cs.utk.edu/projects/papi


PAPI Function Reference PAPI_get_hardware_info (3) December, 2001

  Innovative Computing Laboratory
2001 R&D Winner  
Contact PAPI: papi@cs.utk.edu Computer Science Department
  University of Tennessee