MPI同步时序

时间:2013-09-26 19:38:35

标签: mpi timing

基本上我需要一个函数在所有节点上以相同的物理时间返回相同的值。我最初使用gettimeofday,但不确定它是否会在不同节点之间进行同步计时。

现在我正在考虑使用MPI_Wtime。首先,我在运行MPI任务时检查了MPI_WTIME_IS_GLOBAL值,因为手册说明了

The value returned for MPI_WTIME_IS_GLOBAL is 1 if clocks MPI_WTIME_IS_GLOBAL at all processes in MPI_COMM_WORLD are synchronized, 0 otherwise. 

我的MPI运行返回3而不是1或0.我不确定在我的MPI运行中返回的“3”意味着什么?

BTW,手册也说:

The boolean variable MPI_WTIME_IS_GLOBAL, a predefined attribute key that indicates whether clocks are synchronized, does not have a valid value in Open MPI, as the clocks are not guaranteed to be synchronized.

但我实际上使用的是OpenMPI-1.7.2。这是否意味着我找不到与OpenMPI同步的计时方法?

1 个答案:

答案 0 :(得分:1)

来自OpenMPI(1.7.1)文档:

  

布尔变量MPI_WTIME_IS_GLOBAL,预定义的属性键   表示时钟是否同步,没有效果   Open MPI中的值,因为不保证时钟   同步。

我似乎不太可能将此功能从1.7.1更改为1.7.2,因此我怀疑您的问题的答案是否,OpenMPI不提供跨进程的同步时序。整数值3支持布尔变量没有有效值的想法。