artdaq
v3_12_02
|
A RoutingManagerPolicy which evenly distributes Sequence IDs to all receivers. If an uneven number of tokens have been received, extra tokens are stored for the next table update. More...
Public Member Functions | |
RoundRobinPolicy (const fhicl::ParameterSet &ps) | |
RoundRobinPolicy Constructor. More... | |
~RoundRobinPolicy () override=default | |
Default virtual Destructor. | |
void | CreateRoutingTable (detail::RoutingPacket &output) override |
Add entries to the given RoutingPacket using currently-held tokens. More... | |
detail::RoutingPacketEntry | CreateRouteForSequenceID (artdaq::Fragment::sequence_id_t seq, int requesting_rank) override |
Get an artdaq::detail::RoutingPacketEntry for a given sequence ID and rank. Used by RequestBasedEventBuilder and DataFlow RoutingManagerMode. More... | |
![]() | |
RoutingManagerPolicy (const fhicl::ParameterSet &ps) | |
RoutingManagerPolicy Constructor. More... | |
virtual | ~RoutingManagerPolicy ()=default |
Default virtual Destructor. | |
size_t | GetReceiverCount () const |
Get the number of configured receivers. More... | |
size_t | GetMaxNumberOfTokens () const |
Get the largest number of tokens that the RoutingManagerPolicy has seen at any one time. More... | |
size_t | GetTokensUsedSinceLastUpdate () const |
Get the number of tokens that have been used since the last update. More... | |
void | ResetTokensUsedSinceLastUpdate () |
Reset the number of tokens used. | |
void | AddReceiverToken (int rank, unsigned new_slots_free) |
Add a token to the token list. More... | |
void | Reset () |
Reset the policy, setting the next sequence ID to be used to 1, and removing any tokens. | |
Fragment::sequence_id_t | GetNextSequenceID () const |
Get the next sequence ID to be routed. More... | |
size_t | GetHeldTokenCount () const |
Get the number of tokens that are waiting to be used. More... | |
detail::RoutingPacket | GetCurrentTable () |
Create a RoutingPacket from currently-owned tokens. Used by EventBuilder and RequestBasedEventBuilder RoutingManagerMode. More... | |
detail::RoutingPacketEntry | GetRouteForSequenceID (artdaq::Fragment::sequence_id_t seq, int requesting_rank) |
Get an artdaq::detail::RoutingPacketEntry for a given sequence ID and rank. Used by RequestBasedEventBuilder and DataFlow RoutingManagerMode. More... | |
detail::RoutingManagerMode | GetRoutingMode () const |
Get the current RoutingManagerMode of this RoutingManager. More... | |
size_t | GetCacheSize () const |
Get the size of the routing cache. For testing. More... | |
bool | CacheHasRoute (artdaq::Fragment::sequence_id_t seq) const |
Determine whether the routing cache has a route for the given sequence ID. For testing. More... | |
Additional Inherited Members | |
![]() | |
std::deque< int > | tokens_ |
The list of tokens which are available for use. | |
std::atomic< size_t > | tokens_used_since_last_update_ |
Number of tokens consumed since last metric update. | |
Fragment::sequence_id_t | next_sequence_id_ |
The next sequence ID to be assigned. | |
std::unordered_set< int > | receiver_ranks_ |
Configured receiver (e.g. EventBuilder for BR->EB routing) ranks. | |
detail::RoutingManagerMode | routing_mode_ |
Current routing mode. | |
A RoutingManagerPolicy which evenly distributes Sequence IDs to all receivers. If an uneven number of tokens have been received, extra tokens are stored for the next table update.
Definition at line 15 of file RoundRobin_policy.cc.
|
inlineexplicit |
RoundRobinPolicy Constructor.
ps | ParameterSet used to configure RoundRobinPolicy |
RoundRobinPolicy accepts the following Parameter: "minimum_participants" (Default: 0): Minimum number of receivers to distribute between. Use negative number to indicate how many can be missing from total. If the number of allowed missing receivers is greater than the number that exist, then the minimum number of participants will be set to 1.
Definition at line 25 of file RoundRobin_policy.cc.
|
overridevirtual |
Get an artdaq::detail::RoutingPacketEntry for a given sequence ID and rank. Used by RequestBasedEventBuilder and DataFlow RoutingManagerMode.
seq | Sequence Number to get route for |
requesting_rank | Rank to route for |
Implements artdaq::RoutingManagerPolicy.
Definition at line 102 of file RoundRobin_policy.cc.
|
overridevirtual |
Add entries to the given RoutingPacket using currently-held tokens.
output | RoutingPacket to add entries to |
RoundRobinPolicy will go through the list of receivers as many times as it can, until one or more receivers have no tokens. It always does full "turns" through the recevier list.
Implements artdaq::RoutingManagerPolicy.
Definition at line 67 of file RoundRobin_policy.cc.