The mailbox of the long-lived workers of an executor, beyond the book, on any family of channels, with the detection of the termination.
More...
|
| file | ADS/parallel/Mailbox.h |
| | The mailbox of the long-lived workers of an executor [see Executor.h], beyond the book, on any family of channels [see Channels.h], with the detection of the termination: a computation of \( p \) workers that create work for each other by messages (the nodes of a search sent to the worker that owns them, the vertices of a graph to the worker of their part) ends when no worker has work and no message is on its way, a state that no worker sees by itself (see The detection of the termination).
|
|
| concept | ADS::MailboxCoalescing |
| | a policy of the coalescing of Mailbox for the messages Msg: NoCoalescing, or CoalesceBy< K , M > with K a function object made by default that gives the key of a message, and a map from the key to a place of std::size_t by try_emplace(), clear() and empty()
|
|
| struct | ADS::NoCoalescing |
| | no coalescing of the messages in the outboxes of Mailbox: no member and no code, and no send() with a merge; the default More...
|
| struct | ADS::CoalesceBy< K, M > |
| | the coalescing of the messages of one key in an outbox of Mailbox: K()( x ) the key of the message \( x \), and M the map from a key to the place of its last message in an outbox (try_emplace(), clear() and empty() as those of std::unordered_map, or of DenseHashMap and FlatHashTable, which allocate no node per key), by default (void) a std::unordered_map of the keys to std::size_t More...
|
| class | ADS::Mailbox< Msg, Ch, Co > |
| | the mailbox of \( p \) workers on the channels Ch (by default the mesh, the family that DefaultChannels gives every executor), with outboxes of batches, the detection of the termination, the stop and the recovery of the messages left, and the coalescing of the messages of one key in an outbox by the policy Co More...
|
|
| template<class K, class H = std::hash< K >> |
| std::size_t | ADS::ownerOf (const K &k, std::size_t p, const H &h=H()) |
| | the owner of the key \( k \) among \( p \) workers or processes, \( h( k ) \bmod p \) for the hash function \( h \)
|
The mailbox of the long-lived workers of an executor, beyond the book, on any family of channels, with the detection of the termination.
The definitions, the invariants and the costs of the area are in Theory of parallelism.
◆ ownerOf()
template<class K, class H = std::hash< K >>
| std::size_t ADS::ownerOf |
( |
const K & | k, |
|
|
std::size_t | p, |
|
|
const H & | h = H() ) |
|
nodiscard |
the owner of the key \( k \) among \( p \) workers or processes, \( h( k ) \bmod p \) for the hash function \( h \)
- Precondition
- \( p \ge 1 \)