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.

00013 {
00014    const PAPI_hw_info_t *hwinfo = NULL;
00015    int retval;
00016   
00017    /*************************************************************************** 
00018    *  This part initializes the library and compares the version number of the*
00019    * header file, to the version of the library, if these don't match then it *
00020    * is likely that PAPI won't work correctly.If there is an error, retval    *
00021    * keeps track of the version number.                                       *
00022    ***************************************************************************/
00023 
00024 
00025    if((retval = PAPI_library_init(PAPI_VER_CURRENT)) != PAPI_VER_CURRENT )
00026    {
00027       printf("Library initialization error! \n");
00028       exit(1);
00029    }
00030      
00031    /* Get hardware info*/      
00032    if ((hwinfo = PAPI_get_hardware_info()) == NULL)
00033    {
00034       printf("PAPI_get_hardware_info error! \n");
00035       exit(1);
00036    }
00037    /* when there is an error, PAPI_get_hardware_info returns NULL */
00038 
00039 
00040    printf("%d CPU  at %f Mhz.\n",hwinfo->totalcpus,hwinfo->mhz);
00041    printf(" model string is %s \n", hwinfo->model_string);
00042 
00043    /* clean up */ 
00044    PAPI_shutdown();
00045 
00046    exit(0);
00047 
00048 }

Here is the call graph for this function:


Generated on 17 Nov 2016 for PAPI by  doxygen 1.6.1