34 #include "tbb/concurrent_vector.h" 120 std::vector<std::tuple<Phase,edm::EventID,int>> expectedValues(std::vector<std::pair<Transition,edm::EventID>>
const& iTrans,
int iNStreams ) {
121 std::vector<std::tuple<Phase,edm::EventID,int>> returnValue;
122 returnValue.reserve(iTrans.size());
127 for(
auto const& tran: iTrans) {
135 if(tran.second != lastRun) {
136 if(lastRun.
run() != maxIDValue) {
138 for(
int i = 0;
i<iNStreams;++
i) {
145 for(
int i = 0;
i<iNStreams;++
i) {
148 lastRun = tran.second;
154 if(tran.second != lastLumi) {
155 if(lastLumi.
run() != maxIDValue) {
157 for(
int i = 0;
i<iNStreams;++
i) {
164 for(
int i = 0;
i<iNStreams;++
i) {
167 lastLumi = tran.second;
183 if(lastLumi.
run() != maxIDValue) {
185 for(
int i = 0;
i<iNStreams;++
i) {
190 if(lastRun.
run() != maxIDValue) {
192 for(
int i = 0;
i<iNStreams;++
i) {
206 p.getUntrackedParameter<
EventID>(
"id"));
245 desc.
setComment(
"Checks that the transitions specified occur during the job.");
251 descriptions.
add(
"CheckTransitions", desc);
264 std::vector<std::tuple<Phase,edm::EventID,int>> orderedSeen;
268 auto s = std::get<2>(
i);
269 if(std::get<1>(
i).event() > 0) {
272 orderedSeen.emplace_back(std::get<0>(
i),std::get<1>(
i),
s);
274 std::sort(orderedSeen.begin(),orderedSeen.end());
276 auto orderedExpected = expectedV;
277 std::sort(orderedExpected.begin(),orderedExpected.end());
282 auto itOS = orderedSeen.begin();
283 for(
auto itOE = orderedExpected.begin(); itOE != orderedExpected.end(); ++itOE) {
284 if(itOS == orderedSeen.end()) {
287 if ( *itOE != *itOS) {
288 auto syncOE = std::get<1>(*itOE);
289 auto syncOS = std::get<1>(*itOS);
290 std::cout <<
"Different ordering "<<syncOE<<
" "<<std::get<2>(*itOE)<<
"\n" 291 <<
" "<<syncOS<<
" "<<std::get<2>(*itOS)<<
"\n";
297 if(orderedSeen.size() != orderedExpected.size()) {
298 std::cout <<
"Wrong number of transition "<<orderedSeen.size() <<
" "<<orderedExpected.size()<<std::endl;
T getUntrackedParameter(std::string const &, T const &) const
void watchPreEvent(PreEvent::slot_type const &iSlot)
CheckTransitions(const ParameterSet &, ActivityRegistry &)
void preBeginJob(PathsAndConsumesOfModulesBase const &, ProcessContext const &)
void watchPreallocate(Preallocate::slot_type const &iSlot)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
static RunNumber_t maxRunNumber()
~CheckTransitions()(false)
void watchPreGlobalEndLumi(PreGlobalEndLumi::slot_type const &iSlot)
LuminosityBlockID const & luminosityBlockID() const
void watchPreStreamEndRun(PreStreamEndRun::slot_type const &iSlot)
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
void preStreamEndLumi(StreamContext const &)
void watchPreStreamEndLumi(PreStreamEndLumi::slot_type const &iSlot)
std::vector< std::pair< Transition, edm::EventID > > m_expectedTransitions
void preEvent(StreamContext const &)
void preStreamEndRun(StreamContext const &)
void preStreamBeginLumi(StreamContext const &)
unsigned int maxNumberOfStreams() const
void watchPreOpenFile(PreOpenFile::slot_type const &iSlot)
void setComment(std::string const &value)
void watchPreGlobalEndRun(PreGlobalEndRun::slot_type const &iSlot)
void preGlobalEndRun(GlobalContext const &)
void preGlobalBeginRun(GlobalContext const &)
StreamID const & streamID() const
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
#define DEFINE_FWK_SERVICE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void watchPreCloseFile(PreCloseFile::slot_type const &iSlot)
void watchPreStreamBeginLumi(PreStreamBeginLumi::slot_type const &iSlot)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void preGlobalBeginLumi(GlobalContext const &)
void preOpenFile(std::string const &, bool)
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
void preStreamBeginRun(StreamContext const &)
void preGlobalEndLumi(GlobalContext const &)
tbb::concurrent_vector< std::tuple< Phase, edm::EventID, int > > m_seenTransitions
void preallocate(service::SystemBounds const &)
EventID const & eventID() const
ParameterDescriptionBase * addVPSetUntracked(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
void preCloseFile(std::string const &lfn, bool primary)