1 #include "boost/program_options.hpp"
10 #include "DataFormats/TestObjects/interface/ToyProducts.h"
31 using SentType = std::pair<edmtest::IntProduct, edm::RandomNumberGeneratorState>;
40 auto lumi = tester_.testBeginLuminosityBlock(iLumi);
41 return *
lumi.get<edmtest::IntProduct>(
"lumi");
45 auto event = tester_.test();
46 return *
event.get<edmtest::IntProduct>();
57 descString +=
"] memory_name";
58 boost::program_options::options_description
desc(descString);
62 boost::program_options::value<std::string>(),
63 "memory name")(
kUniqueIDCommandOpt, boost::program_options::value<std::string>(),
"unique id");
65 boost::program_options::positional_options_description
p;
69 boost::program_options::options_description all_options(
"All Options");
70 all_options.add(
desc);
72 boost::program_options::variables_map vm;
74 store(boost::program_options::command_line_parser(
argc,
argv).
options(all_options).positional(
p).
run(), vm);
77 std::cout <<
argv[0] <<
": Error while trying to process command line arguments:\n"
78 << iException.what() <<
"\nFor usage and an options list, please do 'cmsRun --help'.";
88 std::cout <<
" no argument given" << std::endl;
93 std::cout <<
" no second argument given" << std::endl;
113 auto lockPtr = communicationChannel.
accessLock();
122 TCSerializer serializer(sm_buffer);
123 TCSerializer bl_serializer(sm_buffer);
126 TCDeserializer random_deserializer(sm_readbuffer);
128 std::cerr << uniqueID <<
" process: initializing " << std::endl;
133 for (
int i = 0;
i < nlines; ++
i) {
135 std::getline(std::cin,
c);
149 std::cerr << uniqueID <<
" process: done initializing" << std::endl;
155 switch (iTransition) {
157 std::cerr << uniqueID <<
" process: start beginLumi " << std::endl;
158 auto randState = random_deserializer.deserialize();
159 std::cerr <<
" state " << randState.seed_ << std::endl;
160 randomService->
setState(randState.state_, randState.seed_);
163 toSend.second.state_ = randomService->
getState();
164 toSend.second.seed_ = randomService->
mySeed();
165 bl_serializer.serialize(toSend);
166 std::cerr << uniqueID <<
" process: end beginLumi " << toSend.first.value << std::endl;
172 auto randState = random_deserializer.deserialize();
173 randomService->
setState(randState.state_, randState.seed_);
176 toSend.second.state_ = randomService->
getState();
177 toSend.second.seed_ = randomService->
mySeed();
180 serializer.serialize(toSend);
181 std::cerr << uniqueID <<
" process: " << toSend.first.value <<
" " <<
counter << std::endl;
189 std::cerr << uniqueID <<
" process: notifying and waiting" <<
counter << std::endl;
193 std::cerr <<
"caught exception \n" << iExcept.what() <<
"\n";