I'm trying to gather network performance counter data on a BG/Q system with a BG Torus interconnect. I'm using PAPI as this seems to be the most recommended way of doing it, with the other option being the bgpm library, which I don't think is installed on this system. (locate bgpm
didn't give me anything.)
I'm trying to get the names for all the counters available on the system. so I run papi_native_avail
, which returns a bunch of events. For example, here is an excerpt from the net category:
...
--------------------------------------------------------------------------------
| net:::ib0:rx:bytes |
| ib0 receive bytes |
--------------------------------------------------------------------------------
| net:::ib0:rx:packets |
| ib0 receive packets |
--------------------------------------------------------------------------------
| net:::ib0:rx:errors |
| ib0 receive errors |
--------------------------------------------------------------------------------
...
papi_native_avail
segfaults but I don't think that is relevant.
So my understanding at this point is that I should be able to use an event name and get an event code from it using PAPI_event_name_to_code()
, but this doesn't seem to work. I'm guessing these aren't the event names that that function expects. So can someone explain:
Where can I find all network events for BG/Q?
How do I get the codes for those events?
For completeness, here is my code and the output:
#include <stdio.h>
#include <papi.h>
int main(){
int code = 0;
int ret = 0;
PAPI_library_init(PAPI_VER_CURRENT);
ret = PAPI_event_name_to_code("net:::ib0:tx:fifo", &code);
if(ret != PAPI_OK){
printf("Error in getting code\n");
}
printf("code: %d\n", code);
}
Output:
Error in getting code
code: 0