The Thrill Network Layer consists of sublayers:
The Group object is similar to an MPI communicator: it has connections to p peers/clients/workers in a group. The network peers have only an indirect relation to the worker concept of higher Thrill layers, though they will probably be implementing using a Group.
For testing purposes Group provides the function ExecuteGroupThreads which creates a mock Group of k partners. The partners are connected via internal sockets (real kernel level sockets), and for each partner a std::thread is spawned. The thread executes a test function which gets a Group object that can communicate with the other partners. This is ideal for testing network protocols. See the test-net-group.cpp for more examples.
The network layer is designed to allow plugging in new network implementations by deriving from the main classes Group, Connection, and Dispatcher. The Group represents the set of connections, and provides synchronous communication, while the Dispatcher allows asynchronous callbacks.
There are currently two network implementations:
An important design decision of the network layer is to support only sending and receiving of whole packets. The received packet size must be known by the receiver in advance, which necessitates pre-communication of sizes. This is because RDMA works in this manner.
The BSD socket API is difficult to work with correctly, which is why the following classes provide convenience functions and excessive logging facilities.