|
  PAPI3:PAPI get dmem info.3
| |
ViewsFrom PAPIDocs
NAME
SynopsisC Interface #include <papi.h> int PAPI_get_dmem_info(PAPI_dmem_info_t * dmem ); Fortran Interface #include fpapi.h PAPIF_get_dmem_info(C_LONG_LONG(*) dmem, C_INT check ) DescriptionIn C, this function takes a pointer to a PAPI_dmem_info_t structure and returns with the structure fields filled in. In Fortran, this function takes a pointer to an array of long_long values and fills in the array on return. A value of PAPI_EINVAL in any field indicates an undefined parameter. Argumentsdmem -- Structure (C) or array (Fortran) containing the following values (Fortran values can be accessed using the specified indices): peak [PAPIF_DMEM_VMPEAK] (Peak size of process image, may be 0 on older Linux systems), size [PAPIF_DMEM_VMSIZE] (Size of process image), resident [PAPIF_DMEM_RESIDENT] (Resident set size), high_water_mark [PAPIF_DMEM_HIGH_WATER] (High water memory usage), shared [PAPIF_DMEM_SHARED] (Shared memory), text [PAPIF_DMEM_TEXT] (Memory allocated to code), library [PAPIF_DMEM_LIBRARY] (Memory allocated to libraries), heap [PAPIF_DMEM_HEAP] (Size of the heap), locked [PAPIF_DMEM_LOCKED] (Locked memory), stack [PAPIF_DMEM_STACK] (Size of the stack) pagesize [PAPIF_DMEM_PAGESIZE] (Size of a page in bytes), pte [PAPIF_DMEM_PTE] (Size of page table entries, may be 0 on older Linux systems) ErrorsPAPI_ESBSTR The funtion is not implemented for the current substrate. PAPI_EINVAL Any value in the structure or array may be undefined as indicated by this error value. PAPI_SYS A system error occured. BugsIf called before the behavior of the routine is undefined. NOTEThis function is currently implemented only for the Linux operating system. EXAMPLEint retval; PAPI_dmem_info_t dmem; if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT) exit(1); retval = PAPI_library_init(PAPI_VER_CURRENT); if (retval != PAPI_VER_CURRENT) handle_error(retval); PAPI_get_dmem_info(&dmem); printf("Peak Mem Size:\t\t%lld\n",dmem.peak); printf("Mem Size:\t\t%lld\n",dmem.size); printf("Mem Resident:\t\t%lld\n",dmem.resident); printf("Peak Resident:\t%lld\n",dmem.high_water_mark); printf("Mem Shared:\t\t%lld\n",dmem.shared); printf("Mem Text:\t\t%lld\n",dmem.text); printf("Mem Library:\t\t%lld\n",dmem.library); printf("Mem Heap:\t\t%lld\n",dmem.heap); printf("Mem Locked:\t\t%lld\n",dmem.locked); printf("Mem Stack:\t\t%lld\n",dmem.stack); printf("Mem Pagesize:\t\t%lld\n",dmem.pagesize); printf("Mem Page Eable Entries:\t\t%lld\n",dmem.pte); See AlsoPAPI_get_executable_info(3), PAPI_get_hardware_info(3), PAPI_get_opt(3), PAPI_library_init(3) |