1 .. Copyright (C) 2004-2009 The Trustees of Indiana University.
2 Use, modification and distribution is subject to the Boost Software
3 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
4 http://www.boost.org/LICENSE_1_0.txt)
6 ============================
7 |Logo| MPI BSP Process Group
8 ============================
15 The MPI ``mpi_process_group`` is an implementation of the `process
16 group`_ interface using the Message Passing Interface (MPI). It is the
17 primary process group used in the Parallel BGL at this time.
22 Header ``<boost/graph/distributed/mpi_process_group.hpp>``
29 namespace boost { namespace graph { namespace distributed {
31 class mpi_process_group
34 typedef boost::mpi::communicator communicator_type;
36 // Process group constructors
37 mpi_process_group(communicator_type comm = communicator_type());
38 mpi_process_group(std::size_t num_headers, std::size_t buffer_size,
39 communicator_type comm = communicator_type());
42 mpi_process_group(const mpi_process_group&, boost::parallel::attach_distributed_object);
45 template<typename Type, typename Handler>
46 void trigger(int tag, const Handler& handler);
48 template<typename Type, typename Handler>
49 void trigger_with_reply(int tag, const Handler& handler);
51 trigger_receive_context trigger_context() const;
55 mpi_process_group base() const;
59 int process_id(const mpi_process_group&);
60 int num_processes(const mpi_process_group&);
62 // Message transmission
64 void send(const mpi_process_group& pg, int dest, int tag, const T& value);
67 void receive(const mpi_process_group& pg, int source, int tag, T& value);
69 optional<std::pair<int, int> > probe(const mpi_process_group& pg);
72 void synchronize(const mpi_process_group& pg);
74 // Out-of-band communication
76 void send_oob(const mpi_process_group& pg, int dest, int tag, const T& value);
78 template<typename T, typename U>
80 send_oob_with_reply(const mpi_process_group& pg, int dest, int
81 tag, const T& send_value, U& receive_value);
84 void receive_oob(const mpi_process_group& pg, int source, int tag, T& value);
88 Since the ``mpi_process_group`` is an implementation of the `process
89 group`_ interface, we omit the description of most of the functions in
90 the prototype. Two constructors need special mentioning:
94 mpi_process_group(communicator_type comm = communicator_type());
96 The constructor can take an optional MPI communicator. As default a communicator
97 constructed from MPI_COMM_WORLD is used.
101 mpi_process_group(std::size_t num_headers, std::size_t buffer_size,
102 communicator_type comm = communicator_type());
105 For performance fine tuning the maximum number of headers in a message batch
106 (num_headers) and the maximum combined size of batched messages (buffer_size)
107 can be specified. The maximum message size of a batch is
108 16*num_headers+buffer_size. Sensible default values have been found by optimizing
109 a typical application on a cluster with Ethernet network, and are num_header=64k
110 and buffer_size=1MB, for a total maximum batches message size of 2MB.
114 -----------------------------------------------------------------------------
116 Copyright (C) 2007 Douglas Gregor
118 Copyright (C) 2007 Matthias Troyer
120 .. |Logo| image:: pbgl-logo.png
123 :target: http://www.osl.iu.edu/research/pbgl
125 .. _process group: process_group.html