artdaq::Config Class Reference

Helper class for configuring the builder test. More...

#include <proto/Config.hh>

List of all members.

Public Types

enum  TaskType { TaskSink = 0, TaskSource = 1, TaskDetector = 2 }
 

Type of the builder instance.

More...

Public Member Functions

 Config (int rank, int nprocs, int buffer_count, size_t max_payload_size, int argc, char *argv[])
 Config Constructor.
int destCount () const
 Get the number of destinations for this process.
int destStart () const
 Get the rank of the first destination for this process.
int srcCount () const
 Get the number of sources for this process.
int srcStart () const
 Get the rank of the first source for this process.
int getDestFriend () const
 Get the corresponding destination for this source.
int getSrcFriend () const
 Get the corresponding source for this destination.
int getArtArgc (int argc, char *argv[]) const
 Gets the count of arguments after a -- delimiter.
char ** getArtArgv (int argc, char *argv[]) const
 Get the array of arguments after a -- delimiter.
std::string typeName () const
 Get the name of the type of this process.
void writeInfo () const
 Write information about this Config class to a file.
void print (std::ostream &ost) const
 Dump configuration information (space delimited) to a stream.
void printHeader (std::ostream &ost) const
 Write configuration parameter names to a stream.
fhicl::ParameterSet makeParameterSet () const
 Write a ParameterSet using configuration.
fhicl::ParameterSet getArtPset ()
 Get the ParameterSet to use to configure art.

Static Public Member Functions

static void throwUsage (char *argv0, const std::string &msg)
 Write the usage to cerr and throw an exception.
static double getArgDetectors (int argc, char *argv[])
 Get the detectors count from the command line.
static double getArgSinks (int argc, char *argv[])
 Get the sink count from the command line.
static int getArgQueueSize (int argc, char *argv[])
 Get the Queue Size from the command line.
static int getArgRun (int argc, char *argv[])
 Get the Run number from the command line.
static std::string getProcessorName ()
 Call MPI_Get_processor_name.

Public Attributes

int rank_
 Rank of this application.
int total_procs_
 Total number of processes.
int detectors_
 Count of detectors.
int sources_
 Count of source.
int sinks_
 Count of sinks.
int detector_start_
 Rank of first detector.
int source_start_
 Rank of first source.
int sink_start_
 Rank of first sink.
int event_queue_size_
 Size of the Event Queue.
int run_
 Run Number.
int buffer_count_
 Maximum number of simulatneous Fragments.
size_t max_payload_size_
 Maximum size of Fragments to create/transfer.
TaskType type_
 Type of this Builder application.
int offset_
 Offset from the start rank for this type.
std::string node_name_
 Name of this node, from MPI_Get_processor_name.
int art_argc_
 Count of arguments used for art.
char ** art_argv_
 Arguments used for art.
bool use_artapp_
 Whether to use art.

Static Public Attributes

static const char * usage = "DetectorsPerNode SinksPerNode Run"
 String for command-line arguments.

Detailed Description

Helper class for configuring the builder test.

Definition at line 21 of file Config.hh.


Member Enumeration Documentation

Type of the builder instance.

Enumerator:
TaskSink 

This Builder is a "Sink".

TaskSource 

This Builder is a "Source".

TaskDetector 

This Builder is a "Detector".

Definition at line 32 of file Config.hh.


Constructor & Destructor Documentation

artdaq::Config::Config ( int  rank,
int  nprocs,
int  buffer_count,
size_t  max_payload_size,
int  argc,
char *  argv[] 
)

Config Constructor.

Parameters:
rank Rank of this process
nprocs Total number of processes in the test
buffer_count Number of Fragments that may be in-flight simultaneously
max_payload_size Maximum size of the Fragments
argc Number of arguments
argv Array of arguments, as strings

Definition at line 26 of file Config.cc.


Member Function Documentation

int artdaq::Config::destCount (  )  const

Get the number of destinations for this process.

Returns:
The number of destinations for this process

Definition at line 63 of file Config.cc.

int artdaq::Config::destStart (  )  const

Get the rank of the first destination for this process.

Returns:
The rank of the first destination for this process

Definition at line 69 of file Config.cc.

static double artdaq::Config::getArgDetectors ( int  argc,
char *  argv[] 
) [inline, static]

Get the detectors count from the command line.

Parameters:
argc Argument count
argv Array of arguments as strings
Returns:
Detector count

Definition at line 187 of file Config.hh.

static int artdaq::Config::getArgQueueSize ( int  argc,
char *  argv[] 
) [inline, static]

Get the Queue Size from the command line.

Parameters:
argc Argument count
argv Array of arguments as strings
Returns:
Queue size

Definition at line 211 of file Config.hh.

static int artdaq::Config::getArgRun ( int  argc,
char *  argv[] 
) [inline, static]

Get the Run number from the command line.

Parameters:
argc Argument count
argv Array of arguments as strings
Returns:
Run number

Definition at line 223 of file Config.hh.

static double artdaq::Config::getArgSinks ( int  argc,
char *  argv[] 
) [inline, static]

Get the sink count from the command line.

Parameters:
argc Argument count
argv Array of arguments as strings
Returns:
Sink count

Definition at line 199 of file Config.hh.

int artdaq::Config::getArtArgc ( int  argc,
char *  argv[] 
) const

Gets the count of arguments after a -- delimiter.

Parameters:
argc Original argc
argv Original argv
Returns:
argc of arguments after --

Definition at line 103 of file Config.cc.

char** artdaq::Config::getArtArgv ( int  argc,
char *  argv[] 
) const

Get the array of arguments after a -- delimiter.

Parameters:
argc Original argc
argv Original argv
Returns:
argv of arguments after --
fhicl::ParameterSet artdaq::Config::getArtPset (  ) 

Get the ParameterSet to use to configure art.

Returns:
The ParameterSet used to configure art
		 * The ParameterSet is read for the following Parameters:
		 * "daq" (REQUIRED): DAQ config FHiCL table
		 *   "buffer_count" (Default: buffer_count): Maximum number of simulatneous Fragments
		 *   "max_fragment_size_words" (Default: max_payload_size): Maximum size of Fragments to create/transfer
		 * 

Definition at line 181 of file Config.cc.

int artdaq::Config::getDestFriend (  )  const

Get the corresponding destination for this source.

Returns:
The corresponding destiantion for this source

Definition at line 93 of file Config.cc.

static std::string artdaq::Config::getProcessorName (  )  [inline, static]

Call MPI_Get_processor_name.

Returns:
The result of MPI_Get_processor_name

Definition at line 233 of file Config.hh.

int artdaq::Config::getSrcFriend (  )  const

Get the corresponding source for this destination.

Returns:
The corresponding source for this destination

Definition at line 98 of file Config.cc.

fhicl::ParameterSet artdaq::Config::makeParameterSet (  )  const

Write a ParameterSet using configuration.

Returns:
A ParameterSet with sources and destinations blocks, as appropriate for the Task

Definition at line 148 of file Config.cc.

void artdaq::Config::print ( std::ostream &  ost  )  const

Dump configuration information (space delimited) to a stream.

Parameters:
ost Stream to dump configuration to

Definition at line 132 of file Config.cc.

void artdaq::Config::printHeader ( std::ostream &  ost  )  const

Write configuration parameter names to a stream.

Parameters:
ost Stream to write configuration parameter names to

Definition at line 119 of file Config.cc.

int artdaq::Config::srcCount (  )  const

Get the number of sources for this process.

Returns:
The number of sources for this process

Definition at line 75 of file Config.cc.

int artdaq::Config::srcStart (  )  const

Get the rank of the first source for this process.

Returns:
The rank of the first source for this process

Definition at line 81 of file Config.cc.

static void artdaq::Config::throwUsage ( char *  argv0,
const std::string &  msg 
) [inline, static]

Write the usage to cerr and throw an exception.

Parameters:
argv0 First parameter in argv
msg Exception message

Definition at line 175 of file Config.hh.

std::string artdaq::Config::typeName (  )  const

Get the name of the type of this process.

Returns:
The name of the type of this process (one of "Sink", "Source" or "Detector")

Definition at line 87 of file Config.cc.


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

Generated on 16 Aug 2017 for artdaq by  doxygen 1.6.1