Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fortran PAPIF_stop始终读取0_Fortran_Papi - Fatal编程技术网

Fortran PAPIF_stop始终读取0

Fortran PAPIF_stop始终读取0,fortran,papi,Fortran,Papi,我有一个用fortran编写的简单程序,它使用PAPI API读取性能计数器值。所有API(PAPI_启动、PAPI_停止等)均正常工作(表示返回PAPI_OK)。但是,PAPIF_stop读取的值始终为0。我在BG/Q上尝试了另一个评测软件,以确保这些值不应为0。你知道为什么会这样吗?这是我第一次尝试编写fortran代码。因此,这很可能是一个fortran问题,对我来说并不明显。谢谢你的帮助。 谢谢 --德 我从另一个函数调用这些子例程,如下所示: subroutine myfuncti

我有一个用fortran编写的简单程序,它使用PAPI API读取性能计数器值。所有API(PAPI_启动、PAPI_停止等)均正常工作(表示返回PAPI_OK)。但是,PAPIF_stop读取的值始终为0。我在BG/Q上尝试了另一个评测软件,以确保这些值不应为0。你知道为什么会这样吗?这是我第一次尝试编写fortran代码。因此,这很可能是一个fortran问题,对我来说并不明显。谢谢你的帮助。 谢谢 --德

我从另一个函数调用这些子例程,如下所示:

  subroutine myfunction

  integer event_set ! For papi
  integer*8 values(50) !For reading papi values
  call papi_lib_init  ! *Not shown, but is present and works. *
  call papi_add_events(event_set)

  do_flops()

  call papi_stop_counting(event_set, values)
  print *, 'Value 1: ', values(1)
  print *, 'Value 2: ', values(2)

  return
  end
我得到的结果是:

    Value 1:  0
    Value 2:  0


请先创建事件集

谢谢,是的,我已经做了。结果证明,我的代码是正确的。问题是我在BG/Q上使用了papi,并链接了BGPM(BlueGene Performance Monitoring)库。所以,在最后,Papi和BGPM都被启用了,而且他们彼此都不友好。我的代码在英特尔计算机上运行正常。谢谢你的帮助。
    Value 1:  0
    Value 2:  0