1 #ifndef proto_Config_hh
2 #define proto_Config_hh
6 #include <fhiclcpp/fwd.h>
48 Config(
int rank,
int nprocs,
int buffer_count,
size_t max_payload_size,
int argc,
char* argv[]);
100 char**
getArtArgv(
int argc,
char* argv[])
const;
143 void print(std::ostream& ost)
const;
189 if (argc < 2) {
throwUsage(argv[0],
"no detectors_per_node argument"); }
190 return atof(argv[1]);
201 if (argc < 3) {
throwUsage(argv[0],
"no sinks_per_node argument"); }
202 return atof(argv[2]);
213 if (argc < 4) {
throwUsage(argv[0],
"no event_queue_size argument"); }
214 return atoi(argv[3]);
225 if (argc < 5) {
throwUsage(argv[0],
"no run argument"); }
226 return atoi(argv[4]);
236 int sz =
sizeof(buf);
237 MPI_Get_processor_name(buf, &sz);
238 return std::string(buf);
size_t max_payload_size_
Maximum size of Fragments to create/transfer.
fhicl::ParameterSet getArtPset()
Get the ParameterSet to use to configure art.
TaskType
Type of the builder instance.
int source_start_
Rank of first source.
std::string node_name_
Name of this node, from MPI_Get_processor_name.
void print(std::ostream &ost) const
Dump configuration information (space delimited) to a stream.
int getSrcFriend() const
Get the corresponding source for this destination.
static const char * usage
String for command-line arguments.
int srcCount() const
Get the number of sources for this process.
int event_queue_size_
Size of the Event Queue.
int destCount() const
Get the number of destinations for this process.
TaskType type_
Type of this Builder application.
std::string typeName() const
Get the name of the type of this process.
int sources_
Count of source.
int sinks_
Count of sinks.
This Builder is a "Detector".
std::ostream & operator<<(std::ostream &ost, Config const &c)
Stream a Config object to the given stream.
This Builder is a "Source".
int getDestFriend() const
Get the corresponding destination for this source.
int srcStart() const
Get the rank of the first source for this process.
int total_procs_
Total number of processes.
int buffer_count_
Maximum number of simulatneous Fragments.
static int getArgRun(int argc, char *argv[])
Get the Run number from the command line.
int getArtArgc(int argc, char *argv[]) const
Gets the count of arguments after a – delimiter.
fhicl::ParameterSet makeParameterSet() const
Write a ParameterSet using configuration.
int rank_
Rank of this application.
bool use_artapp_
Whether to use art.
static double getArgSinks(int argc, char *argv[])
Get the sink count from the command line.
int detector_start_
Rank of first detector.
char ** art_argv_
Arguments used for art.
int sink_start_
Rank of first sink.
int offset_
Offset from the start rank for this type.
static void throwUsage(char *argv0, const std::string &msg)
Write the usage to cerr and throw an exception.
This Builder is a "Sink".
Helper class for configuring the builder test.
static double getArgDetectors(int argc, char *argv[])
Get the detectors count from the command line.
char ** getArtArgv(int argc, char *argv[]) const
Get the array of arguments after a – delimiter.
void printHeader(std::ostream &ost) const
Write configuration parameter names to a stream.
static int getArgQueueSize(int argc, char *argv[])
Get the Queue Size from the command line.
int art_argc_
Count of arguments used for art.
void writeInfo() const
Write information about this Config class to a file.
static std::string getProcessorName()
Call MPI_Get_processor_name.
int detectors_
Count of detectors.
Config(int rank, int nprocs, int buffer_count, size_t max_payload_size, int argc, char *argv[])
Config Constructor.
int destStart() const
Get the rank of the first destination for this process.