65 descString +=
"] memory_name";
66 boost::program_options::options_description desc(descString);
72 boost::program_options::positional_options_description
p;
76 boost::program_options::options_description all_options(
"All Options");
77 all_options.add(desc);
79 boost::program_options::variables_map vm;
81 store(boost::program_options::command_line_parser(
argc,
argv).
options(all_options).positional(p).
run(), vm);
84 std::cout <<
argv[0] <<
": Error while trying to process command line arguments:\n" 85 << iException.what() <<
"\nFor usage and an options list, please do 'cmsRun --help'.";
95 std::cout <<
" no argument given" << std::endl;
100 std::cout <<
" no second argument given" << std::endl;
118 WriteBuffer sm_buffer{memoryName, communicationChannel.fromWorkerBufferInfo()};
122 auto lockPtr = communicationChannel.accessLock();
131 TCSerializer serializer(sm_buffer);
132 TCSerializer br_serializer(sm_buffer);
133 TCSerializer bl_serializer(sm_buffer);
134 TCSerializer el_serializer(sm_buffer);
135 TCSerializer er_serializer(sm_buffer);
137 std::cerr << uniqueID <<
" process: initializing " << std::endl;
142 for (
int i = 0;
i < nlines; ++
i) {
144 std::getline(std::cin, c);
146 configuration += c +
"\n";
149 Harness harness(configuration);
154 std::cerr << uniqueID <<
" process: done initializing" << std::endl;
155 communicationChannel.workerSetupDone();
157 std::cerr << uniqueID <<
" process: waiting " << counter << std::endl;
158 communicationChannel.handleTransitions([&](
edm::Transition iTransition,
unsigned long long iTransitionID) {
160 switch (iTransition) {
162 std::cerr << uniqueID <<
" process: start beginRun " << std::endl;
163 auto value = harness.getBeginRunValue(iTransitionID);
165 br_serializer.serialize(
value);
166 std::cerr << uniqueID <<
" process: end beginRun " <<
value.size() << std::endl;
171 std::cerr << uniqueID <<
" process: start beginLumi " << std::endl;
172 auto value = harness.getBeginLumiValue(iTransitionID);
174 bl_serializer.serialize(
value);
175 std::cerr << uniqueID <<
" process: end beginLumi " <<
value.size() << std::endl;
180 std::cerr << uniqueID <<
" process: integrating " << counter << std::endl;
181 auto value = harness.getEventValue();
183 std::cerr << uniqueID <<
" process: integrated " << counter << std::endl;
185 serializer.serialize(
value);
186 std::cerr << uniqueID <<
" process: " <<
value.size() <<
" " << counter << std::endl;
191 std::cerr << uniqueID <<
" process: start endLumi " << std::endl;
192 auto value = harness.getEndLumiValue();
194 el_serializer.serialize(
value);
195 std::cerr << uniqueID <<
" process: end endLumi " <<
value.size() << std::endl;
200 std::cerr << uniqueID <<
" process: start endRun " << std::endl;
201 auto value = harness.getEndRunValue();
203 er_serializer.serialize(
value);
204 std::cerr << uniqueID <<
" process: end endRun " <<
value.size() << std::endl;
212 std::cerr << uniqueID <<
" process: notifying and waiting" << counter << std::endl;
216 std::cerr <<
"caught exception \n" << iExcept.what() <<
"\n";
void setupSignalHandling()
Sets the unix signal handler which communicates with the thread.
void setAction(std::function< void()> iFunc)
static char const *const kUniqueIDCommandOpt
static char const *const kUniqueIDOpt
static char const *const kMemoryNameOpt
static std::atomic< unsigned int > counter
static char const *const kMemoryNameCommandOpt
static char const *const kHelpOpt
static char const *const kHelpCommandOpt