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);
64 boost::program_options::positional_options_description
p;
68 boost::program_options::options_description all_options(
"All Options");
69 all_options.add(
desc);
71 boost::program_options::variables_map vm;
73 store(boost::program_options::command_line_parser(
argc,
argv).
options(all_options).positional(
p).
run(), vm);
76 std::cout <<
argv[0] <<
": Error while trying to process command line arguments:\n"
77 << iException.what() <<
"\nFor usage and an options list, please do 'cmsRun --help'.";
87 std::cout <<
" no argument given" << std::endl;
92 std::cout <<
" no second argument given" << std::endl;
112 auto lockPtr = communicationChannel.
accessLock();
121 TCSerializer serializer(sm_buffer);
122 TCSerializer bl_serializer(sm_buffer);
125 TCDeserializer random_deserializer(sm_readbuffer);
127 std::cerr << uniqueID <<
" process: initializing " << std::endl;
132 for (
int i = 0;
i < nlines; ++
i) {
134 std::getline(std::cin,
c);
148 std::cerr << uniqueID <<
" process: done initializing" << std::endl;
154 switch (iTransition) {
156 std::cerr << uniqueID <<
" process: start beginLumi " << std::endl;
157 auto randState = random_deserializer.deserialize();
158 std::cerr <<
" state " << randState.seed_ << std::endl;
159 randomService->
setState(randState.state_, randState.seed_);
162 toSend.second.state_ = randomService->
getState();
163 toSend.second.seed_ = randomService->
mySeed();
164 bl_serializer.serialize(toSend);
165 std::cerr << uniqueID <<
" process: end beginLumi " << toSend.first.value << std::endl;
171 auto randState = random_deserializer.deserialize();
172 randomService->
setState(randState.state_, randState.seed_);
175 toSend.second.state_ = randomService->
getState();
176 toSend.second.seed_ = randomService->
mySeed();
179 serializer.serialize(toSend);
180 std::cerr << uniqueID <<
" process: " << toSend.first.value <<
" " <<
counter << std::endl;
188 std::cerr << uniqueID <<
" process: notifying and waiting" <<
counter << std::endl;
192 std::cerr <<
"caught exception \n" << iExcept.what() <<
"\n";