提升::MPI 1.53 就位all_reduce
boost::mpi 1.53 in place all_reduce
如何就地使用 1.53 boost::mpi
减少?(这是 CentOS 7 的版本(
Boost 1.61 有 boost::mpi::inplace_t
(doc(,但 boost 1.53 没有 (doc(。
对于 1.61,我可以使用:
boost::mpi::all_reduce(
comm,
boost::mpi::inplace_t<int*>(ptr_int_array),
n_elements,
op);
如果您不想有额外的out_value
字段,您可以通过设置为返回函数的值来覆盖in_value
。
#include <boost/mpi.hpp>
int main()
{
boost::mpi::environment env;
boost::mpi::communicator comm;
// set in_value to whatever you want.
int in_value = comm.rank()
// overwrite.
in_value = all_reduce(comm, in_value, std::plus<double>());
return 0;
}
相关文章:
- 为什么 std::reduce 需要交换性?
- 方法错误"not all control paths return a value"和方法不返回值
- 生成文件:6:目标'all'的配方在 Ubuntu-16.04 上失败
- 每次都会重建多个程序的制作文件,尽管配方"all"被标记为虚假
- 制造:对'all'错误无能为力
- 如何在数据库程序中添加"reduce the quantity of an item"功能?
- 为什么Eigen不能解析内置符号?(all、last、seq等)
- 无法编译 std::reduce 调用,而 std::累积调用编译相同的参数
- 警告"C++ requires a type specifier for all declaration"地图
- gcc -O2 比 gcc -O2 -g 小,后跟 strip --strip-all
- std::reduce 似乎将结果转换为整数
- 警告:"Not all control paths return a value" c++
- AVX2浮子比较并获得0.0或1.0,而不是all-0或全零件
- 链接时,"grab what you need" 和 "grab all" 之间是否有某些内容(-wl,--whole-archive)?
- Rcpp 中"List"的操作函数 - 类似于 R 中的"Reduce function"
- 在C++中向枚举添加"all"选项的好设计是什么?
- 级运算符 ( "C++ requires a type specifier for all declarations" )
- 如何使用-REDUCE -RECATIONS构建QT
- gradle see output for model.components.binaries.all
- std::reduce with std::unordered_map