3

我正在尝试使用 BG Torus 互连在 BG/Q 系统上收集网络性能计数器数据。我正在使用 PAPI,因为这似乎是最推荐的方式,另一个选项是 bgpm 库,我认为该系统上没有安装它。(locate bgpm什么都没给我。)

我正在尝试获取系统上所有可用计数器的名称。所以我运行papi_native_avail,它返回一堆事件。例如,以下是网络类别的摘录:

...
--------------------------------------------------------------------------------
| net:::ib0:rx:bytes                                                           |
|            ib0 receive bytes                                                 |
--------------------------------------------------------------------------------
| net:::ib0:rx:packets                                                         |
|            ib0 receive packets                                               |
--------------------------------------------------------------------------------
| net:::ib0:rx:errors                                                          |
|            ib0 receive errors                                                |
--------------------------------------------------------------------------------
...

papi_native_avail段错误,但我认为这无关紧要。

所以我在这一点上的理解是我应该能够使用事件名称并从中获取事件代码PAPI_event_name_to_code(),但这似乎不起作用。我猜这些不是该函数所期望的事件名称。所以有人可以解释一下:

  1. 我在哪里可以找到 BG/Q 的所有网络活动?

  2. 我如何获得这些事件的代码?

为了完整起见,这是我的代码和输出:

#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);
}

输出:

Error in getting code
code: 0
4

0 回答 0