artdaq
v3_12_02
|
The interface through which RoutingManagerCore obtains Routing Tables using received Routing Tokens. More...
#include <artdaq/RoutingPolicies/RoutingManagerPolicy.hh>
Public Member Functions | |
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... | |
Protected Member Functions | |
virtual void | CreateRoutingTable (detail::RoutingPacket &tables)=0 |
Generate entries to add to the given table. More... | |
virtual detail::RoutingPacketEntry | CreateRouteForSequenceID (artdaq::Fragment::sequence_id_t seq, int requesting_rank)=0 |
Generate a route for the given sequence ID and source rank. More... | |
Protected Attributes | |
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. | |
The interface through which RoutingManagerCore obtains Routing Tables using received Routing Tokens.
Definition at line 21 of file RoutingManagerPolicy.hh.
|
explicit |
RoutingManagerPolicy Constructor.
ps | ParameterSet used to configure the RoutingManagerPolicy |
* RoutingManagerPolicy accepts the following Parameters: *
Definition at line 9 of file RoutingManagerPolicy.cc.
void artdaq::RoutingManagerPolicy::AddReceiverToken | ( | int | rank, |
unsigned | new_slots_free | ||
) |
Add a token to the token list.
rank | Rank that the token is from |
new_slots_free | Number of slots that are now free (should usually be 1) |
Definition at line 37 of file RoutingManagerPolicy.cc.
|
inline |
Determine whether the routing cache has a route for the given sequence ID. For testing.
seq | Sequence ID to check |
Definition at line 120 of file RoutingManagerPolicy.hh.
|
protectedpure virtual |
Generate a route for the given sequence ID and source rank.
seq | Sequence ID to route |
requesting_rank | Source rank requesting routing information |
Implemented in artdaq::PreferSameHostPolicy, artdaq::RoundRobinPolicy, artdaq::NoOpPolicy, and artdaq::CapacityTestPolicy.
|
protectedpure virtual |
Generate entries to add to the given table.
tables | The RoutingPacket to add entries to |
Implemented in artdaq::PreferSameHostPolicy, artdaq::RoundRobinPolicy, artdaq::NoOpPolicy, and artdaq::CapacityTestPolicy.
|
inline |
Get the size of the routing cache. For testing.
Definition at line 114 of file RoutingManagerPolicy.hh.
artdaq::detail::RoutingPacket artdaq::RoutingManagerPolicy::GetCurrentTable | ( | ) |
Create a RoutingPacket from currently-owned tokens. Used by EventBuilder and RequestBasedEventBuilder RoutingManagerMode.
Definition at line 18 of file RoutingManagerPolicy.cc.
|
inline |
Get the number of tokens that are waiting to be used.
Definition at line 83 of file RoutingManagerPolicy.hh.
|
inline |
Get the largest number of tokens that the RoutingManagerPolicy has seen at any one time.
Definition at line 49 of file RoutingManagerPolicy.hh.
|
inline |
Get the next sequence ID to be routed.
Definition at line 77 of file RoutingManagerPolicy.hh.
|
inline |
Get the number of configured receivers.
Definition at line 43 of file RoutingManagerPolicy.hh.
artdaq::detail::RoutingPacketEntry artdaq::RoutingManagerPolicy::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.
seq | Sequence Number to get route for |
requesting_rank | Rank to route for |
Definition at line 79 of file RoutingManagerPolicy.cc.
|
inline |
Get the current RoutingManagerMode of this RoutingManager.
Definition at line 107 of file RoutingManagerPolicy.hh.
|
inline |
Get the number of tokens that have been used since the last update.
Definition at line 55 of file RoutingManagerPolicy.hh.