7

With MPI3.0 neighborhood collective communications were introduced. And in 2 of them (MPI_NEIGHBOR_ALLTOALLW and MPI_INEIGHBOR_ALLTOALLW) displacements (sdispls and rdispls) are arrays of const MPI_Aint. Contrariwise of how the same, but collective, funcions (MPI_ALLTOALLW and MPI_ALLTOALLW) are defined -arrays of const int.

Also considering what the MPI Standard v3.0 says about MPI_Aint (page 16):

2.5.6 Addresses

Some MPI procedures use address arguments that represent an absolute address in the calling program. The datatype of such an argument is MPI_Aint in C and INTEGER (KIND=MPI_ADDRESS_KIND) in Fortran. These types must have the same width and encode address values in the same manner such that address values in one language may be passed directly to another language without conversion. There is the MPI constant MPI_BOTTOM to indicate the start of the address range.

I still don't get the point and, if exist, the difference (in addition that MPI_Aint can't be negative) between int and MPI_Aint!

4

1 回答 1

8

MPI_Aint是一种可移植的 C 数据类型,它可以保存内存地址,并且可能比通常的int. MPI 论坛的政策是不更改现有 MPI 调用的签名(因为它可能会破坏现有应用程序 - 请参见此处)。而是引入了取代旧呼叫的新呼叫。基本原理是int在 LP64 64 位架构流行之前运行良好,此时int不能再用于处理单个进程的整个虚拟地址空间。在这个实现之后,一些 MPI 调用在以后的版本中得到了新版本,使用MPI_Aintor MPI_Count(大整数类型)而不是int. 例如,MPI_Get_count_x取代MPI_Get_countMPI_Count使用int.

在这方面MPI_Alltoallw是一个旧调用(它来自 MPI-2.0),它保留了使用int偏移量的签名,而MPI_(I)Neighbor_alltoallw它是一个新调用(它来自 MPI-3.0),它使用地址类型以便能够使用数据位于(几乎)内存中的任何位置。

这同样适用于 Fortran 绑定。

于 2013-08-21T13:45:51.390 回答