PAPI  5.0.1.0
PAPI_hw_info.c File Reference
Include dependency graph for PAPI_hw_info.c:

Go to the source code of this file.

Functions

int main ()

Function Documentation

int main ( )

Definition at line 12 of file PAPI_hw_info.c.

{
   const PAPI_hw_info_t *hwinfo = NULL;
   int retval;
  
   /*************************************************************************** 
   *  This part initializes the library and compares the version number of the*
   * header file, to the version of the library, if these don't match then it *
   * is likely that PAPI won't work correctly.If there is an error, retval    *
   * keeps track of the version number.                                       *
   ***************************************************************************/


   if((retval = PAPI_library_init(PAPI_VER_CURRENT)) != PAPI_VER_CURRENT )
   {
      printf("Library initialization error! \n");
      exit(1);
   }
     
   /* Get hardware info*/      
   if ((hwinfo = PAPI_get_hardware_info()) == NULL)
   {
      printf("PAPI_get_hardware_info error! \n");
      exit(1);
   }
   /* when there is an error, PAPI_get_hardware_info returns NULL */


   printf("%d CPU  at %f Mhz.\n",hwinfo->totalcpus,hwinfo->mhz);
   printf(" model string is %s \n", hwinfo->model_string);

   /* clean up */ 
   PAPI_shutdown();

   exit(0);

}

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines