artdaq
v3_12_02
|
A RoutingManagerPolicy which tries to fully load the first receiver, then the second, and so on. More...
Public Member Functions | |
CapacityTestPolicy (const fhicl::ParameterSet &ps) | |
CapacityTestPolicy Constructor. More... | |
~CapacityTestPolicy () override=default | |
Default virtual Destructor. | |
virtual void | CreateRoutingTable (detail::RoutingPacket &output) override |
Add entries to the given RoutingPacket using currently-held tokens. More... | |
virtual 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 tries to fully load the first receiver, then the second, and so on.
Definition at line 10 of file CapacityTest_policy.cc.
|
explicit |
CapacityTestPolicy Constructor.
ps | ParameterSet used to configure the CapacityTestPolicy |
* CapacityTestPolicy accepts the following Parameters: * "tokens_used_per_table_percent" (Default: 50): Percentage of available tokens to be used on each iteration. *
Definition at line 60 of file CapacityTest_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 95 of file CapacityTest_policy.cc.
|
overridevirtual |
Add entries to the given RoutingPacket using currently-held tokens.
output | RoutingPacket to add entries to |
CapacityTestPolicy will assign available tokens from the first receiver, then the second, and so on until it has assigned tokens equal to the inital_token_count * tokens_used_per_table_percent / 100. The idea is that in steady-state, the load on the receivers should reflect the workload relative to the capacity of the system. (i.e. if you have 5 receivers, and 3 of them are 100% busy, then your load factor is approximately 60%.)
Implements artdaq::RoutingManagerPolicy.
Definition at line 65 of file CapacityTest_policy.cc.