用`接近`INT_MAX` count`值数据通信 [英] Communicate data with `count` value close to `INT_MAX`

查看:200
本文介绍了用`接近`INT_MAX` count`值数据通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

消息传递接口的API,总是用 INT 作为类型计数变量。例如,原型为 MPI_SEND 是:

The Message Passing Interface APIs always use int as a type for count variables. For instance, the prototype for MPI_Send is:

int MPI_Send(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);

这可能是一个问题,如果要发送或接收的元素个数的增长接近甚至有所超越 INT_MAX

This may be a problem if the number of elements to be sent or received grows near or even beyond INT_MAX.

当然,这个问题可能会得到解决降低的值数有两种方法:

Of course the issue may be solved lowering the value of count by either:


  1. 将单个呼叫到多个电话

  2. 定义的(不必要的)集合 MPI_Datatype

  1. splitting a single call into multiple calls
  2. defining an (unnecessary) aggregate MPI_Datatype

这两种方法都是好歹多了真正的解决方案的入侵,尤其是如果简单的试探法来实现。因此,我想问的是:

Both approaches are anyhow more an hack than a real solution, especially if implemented with simple heuristics. What I would like to ask is therefore:

是否有更好的成语来治疗这类标准MPI调用的情况下?如果没有,没有任何人知道周围MPI内置克服这种限制一些(固体)包装库的?

推荐答案

该MPI论坛的极不情愿来以介绍64位支持决策的MPI API的重大变化。其原因既保持向后兼容性,而不是引入很少使用的功能 - 它似乎是一个几乎一样蓬勃过程,保持Fortran的2XXX在与prehistoric FORTRAN IV程序兼容大一个

The MPI Forum is extremely reluctant to making major changes to the MPI API in order to introduce 64-bit support. The reason for that is both maintaining backward compatibility and not introducing seldom used features - it appears to be an almost as vigorous process as the one that keeps Fortran 2xxx at large compatible with prehistoric FORTRAN IV programs.

正如票明显,创造了大量的数据类型来解决限制甚至的威廉D. Gropp自己

As evident by the ticket, creating a large datatype to work around the limitation is actually viewed as not so hackish solution by many, even by William D. Gropp himself:

首先,有可能通过简单地创建一个适当的MPI数据类型发送更大的数据(这可能是更容易的,但它是可能的)。其次,发送这样大的数据将采取秒(至少!)在当前平台(8GB只为4字节的整数和2GB计数) - 所以这不应该是一个常用的操作(以及创建和提交和释放一个的开销数据类型可以忽略不计)。

First, it is possible to send much larger data by simply creating an appropriate MPI Datatype (this could be easier, but it is possible). Second, sending such large data will take seconds (at least!) on current platforms (8GB just for 4-byte integers and a 2GB count) - so this should not be a common operation (and the overhead of creating and committing and freeing a datatype should be negligible).

这是MPI-3.0引入了建设大型官方支持的事实(超过2 31 元素)数据类型而改变调用的count参数的建议如 MPI_SEND MPI_Count / INTEGER(KIND = MPI_COUNT_KIND)被拒绝应提示你的思维方式即prevails的MPI论坛。即使在MPI-3.0,64位内部尺寸都多年以来(例如,开放式MPI)所使用的一些实现,而其他人选择留在32位的行列(例如英特尔MPI)。

The fact that MPI-3.0 introduced official support for building large (more than 231 elements) datatypes while the proposal to change the count argument of calls like MPI_SEND to MPI_Count / INTEGER(KIND=MPI_COUNT_KIND) was rejected should hint you on the way of thinking that prevails the MPI Forum. Even before MPI-3.0, 64-bit internal sizes were used by some implementations since years (e.g. Open MPI) while others have chosen to remain on the 32-bit bandwagon (e.g. Intel MPI).

这篇关于用`接近`INT_MAX` count`值数据通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆