Who can tell me how to use PAPI to get memory info?

Open discussion of PAPI.

Who can tell me how to use PAPI to get memory info?

Postby wan0573 » Thu Oct 03, 2013 8:49 am

I've installed papi 5.2.0. , but the c code didn't work!


#include<stdio.h>
#include<stdlib.h>
#include<papi.h>
int main(){
int 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);
}


wkm@wkm-X511EM:~/download/papi-5.2.0/src$ gcc -o mywork mywork.c papi.c
In file included from papi.c:30:0:
papi_internal.h:119:10: 错误: #include 需要 "FILENAME" 或 <FILENAME>
In file included from papi_internal.h:435:0,
from papi.c:30:
papi_lock.h:20:10: 错误: #include 需要 "FILENAME" 或 <FILENAME>
wan0573
 
Posts: 2
Joined: Thu Oct 03, 2013 3:52 am

Re: Who can tell me how to use PAPI to get memory info?

Postby solsys12 » Wed Feb 12, 2014 5:29 am

wan0573 wrote:I've installed papi 5.2.0. , but the c code didn't work!


Can u specify the file name you saved it? and the errors more specifically
solsys12
 
Posts: 5
Joined: Wed Feb 12, 2014 5:00 am


Return to General discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron