boost::mpi::all_gather — 收集每个进程存储的值,并将它们放入一个包含来自每个进程的值的向量中。
// In header: <boost/mpi/collectives.hpp> template<typename T> void all_gather(const communicator & comm, const T & in_value, std::vector< T > & out_values); template<typename T> void all_gather(const communicator & comm, const T & in_value, T * out_values); template<typename T> void all_gather(const communicator & comm, const T * in_values, int n, std::vector< T > & out_values); template<typename T> void all_gather(const communicator & comm, const T * in_values, int n, T * out_values);