16 #ifndef THRILL_NET_TCP_GROUP_HEADER 17 #define THRILL_NET_TCP_GROUP_HEADER 37 class SelectDispatcher;
45 static constexpr
bool debug =
false;
68 Group(
size_t my_rank,
size_t group_size)
69 : net::
Group(my_rank),
89 throw Exception(
"Group::Connection() requested " 93 throw Exception(
"Group::Connection() requested " 94 "connection to self.");
120 throw Exception(
"Group::GetClient() requested " 124 connections_[connection.peer_id()] = std::move(connection);
165 #endif // !THRILL_NET_TCP_GROUP_HEADER static std::vector< std::unique_ptr< Group > > ConstructLocalRealTCPMesh(size_t num_hosts)
Construct a test network with an underlying full mesh of REAL tcp streams interconnected via localhos...
Group(size_t my_rank, size_t group_size)
Initializing constructor, used by tests for creating Groups.
size_t num_hosts() const final
Return number of connections in this group (= number computing hosts)
net::Connection & connection(size_t id) final
Return Connection to client id.
~Group()
Closes all client connections.
Collection of NetConnections to workers, allows point-to-point client communication and simple collec...
size_t my_rank_
our rank in the network group
Group & operator=(const Group &)=delete
non-copyable: delete assignment operator
SelectDispatcher is a higher level wrapper for select().
Connection is a rich point-to-point socket connection to another client (worker, master, or whatever).
static by_string to_string(int val)
convert to string
Connection & tcp_connection(size_t id)
Return Connection to client id.
std::vector< Connection > connections_
Connections to all other clients in the Group.
std::unique_ptr< net::Dispatcher > ConstructDispatcher() const final
A Exception is thrown by Connection on all errors instead of returning error codes.
Connection & AssignConnection(Connection &connection)
Assigns a connection to this net group.
A Connection represents a link to another peer in a network group.
static std::vector< std::unique_ptr< Group > > ConstructLoopbackMesh(size_t num_hosts)
Construct a test network with an underlying full mesh of local loopback stream sockets for testing...
A network Group is a collection of enumerated communication links, which provides point-to-point comm...
static constexpr bool debug
void Close()
Closes all client connections.