切换到MPI_LONG_LONG_INT会崩溃
switching to MPI_LONG_LONG_INT crashes?
我有以下代码,"所有收集"的值从所有进程进入nbodiesPerProc
。
int nBodies = 10;
std::vector<int> nbodiesPerProc(m_processes);
int err = MPI_Allgather(&nBodies,1,MPI_INT,&nbodiesPerProc[0], 1, MPI_INT, m_comm);
ASSERTMPIERROR(err, "gather");
当我将代码更改为MPI_LONG_LONG_INT时,它开始崩溃:
std::size_t nBodies = 10;
static_assert( sizeof(std::size_t) == 8, "We send an 64bit integer");
std::vector<std::size_t> nbodiesPerProc(m_processes);
int err = MPI_Allgather(&nBodies,1,MPI_LONG_LONG_INT,&nbodiesPerProc[0]
,1, MPI_LONG_LONG_INT, m_comm);
ASSERTMPIERROR(err, "gather");
有人知道吗?我需要注册MPI_LONG_LONG_INT吗?
崩溃:
[zfmgpu:17069] Signal: Segmentation fault (11)
[zfmgpu:17069] Signal code: Address not mapped (1)
[zfmgpu:17069] Failing at address: 0x10
[zfmgpu:17070] *** Process received signal ***
[zfmgpu:17070] Signal: Segmentation fault (11)
[zfmgpu:17070] Signal code: Address not mapped (1)
[zfmgpu:17070] Failing at address: 0x18
[zfmgpu:17067] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fe4626a6340]
[zfmgpu:17067] [ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x981c0) [0x7fe4609641c0]
[zfmgpu:17067] [ 2] /usr/lib/libmpi.so.1(+0x10362d) [0x7fe46162d62d]
[zfmgpu:17067] [ 3] /usr/lib/libmpi.so.1(ompi_datatype_sndrcv+0x502) [0x7fe46158e392]
[zfmgpu:17067] [ 4] /usr/lib/openmpi/lib/openmpi/mca_coll_tuned.so(ompi_coll_tuned_allgather_intra_recursivedoubling+0x91) [0x7fe459aa0081]
[zfmgpu:17067] [ 5] /usr/lib/libmpi.so.1(PMPI_Allgather+0x179) [0x7fe46158f0c9]
Update:也MPI_UNSIGNED_LONG_LONG没有帮助,这将是正确的64位类型
发现错误:
m_processes was = 0
(愚蠢)
相关文章:
- "1L << count"是什么意思?如何使用超出"unsigned long long int? "范围的语句编号打印?
- 只读位置'__result.std::_Rb_tree_const_iterator<_Tp>::operator*<long long int>()'分配错误
- 错误:将"long int (*)[4]"分配给"long int [4][4]"时的类型不兼容
- 如何处理计算中的"unsigned long long int"?
- 为什么所有可能的整数都"true"在 C++ 的 if 语句内的 long int 范围内,而 0 不是?
- 为什么 int 到长 long int 的隐式转换在 C++ 中给出了意想不到的答案?
- C++为什么字符串的地址尽管是十六进制格式,但不能存储在 long int 变量中?
- "long int a=2"和"int a=2L"有什么区别?
- "long"和"long int"以及"long long"与"long long int"有什么区别
- map(long long int,long long int)不适用于key=1000 000 000(在long l
- C sqrt == long int
- 将函数从WCHAR_T数组转换为long int
- 性能从 'int' 显著降低到 'long int'
- 奇怪的并行循环行为 int v long int
- C++ Long Long INT - 64 位,此限制仅使用 64 位操作系统
- 二进制'operator%' 'long long int'类型的操作数无效
- long/int到UINT64的转换,并在C#上返回long-何时可以丢失数据
- "unsigned long int" c++ 中的最大值
- v[long long int] in C++
- C++ long long int