artdaq::RoutingMasterCore Class Reference

RoutingMasterCore implements the state machine for the RoutingMaster artdaq application. RoutingMasterCore collects tokens from receivers, and at regular intervals uses these tokens to build Routing Tables that are sent to the senders. More...

#include <artdaq/Application/RoutingMasterCore.hh>

List of all members.

Public Member Functions

 RoutingMasterCore (int rank, std::string name)
 RoutingMasterCore Constructor.
 RoutingMasterCore (RoutingMasterCore const &)
 Copy Constructor is deleted.
 ~RoutingMasterCore ()
RoutingMasterCoreoperator= (RoutingMasterCore const &)
 Copy Assignment operator is deleted.
bool initialize (fhicl::ParameterSet const &pset, uint64_t, uint64_t)
 Processes the initialize request.
bool start (art::RunID id, uint64_t, uint64_t)
 Start the RoutingMasterCore.
bool stop (uint64_t, uint64_t)
 Stops the RoutingMasterCore.
bool pause (uint64_t, uint64_t)
 Pauses the RoutingMasterCore.
bool resume (uint64_t, uint64_t)
 Resumes the RoutingMasterCore.
bool shutdown (uint64_t)
 Shuts Down the RoutingMasterCore.
bool soft_initialize (fhicl::ParameterSet const &pset, uint64_t timeout, uint64_t timestamp)
 Soft-Initializes the RoutingMasterCore.
bool reinitialize (fhicl::ParameterSet const &pset, uint64_t timeout, uint64_t timestamp)
 Reinitializes the RoutingMasterCore.
size_t process_event_table ()
 Main loop of the RoutingMasterCore. Determines when to send the next table update, asks the RoutingMasterPolicy for the table to send, and sends it.
void send_event_table (detail::RoutingPacket table)
 Sends a detail::RoutingPacket to the table receivers.
std::string report (std::string const &) const
 Send a report on the current status of the RoutingMasterCore.

Static Public Attributes

static const std::string TABLE_UPDATES_STAT_KEY
 Key for Table Update count MonnitoredQuantity.
static const std::string TOKENS_RECEIVED_STAT_KEY
 Key for the Tokens Received MonitoredQuantity.

Detailed Description

RoutingMasterCore implements the state machine for the RoutingMaster artdaq application. RoutingMasterCore collects tokens from receivers, and at regular intervals uses these tokens to build Routing Tables that are sent to the senders.

Definition at line 31 of file RoutingMasterCore.hh.


Constructor & Destructor Documentation

artdaq::RoutingMasterCore::RoutingMasterCore ( int  rank,
std::string  name 
)

RoutingMasterCore Constructor.

Parameters:
rank Rank of the RoutingMaster
name Friendly name for the RoutingMaster

Definition at line 29 of file RoutingMasterCore.cc.

artdaq::RoutingMasterCore::~RoutingMasterCore (  ) 

Destructor.

Definition at line 46 of file RoutingMasterCore.cc.


Member Function Documentation

bool artdaq::RoutingMasterCore::initialize ( fhicl::ParameterSet const &  pset,
uint64_t  ,
uint64_t   
)

Processes the initialize request.

Parameters:
pset ParameterSet used to configure the RoutingMasterCore
Returns:
Whether the initialize attempt succeeded
	* RoutingMasterCore accepts the following Parameters:
	* "daq" (REQUIRED): FHiCL table containing DAQ configuration
	*   "policy" (REQUIRED): FHiCL table containing the RoutingMasterPolicy configuration
	*     "policy" (Default: ""): Name of the RoutingMasterPolicy plugin to load
	*   "rt_priority" (Default: 0): Unix process priority to assign to RoutingMasterCore
	*   "sender_ranks" (REQUIRED): List of ranks (integers) for the senders (that receive table updates)
	*   "table_update_interval_ms" (Default: 1000): Maximum amount of time between table updates
	*   "senders_send_by_send_count" (Default: false): If true, senders will use the current send count to lookup routing information in the table, instead of sequence ID.
	*   "table_ack_retry_count" (Default: 5): The number of times the table will be resent while waiting for acknowledements
	*   "routing_token_port" (Default: 35555): The port on which to listen for RoutingToken packets
	*   "table_update_port" (Default: 35556): The port on which to send table updates
	*   "table_acknowledge_port" (Default: 35557): The port on which to listen for RoutingAckPacket datagrams
	*   "table_update_address" (Default: "227.128.12.28"): Multicast address to send table updates to
	*   "routing_master_hostname" (Default: "localhost"): Hostname to send table updates from
	*   "metrics": FHiCL table containing configuration for MetricManager
	* 

Definition at line 52 of file RoutingMasterCore.cc.

RoutingMasterCore& artdaq::RoutingMasterCore::operator= ( RoutingMasterCore const &   ) 

Copy Assignment operator is deleted.

Returns:
RoutingMasterCore copy
bool artdaq::RoutingMasterCore::pause ( uint64_t  ,
uint64_t   
)

Pauses the RoutingMasterCore.

Returns:
True if no exception

Definition at line 183 of file RoutingMasterCore.cc.

size_t artdaq::RoutingMasterCore::process_event_table (  ) 

Main loop of the RoutingMasterCore. Determines when to send the next table update, asks the RoutingMasterPolicy for the table to send, and sends it.

Returns:
Number of table updates sent

Definition at line 225 of file RoutingMasterCore.cc.

bool artdaq::RoutingMasterCore::reinitialize ( fhicl::ParameterSet const &  pset,
uint64_t  timeout,
uint64_t  timestamp 
)

Reinitializes the RoutingMasterCore.

Parameters:
pset ParameterSet for configuring RoutingMasterCore
timeout Timeout for transition
timestamp Timestamp of transition
Returns:
Returns initialize status

Definition at line 217 of file RoutingMasterCore.cc.

std::string artdaq::RoutingMasterCore::report ( std::string const &   )  const

Send a report on the current status of the RoutingMasterCore.

Returns:
A string containing the report on the current status of the RoutingMasterCore

Definition at line 570 of file RoutingMasterCore.cc.

bool artdaq::RoutingMasterCore::resume ( uint64_t  ,
uint64_t   
)

Resumes the RoutingMasterCore.

Returns:
True if no exception

Definition at line 192 of file RoutingMasterCore.cc.

void artdaq::RoutingMasterCore::send_event_table ( detail::RoutingPacket  table  ) 

Sends a detail::RoutingPacket to the table receivers.

Parameters:
table The detail::RoutingPacket to send

send_event_table checks the table update socket and the acknowledge socket before sending the table update the first time. It then enters a loop where it sends the table update, then waits for acknowledgement packets. It keeps track of which senders have sent their acknowledgement packets, and discards duplicate acks. It leaves this loop once all senders have sent a valid acknowledgement packet.

Definition at line 305 of file RoutingMasterCore.cc.

bool artdaq::RoutingMasterCore::shutdown ( uint64_t   ) 

Shuts Down the RoutingMasterCore.

Returns:
If the shutdown was successful

Definition at line 201 of file RoutingMasterCore.cc.

bool artdaq::RoutingMasterCore::soft_initialize ( fhicl::ParameterSet const &  pset,
uint64_t  timeout,
uint64_t  timestamp 
)

Soft-Initializes the RoutingMasterCore.

Parameters:
pset ParameterSet for configuring RoutingMasterCore
timeout Timeout for transition
timestamp Timestamp of transition
Returns:
Returns initialize status

Definition at line 209 of file RoutingMasterCore.cc.

bool artdaq::RoutingMasterCore::start ( art::RunID  id,
uint64_t  ,
uint64_t   
)

Start the RoutingMasterCore.

Parameters:
id Run ID of the current run
Returns:
True if no exception

Definition at line 157 of file RoutingMasterCore.cc.

bool artdaq::RoutingMasterCore::stop ( uint64_t  ,
uint64_t   
)

Stops the RoutingMasterCore.

Returns:
True if no exception

Definition at line 174 of file RoutingMasterCore.cc.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator

Generated on 1 Jun 2017 for artdaq by  doxygen 1.6.1