The MPI bsp_process_group class is a process group implementing the Bulk Synchronous Parallel (BSP) model of computation over MPI 1.1. It models (i.e., meets the requirements of) the BSP Process Group concept. The BSP model is the model primarily employed by the Parallel BGL, because it performs well across many different parallel architectures, is deterministic, and does not perform poorly when many small messages are sent between processors.
Since the bsp_process_group class is a model of the BSP Process Group and MPI Process Group concepts, documentation of any functions that provide only the minimal required behavior will be omitted. Please refer to the concept descriptions for the semantics of these operations.
namespace boost { namespace mpi {
class bsp_process_group
{
public:
typedef int process_id_type;
typedef int process_size_type;
typedef MPI_Comm communicator_type;
struct communication_category
: virtual parallel::bsp_process_group_tag, virtual mpi_process_group_tag { };
bsp_process_group(communicator_type parent_comm = MPI_COMM_WORLD);
bsp_process_group(const bsp_process_group& other,
const receiver_type& handler);
operator bool() const;
void replace_handler(const receiver_type& handler);
bsp_process_group base() const;
};
bsp_process_group::process_id_type process_id(const bsp_process_group& pg);
bsp_process_group::process_size_type num_processes(const bsp_process_group& pg);
bsp_process_group::communicator_type communicator(const bsp_process_group& pg);
template<typename T>
void
send(const bsp_process_group& pg, bsp_process_group::process_id_type dest,
int tag, const T& value);
template<typename T>
void
send(const bsp_process_group& pg, bsp_process_group::process_id_type dest,
int tag, const T values[], std::size_t n);
template<typename T>
bsp_process_group::process_id_type
receive(const bsp_process_group& pg, int tag, T& value);
template<typename T>
bsp_process_group::process_id_type
receive(const bsp_process_group& pg,
bsp_process_group::process_id_type source, int tag, T& value);
template<typename T>
std::pair<bsp_process_group::process_id_type, std::size_t>
receive(const bsp_process_group& pg, int tag, T values[], std::size_t n);
template<typename T>
std::pair<bsp_process_group::process_id_type, std::size_t>
receive(const bsp_process_group& pg,
bsp_process_group::process_id_type source, int tag, T values[],
std::size_t n);
optional<std::pair<bsp_process_group::process_id_type, int> >
probe(const bsp_process_group& pg);
void synchronize(const bsp_process_group& pg);
template<typename InputIterator>
bsp_process_group
process_subgroup(const bsp_process_group& pg,
InputIterator first, InputIterator last);
} } // end namespace boost::mpi
<boost/mpi/bsp_process_group.hpp>
bsp_process_group(communicator_type parent_comm = MPI_COMM_WORLD);
Construct a new process group. The communicator used by the new process group will be a duplicate (created with MPI_Comm_dup``_) of the communicator ``parent_comm.
operator bool() const;
Evaluates true when the executing process is within the process group, otherwise evaluates false. This is not a general method for determining process inclusion, but rather a way to determine which processes are within a particular process subgroup. See the process_group free function.
template<typename InputIterator>
bsp_process_group
process_subgroup(const bsp_process_group& pg,
InputIterator first, InputIterator last);
Generates a new process group containing a subset of the processes in process group pg, but retaining the same handlers as with pg. The set of processes that should be included in the subgroup is given by the input iterator sequence [first, last), which must contain process identifiers. This is a collective operation, requiring all processes in the group (even those that will not be in the subgroup) to call it concurrently. The returned process group will evaluate true in a boolean context when it is a part of the subgroup and false otherwise.
Copyright (C) 2005 The Trustees of Indiana University.
Authors: Douglas Gregor and Andrew Lumsdaine