boost::mpi::gather — 将每个进程中存储的值收集到根进程的向量中。
// In header: <boost/mpi/collectives.hpp> template<typename T> void gather(const communicator & comm, const T & in_value, std::vector< T > & out_values, int root); template<typename T> void gather(const communicator & comm, const T & in_value, T * out_values, int root); template<typename T> void gather(const communicator & comm, const T & in_value, int root); template<typename T> void gather(const communicator & comm, const T * in_values, int n, std::vector< T > & out_values, int root); template<typename T> void gather(const communicator & comm, const T * in_values, int n, T * out_values, int root); template<typename T> void gather(const communicator & comm, const T * in_values, int n, int root);
gather
是一种集体算法,它将每个进程中存储的值收集到 root
进程的一个值向量中。 此向量通过值来自的进程号来索引。 值的类型 T
可以是任何可序列化类型或具有关联的 MPI 数据类型的类型。
当类型 T
具有关联的 MPI 数据类型时,此例程调用 MPI_Gather
来收集值。
参数 |
|