此文件是一个顶层便捷头文件,包含了 Boost.MPI 库的所有头文件。关注编译时间的开发者可能希望只包含 Boost.MPI 库中的特定头文件。
此头文件提供了一个符合 STL 标准的分配器,该分配器使用了 MPI-2 的内存分配机制。
namespace boost { namespace mpi { template<typename T> class allocator; template<> class allocator<void>; template<typename T1, typename T2> bool operator==(const allocator< T1 > &, const allocator< T2 > &); template<typename T1, typename T2> bool operator!=(const allocator< T1 > &, const allocator< T2 > &); } }
此头文件定义了支持具有笛卡尔拓扑的 MPI 通信器的设施。如果已知编译时网格的维度,则可以通过模板化的通信器类静态强制执行。否则,将提供一个非模板的、动态的基类。
namespace boost { namespace mpi { class cartesian_communicator; struct cartesian_dimension; class cartesian_topology; template<> struct is_mpi_datatype<cartesian_dimension>; // Test if the dimensions values are identical. bool operator==(cartesian_dimension const & d1, cartesian_dimension const & d2); // Test if the dimension values are different. bool operator!=(cartesian_dimension const & d1, cartesian_dimension const & d2); // Pretty printing of a cartesian dimension (size, periodic) std::ostream & operator<<(std::ostream & out, cartesian_dimension const & d); bool operator==(cartesian_topology const & t1, cartesian_topology const & t2); bool operator!=(cartesian_topology const & t1, cartesian_topology const & t2); // Pretty printing of a cartesian topology. std::ostream & operator<<(std::ostream & out, cartesian_topology const & t); std::vector< int > & cartesian_dimensions(int, std::vector< int > &); } }
此头文件包含 MPI 集合通信操作,这些操作实现了各种需要通信器内所有进程协调的并行算法。头文件 collectives_fwd.hpp
提供了这些操作的每个操作的前向声明。要仅包含特定的集合算法,请使用头文件 boost/mpi/collectives/algorithm_name.hpp
。
namespace boost { namespace mpi { template<typename T> void all_gather(const communicator &, const T &, std::vector< T > &); template<typename T> void all_gather(const communicator &, const T &, T *); template<typename T> void all_gather(const communicator &, const T *, int, std::vector< T > &); template<typename T> void all_gather(const communicator &, const T *, int, T *); template<typename T, typename Op> void all_reduce(const communicator &, const T *, int, T *, Op); template<typename T, typename Op> void all_reduce(const communicator &, const T &, T &, Op); template<typename T, typename Op> T all_reduce(const communicator &, const T &, Op); template<typename T, typename Op> void all_reduce(const communicator &, inplace_t< T * >, int, Op); template<typename T, typename Op> void all_reduce(const communicator &, inplace_t< T >, Op); template<typename T> void all_to_all(const communicator &, const std::vector< T > &, std::vector< T > &); template<typename T> void all_to_all(const communicator &, const T *, T *); template<typename T> void all_to_all(const communicator &, const std::vector< T > &, int, std::vector< T > &); template<typename T> void all_to_all(const communicator &, const T *, int, T *); template<typename T> void broadcast(const communicator &, T &, int); template<typename T> void broadcast(const communicator &, T *, int, int); template<typename T> void broadcast(const communicator &, skeleton_proxy< T > &, int); template<typename T> void broadcast(const communicator &, const skeleton_proxy< T > &, int); template<typename T> void gather(const communicator &, const T &, std::vector< T > &, int); template<typename T> void gather(const communicator &, const T &, T *, int); template<typename T> void gather(const communicator &, const T &, int); template<typename T> void gather(const communicator &, const T *, int, std::vector< T > &, int); template<typename T> void gather(const communicator &, const T *, int, T *, int); template<typename T> void gather(const communicator &, const T *, int, int); template<typename T> void gatherv(const communicator &, const std::vector< T > &, T *, const std::vector< int > &, const std::vector< int > &, int); template<typename T> void gatherv(const communicator &, const T *, int, T *, const std::vector< int > &, const std::vector< int > &, int); template<typename T> void gatherv(const communicator &, const std::vector< T > &, int); template<typename T> void gatherv(const communicator &, const T *, int, int); template<typename T> void gatherv(const communicator &, const T *, int, T *, const std::vector< int > &, int); template<typename T> void gatherv(const communicator &, const std::vector< T > &, T *, const std::vector< int > &, int); template<typename T> void scatter(const communicator &, const std::vector< T > &, T &, int); template<typename T> void scatter(const communicator &, const T *, T &, int); template<typename T> void scatter(const communicator &, T &, int); template<typename T> void scatter(const communicator &, const std::vector< T > &, T *, int, int); template<typename T> void scatter(const communicator &, const T *, T *, int, int); template<typename T> void scatter(const communicator &, T *, int, int); template<typename T> void scatterv(const communicator &, const std::vector< T > &, const std::vector< int > &, const std::vector< int > &, T *, int, int); template<typename T> void scatterv(const communicator &, const T *, const std::vector< int > &, const std::vector< int > &, T *, int, int); template<typename T> void scatterv(const communicator &, T *, int, int); template<typename T> void scatterv(const communicator &, const T *, const std::vector< int > &, T *, int); template<typename T> void scatterv(const communicator &, const std::vector< T > &, const std::vector< int > &, T *, int); template<typename T, typename Op> void reduce(const communicator &, const T &, T &, Op, int); template<typename T, typename Op> void reduce(const communicator &, const T &, Op, int); template<typename T, typename Op> void reduce(const communicator &, const T *, int, T *, Op, int); template<typename T, typename Op> void reduce(const communicator &, const T *, int, Op, int); template<typename T, typename Op> void scan(const communicator &, const T &, T &, Op); template<typename T, typename Op> T scan(const communicator &, const T &, Op); template<typename T, typename Op> void scan(const communicator &, const T *, int, T *, Op); } }
此头文件提供了头文件 collectives.hpp
中所有集合操作的前向声明。
此头文件定义了 communicator
类,该类是 Boost.MPI 中所有通信的基础,并提供了点对点通信操作。
namespace boost { namespace mpi { class communicator; enum comm_create_kind; const int any_source; // A constant representing "any process.". const int any_tag; // A constant representing "any tag.". BOOST_MPI_DECL bool operator==(const communicator &, const communicator &); bool operator!=(const communicator &, const communicator &); } }
此头文件提供了 MPI 配置详细信息,这些信息公开了底层 MPI 实现的功能,并在 Windows 上提供了自动链接支持。
MPICH_IGNORE_CXX_SEEK OMPI_SKIP_MPICXX BOOST_MPI_HOMOGENEOUS BOOST_MPI_VERSION BOOST_MPI_SUBVERSION BOOST_MPI_CALLING_CONVENTION BOOST_MPI_BCAST_BOTTOM_WORKS_FINE BOOST_MPI_DECL
此头文件提供了从 C++ 类型到 MPI 数据类型的映射。
BOOST_IS_MPI_DATATYPE(T)
namespace boost { namespace mpi { template<typename T> struct is_mpi_builtin_datatype; template<typename T> struct is_mpi_byte_datatype; template<typename T> struct is_mpi_complex_datatype; template<typename T> struct is_mpi_datatype; template<typename T> struct is_mpi_floating_point_datatype; template<typename T> struct is_mpi_integer_datatype; template<typename T> struct is_mpi_logical_datatype; template<typename T> MPI_Datatype get_mpi_datatype(const T &); } }
此头文件提供了头文件 datatype.hpp
内容的前向声明。它主要供需要专门化 is_mpi_datatype
的用户定义 C++ 类使用。
namespace boost { namespace mpi { struct packed; template<typename T> MPI_Datatype get_mpi_datatype(); } }
此头文件提供了 environment
类,该类提供了初始化、最终化和查询 Boost MPI 环境状态的例程。
namespace boost { namespace mpi { class environment; namespace threading { enum level; std::ostream & operator<<(std::ostream &, level); std::istream & operator>>(std::istream &, level &); } } }
此头文件提供了报告 MPI 错误给用户的异常类,以及将 MPI 错误码转换为 Boost.MPI 异常的宏。
BOOST_MPI_CHECK_RESULT(MPIFunc, Args)
namespace boost { namespace mpi { class exception; } }
此头文件定义了支持具有图拓扑的 MPI 通信器的设施,使用了 Boost Graph Library 定义的图接口。人们可以构造一个拓扑由满足 Boost Graph Library 图概念要求的任何图描述的通信器。同样,任何具有图拓扑的通信器都可以被 Boost Graph Library 看作是一个图,从而允许人们对进程拓扑使用 BGL 的图算法。
namespace boost { template<> struct graph_traits<mpi::graph_communicator>; namespace mpi { class graph_communicator; // Returns the source vertex from an edge in the graph topology of a communicator. int source(const std::pair< int, int > & edge, const graph_communicator &); // Returns the target vertex from an edge in the graph topology of a communicator. int target(const std::pair< int, int > & edge, const graph_communicator &); // Returns an iterator range containing all of the edges outgoing from the given vertex in a graph topology of a communicator. unspecified out_edges(int vertex, const graph_communicator & comm); // Returns the out-degree of a vertex in the graph topology of a communicator. int out_degree(int vertex, const graph_communicator & comm); // Returns an iterator range containing all of the neighbors of the given vertex in the communicator's graph topology. unspecified adjacent_vertices(int vertex, const graph_communicator & comm); // Returns an iterator range that contains all of the vertices with the communicator's graph topology, i.e., all of the process ranks in the communicator. std::pair< counting_iterator< int >, counting_iterator< int > > vertices(const graph_communicator & comm); // Returns the number of vertices within the graph topology of the communicator, i.e., the number of processes in the communicator. int num_vertices(const graph_communicator & comm); // Returns an iterator range that contains all of the edges with the communicator's graph topology. unspecified edges(const graph_communicator & comm); // Returns the number of edges in the communicator's graph topology. int num_edges(const graph_communicator & comm); identity_property_map get(vertex_index_t, const graph_communicator &); int get(vertex_index_t, const graph_communicator &, int); } }
此头文件定义了 group
类,该类允许操作和查询进程组。
namespace boost { namespace mpi { class group; BOOST_MPI_DECL bool operator==(const group &, const group &); bool operator!=(const group &, const group &); BOOST_MPI_DECL group operator|(const group &, const group &); BOOST_MPI_DECL group operator&(const group &, const group &); BOOST_MPI_DECL group operator-(const group &, const group &); } }
此头文件提供了辅助函数,用于指示 MPI 集合通信操作一个缓冲区既可以用作输入也可以用作输出。
namespace boost { namespace mpi { template<typename T> struct inplace_t; template<typename T> struct inplace_t<T *>; template<typename T> inplace_t< T > inplace(T &); template<typename T> inplace_t< T * > inplace(T *); } }
此头文件定义了 intercommunicator
类,该类允许在不同的进程组之间进行通信。
namespace boost { namespace mpi { class intercommunicator; } }
此头文件定义了用于完成非阻塞通信请求的操作。
namespace boost { namespace mpi { template<typename ForwardIterator> std::pair< status, ForwardIterator > wait_any(ForwardIterator, ForwardIterator); template<typename ForwardIterator> optional< std::pair< status, ForwardIterator > > test_any(ForwardIterator, ForwardIterator); template<typename ForwardIterator, typename OutputIterator> OutputIterator wait_all(ForwardIterator, ForwardIterator, OutputIterator); template<typename ForwardIterator> void wait_all(ForwardIterator, ForwardIterator); template<typename ForwardIterator, typename OutputIterator> optional< OutputIterator > test_all(ForwardIterator, ForwardIterator, OutputIterator); template<typename ForwardIterator> bool test_all(ForwardIterator, ForwardIterator); template<typename BidirectionalIterator, typename OutputIterator> std::pair< OutputIterator, BidirectionalIterator > wait_some(BidirectionalIterator, BidirectionalIterator, OutputIterator); template<typename BidirectionalIterator> BidirectionalIterator wait_some(BidirectionalIterator, BidirectionalIterator); template<typename BidirectionalIterator, typename OutputIterator> std::pair< OutputIterator, BidirectionalIterator > test_some(BidirectionalIterator, BidirectionalIterator, OutputIterator); template<typename BidirectionalIterator> BidirectionalIterator test_some(BidirectionalIterator, BidirectionalIterator); } }
此头文件提供了从函数对象到 MPI_Op
常量的映射,这些常量用于 MPI 集合通信操作。它还提供了几个在标准 <functional>
头文件中不存在的新的函数对象类型,它们可以直接映射到 MPI_Op
。
namespace boost { namespace mpi { template<typename T> struct bitwise_and; template<typename T> struct bitwise_or; template<typename T> struct bitwise_xor; template<typename Op, typename T> struct is_commutative; template<typename Op, typename T> struct is_mpi_op; template<typename T> struct logical_xor; template<typename T> struct maximum; template<typename T> struct minimum; } }
此头文件提供了使用 MPI_Pack
将可序列化数据类型打包到缓冲区中的设施。然后可以通过 MPI 传输这些缓冲区,之后可以通过 packed_oarchive.hpp
中的设施或 MPI_Unpack
进行解包。
namespace boost { namespace mpi { class packed_iarchive; typedef packed_iprimitive iprimitive; } }
此头文件提供了使用 MPI_Unpack
从缓冲区解包可序列化数据类型的设施。这些缓冲区通常通过 MPI 接收,并且已经通过 packed_iarchive.hpp
中的设施或 MPI_Pack
进行打包。
namespace boost { namespace mpi { class packed_oarchive; typedef packed_oprimitive oprimitive; } }
此头文件与 Boost.MPI 的 Python 绑定进行交互。此头文件中的例程可用于将用户定义和库定义的数据类型注册到 Boost.MPI 中,以实现高效的(反)序列化以及骨架和内容的单独传输。
namespace boost { namespace mpi { namespace python { template<typename T> void register_serialized(const T & = T(), PyTypeObject * = 0); template<typename T> void register_skeleton_and_content(const T & = T(), PyTypeObject * = 0); } } }
此头文件定义了 request
类,该类包含一个非阻塞通信请求。
namespace boost { namespace mpi { class request; } }
此头文件提供了允许将数据类型的结构(称为“骨架”)与这些数据类型中存储的内容分开传输和接收的设施。当数据存储在稳定的数据结构(例如网格或图)中需要反复传输时,这些设施非常有用。在这种情况下,仅传输一次骨架可以节省通信开销(无需再次发送)和本地计算(内容只需序列化一次)。
此头文件包含使用户能够单独传输数据结构骨架和数据结构内容所需的所有前向声明。要实际传输骨架或内容,请包含头文件 boost/mpi/skeleton_and_content.hpp
。
namespace boost { namespace mpi { template<typename T> struct skeleton_proxy; template<typename T> const skeleton_proxy< T > skeleton(T & x); template<typename T> const content get_content(const T & x); } }
此头文件定义了 status
类,该类报告点对点通信的结果。
namespace boost { namespace mpi { class status; } }
此头文件提供了 timer
类,该类提供了对 MPI 定时器的访问。
namespace boost { namespace mpi { class timer; } }