- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, because I would like to get the cache miss rate from PCM for each Query in the MonetDB system. There are two ways for me to do it. The first way is to insert the following code:
PCM *m = PCM::getInstance();
m->program (PCM::DEFAULT_EVENTS, NULL);
SystemCounterState before_sstate = getSystemCounterState();
To the monetdb System. However, since the monetdb is in c not c++. So I have to change the source code in PCM a lot...So I decide to get an executable file and call the executable file in my python script. So I add some functions in the cpucounters.h file and make sure I can get the value of a few counters each time and I plan to use them to calculate the cache miss/hit rate. The executable is generated from the following c file:
#include "/local/homes/bingyiloc/IntelPerformanceCounterMonitorV2.5.1/cpucounters.h"
using namespace std;
int
main(){
PCM *m = PCM::getInstance();
m->program (PCM::DEFAULT_EVENTS, NULL);
SystemCounterState before_sstate = getSystemCounterState();
cout << "get L2Miss"<<getL2Miss(before_sstate)<<endl;
cout << "get L2Re"<<getL2Ref(before_sstate)<<endl;
cout << "get L3Miss"<<getL3Miss(before_sstate)<<endl;
cout << "get L3UnsharedHit"<<getL3UnsharedHit(before_sstate)<<endl;
cout << "get L2HitM"<<getL2HitM(before_sstate)<<endl;
cout << "get L2Hit"<<getL2Hit(before_sstate)<<endl;
m->cleanup();
}
I would like to get the value of the parameter and then calculate it the same way in the getL2CacheMiss and etc function. Is that reasonable? Or everytime new the instance PCM is not a good way to calculate?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Patrick. I did the check it before it is normal. When I check it now, I always get the error code 2. It doesn't go way even when I reboot the machine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That would be a good start.
It is possible that something else is running which is using the PMU registers.
Pat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
have a look at:
http://software.intel.com/en-us/forums/topic/404048
Roman suggests that this is a feature and I think he refers to the fact someone may indeed be using PMU regs. If you know you are alone on the machine you can always try to run: "pcm.x "sleep 1" which will tell you that the PMU is busy and ask you if you want to reset. Answer "y" and then re-run your program. I also suggest that you also add an error printout and exit if the "m->program ()" call returns an error.
Rolf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you guys for the help. I solved the problem for the L2&L3 hit ratio. I have another question. Does PCM provide support to get the L1 cache hit/miss ratio? I googled and didn't get very much information. From the cpucounter.h and cpucounter.cpp file, I didn't see any performance counter for L1 cache hit/miss. Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I was able to run a couple of examples of using the PCM library in my custom code. However, there is a concern that I hope can be addressed: my understanding of using the PCM library inside a custom c/c++ code is to evaluate the custom code's measurements such as L2 cache misses, bytes read/written to MC and so on. Is this correct? The reason why I am asking is because I have a piece of code that does 2 calls to getSystemCounterState() and in between these calls, there is no code. When I measure statistics such getBytesReadFromMC(), I get a non-zero value when I expect a zero value because there is no activity happening between these calls to measure. What does the non-zero value indicate?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe between those two calls your thread was swapped out and another thread was scheduled to run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the memory controller counters are shared by many cores in the system. These cores are issuing memory operations while your thread is not doing anything. Also PCM API calls (like getSystemCounterState) are performing some small number of memory operations themselves (a measurement overhead).
Thanks,
Roman
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »