1 #include "boost/program_options.hpp" 46 auto lumi = tester_.testBeginLuminosityBlock(iLumi);
54 auto event = tester_.test();
62 auto lumi = tester_.testEndLuminosityBlock();
67 auto run = tester_.testEndRun();
82 descString +=
"] memory_name";
83 boost::program_options::options_description desc(descString);
90 boost::program_options::positional_options_description
p;
94 boost::program_options::options_description all_options(
"All Options");
95 all_options.add(desc);
97 boost::program_options::variables_map vm;
99 store(boost::program_options::command_line_parser(argc, argv).
options(all_options).positional(p).
run(), vm);
102 std::cout << argv[0] <<
": Error while trying to process command line arguments:\n" 103 << iException.what() <<
"\nFor usage and an options list, please do 'cmsRun --help'.";
118 std::cout <<
" no argument given" << std::endl;
123 std::cout <<
" no second argument given" << std::endl;
143 auto lockPtr = communicationChannel.
accessLock();
158 std::cerr << uniqueID <<
" process: initializing " << std::endl;
163 for (
int i = 0;
i < nlines; ++
i) {
165 std::getline(std::cin, c);
169 configuration += c +
"\n";
175 Harness harness(configuration, serviceToken);
181 std::cerr << uniqueID <<
" process: done initializing" << std::endl;
186 std::cerr << uniqueID <<
" process: waiting " << counter << std::endl;
189 switch (iTransition) {
192 std::cerr << uniqueID <<
" process: start beginRun " << std::endl;
194 std::cerr << uniqueID <<
" process: end beginRun " << std::endl;
200 std::cerr << uniqueID <<
" process: start beginLumi " << std::endl;
201 auto randState = random_deserializer.
deserialize();
203 std::cerr << uniqueID <<
" random " << randState.state_.size() <<
" " << randState.seed_ << std::endl;
204 randomService->
setState(randState.state_, randState.seed_);
207 value.randomState_.seed_ = randomService->
mySeed();
211 std::cerr << uniqueID <<
" process: end beginLumi " << std::endl;
213 std::cerr << uniqueID <<
" rand " <<
value.randomState_.state_.size() <<
" " <<
value.randomState_.seed_
219 std::cerr << uniqueID <<
" process: event " << counter << std::endl;
220 auto randState = random_deserializer.
deserialize();
221 randomService->
setState(randState.state_, randState.seed_);
224 value.randomState_.seed_ = randomService->
mySeed();
227 std::cerr << uniqueID <<
" process: event " << counter << std::endl;
232 <<
" " << counter << std::endl;
238 std::cerr << uniqueID <<
" process: start endLumi " << std::endl;
243 std::cerr << uniqueID <<
" process: end endLumi " << std::endl;
249 std::cerr << uniqueID <<
" process: start endRun " << std::endl;
254 std::cerr << uniqueID <<
" process: end endRun " << std::endl;
263 std::cerr << uniqueID <<
" process: notifying and waiting " << counter << std::endl;
267 std::cerr <<
"caught exception \n" << iExcept.what() <<
"\n";
edmtest::ThingCollection getEndLumiValue()
edmtest::ThingCollection getEventValue()
boost::interprocess::scoped_lock< boost::interprocess::named_mutex > * accessLock()
the lock is made accessible so that the WorkerMonitorThread can be used to unlock it in the event of ...
ExternalGeneratorEventInfo getEventValue()
static char const *const kHelpOpt
static char const *const kMemoryNameCommandOpt
edmtest::ThingCollection getBeginLumiValue(unsigned int iLumi)
void setState(std::vector< unsigned long > const &, long seed)
void serialize(T &iValue)
void handleTransitions(F &&iF)
GenRunInfoProduct getEndRunValue()
void setupSignalHandling()
Sets the unix signal handler which communicates with the thread.
static char const *const kMemoryNameOpt
void setAction(std::function< void()> iFunc)
static char const *const kHelpCommandOpt
GenLumiInfoProduct getEndLumiValue()
std::vector< unsigned long > getState() const
GenEventInfoProduct eventInfo_
BufferInfo * toWorkerBufferInfo()
This can be used with ReadBuffer to keep Controller and Worker in sync.
void workerSetupDone()
Matches the ControllerChannel::setupWorker call.
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
static char const *const kVerboseOpt
ExternalGeneratorLumiInfo getBeginLumiValue(unsigned int iLumi)
static char const *const kVerboseCommandOpt
std::uint32_t mySeed() const final
BufferInfo * fromWorkerBufferInfo()
This can be used with WriteBuffer to keep Controller and Worker in sync.
GenLumiInfoHeader header_
static char const *const kUniqueIDCommandOpt
Harness(std::string const &iConfig, edm::ServiceToken iToken)
edmtest::ThingCollection getEndRunValue()
static char const *const kUniqueIDOpt
static std::atomic< unsigned int > counter
int main(int argc, char *argv[])