- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
i am using mkl_peak_mem_usage to measure mkl memory usage and despite i use mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) , the counters are not zero. For example :
mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) ; // reset peak
printf( "memory peak : %lld\n", mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) ); // print peak and reset again
// do some calculations
printf( "memory peak : %lld\n", mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) ); // print new peak and reset
the first peak print is 45MB, the second peak print is 75MB and a custom calculation of memory needed in "do some calculations" is 75-45=30MB
my code is threaded using pthreads, and i also clear the mkl buffers using mkl_free_buffers and mkl_thread_free_buffers
i have initialized with mkl_peak_mem_usage(MKL_PEAK_MEM_ENABLE) at the start of my code
is there some error in mkl_peak_mem_usage or maybe i do something wrong?
Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Konstantinos, I am not sure understand what is the problem. Do you expect that the second time mkl_peak_mem_usage should return the same memory peak as a the first time? May be when you //do some calculation the second time, then this calculation required exactly 75 Mb of memory? you also can have a look at the example - MKLROOT/examples/servicefuncsc/source/servicefuncs.c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From what i understand the code should behave as :
mkl_peak_mem_usage(MKL_PEAK_MEM_ENABLE) ; // enable counting
// various lines of code with allocations, deallocations, threading etc
mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) ; // should reset counters
printf( "memory peak : %lld\n", mkl_peak_mem_usage(MKL_PEAK_MEM) ); // should print 0 (?)
// do some calculations (requires 30MB with a custom measure)
printf( "memory peak : %lld\n", mkl_peak_mem_usage(MKL_PEAK_MEM) ); // should print 30MB
// various lines of code with allocations, deallocations, threading etc
mkl_peak_mem_usage(MKL_PEAK_MEM_DISABLE); // disable counting
is this correct?
instead the output is :
1st print : 45MB
2nd print : 75MB
it is like the call to mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) does not reset peak memory to zero. If that is it's purpose of course.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page