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
来收集值。
参数 |
|