]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/property_map/include/boost/property_map/parallel/process_group.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / property_map / include / boost / property_map / parallel / process_group.hpp
CommitLineData
7c673cae
FG
1// Copyright 2004 The Trustees of Indiana University.
2
3// Use, modification and distribution is subject to the Boost Software
4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7// Authors: Douglas Gregor
8// Andrew Lumsdaine
9#ifndef BOOST_PROPERTY_MAP_PARALLEL_PROCESS_GROUP_HPP
10#define BOOST_PROPERTY_MAP_PARALLEL_PROCESS_GROUP_HPP
11
12#include <cstdlib>
13#include <utility>
14
15namespace boost { namespace parallel {
16
17/**
18 * A special type used as a flag to a process group constructor that
19 * indicates that the copy of a process group will represent a new
20 * distributed data structure.
21 */
22struct attach_distributed_object { };
23
24/**
25 * Describes the context in which a trigger is being invoked to
26 * receive a message.
27 */
28enum trigger_receive_context {
29 /// No trigger is active at this time.
30 trc_none,
31 /// The trigger is being invoked during synchronization, at the end
32 /// of a superstep.
33 trc_in_synchronization,
34 /// The trigger is being invoked as an "early" receive of a message
35 /// that was sent through the normal "send" operations to be
36 /// received by the end of the superstep, but the process group sent
37 /// the message earlier to clear its buffers.
38 trc_early_receive,
39 /// The trigger is being invoked for an out-of-band message, which
40 /// must be handled immediately.
41 trc_out_of_band,
42 /// The trigger is being invoked for an out-of-band message, which
43 /// must be handled immediately and has alredy been received by
44 /// an MPI_IRecv call.
45 trc_irecv_out_of_band
46};
47
48// Process group tags
49struct process_group_tag {};
50struct linear_process_group_tag : virtual process_group_tag {};
51struct messaging_process_group_tag : virtual process_group_tag {};
52struct immediate_process_group_tag : virtual messaging_process_group_tag {};
53struct bsp_process_group_tag : virtual messaging_process_group_tag {};
54struct batch_process_group_tag : virtual messaging_process_group_tag {};
55struct locking_process_group_tag : virtual process_group_tag {};
56struct spawning_process_group_tag : virtual process_group_tag {};
57
58struct process_group_archetype
59{
60 typedef int process_id_type;
61};
62
63void wait(process_group_archetype&);
64void synchronize(process_group_archetype&);
65int process_id(const process_group_archetype&);
66int num_processes(const process_group_archetype&);
67
68template<typename T> void send(process_group_archetype&, int, int, const T&);
69
70template<typename T>
71process_group_archetype::process_id_type
72receive(const process_group_archetype& pg,
73 process_group_archetype::process_id_type source, int tag, T& value);
74
75template<typename T>
76std::pair<process_group_archetype::process_id_type, std::size_t>
77receive(const process_group_archetype& pg, int tag, T values[], std::size_t n);
78
79template<typename T>
80std::pair<process_group_archetype::process_id_type, std::size_t>
81receive(const process_group_archetype& pg,
82 process_group_archetype::process_id_type source, int tag, T values[],
83 std::size_t n);
84
85} } // end namespace boost::parallel
86
87namespace boost { namespace graph { namespace distributed {
88 using boost::parallel::trigger_receive_context;
89 using boost::parallel::trc_early_receive;
90 using boost::parallel::trc_out_of_band;
91 using boost::parallel::trc_irecv_out_of_band;
92 using boost::parallel::trc_in_synchronization;
93 using boost::parallel::trc_none;
94 using boost::parallel::attach_distributed_object;
95} } } // end namespace boost::graph::distributed
96
97#endif // BOOST_PROPERTY_MAP_PARALLEL_PROCESS_GROUP_HPP