Skip to content

Commit 67ebd70

Browse files
committed
Remove usedFallback argument from (pre|post)(Open|Close)File signals
We can not give a meaningful value in the pre signals anyway, and there are use cases left for it in the post signals.
1 parent bc801da commit 67ebd70

File tree

16 files changed

+62
-65
lines changed

16 files changed

+62
-65
lines changed

FWCore/Framework/interface/InputSource.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ namespace edm {
290290

291291
class FileOpenSentry {
292292
public:
293-
typedef signalslot::Signal<void(std::string const&, bool)> Sig;
294-
explicit FileOpenSentry(InputSource const& source, std::string const& lfn, bool usedFallback);
293+
typedef signalslot::Signal<void(std::string const&)> Sig;
294+
explicit FileOpenSentry(InputSource const& source, std::string const& lfn);
295295
~FileOpenSentry();
296296

297297
FileOpenSentry(FileOpenSentry const&) = delete; // Disallow copying and moving
@@ -300,13 +300,12 @@ namespace edm {
300300
private:
301301
Sig& post_;
302302
std::string const& lfn_;
303-
bool usedFallback_;
304303
};
305304

306305
class FileCloseSentry {
307306
public:
308-
typedef signalslot::Signal<void(std::string const&, bool)> Sig;
309-
explicit FileCloseSentry(InputSource const& source, std::string const& lfn, bool usedFallback);
307+
typedef signalslot::Signal<void(std::string const&)> Sig;
308+
explicit FileCloseSentry(InputSource const& source, std::string const& lfn);
310309
~FileCloseSentry();
311310

312311
FileCloseSentry(FileCloseSentry const&) = delete; // Disallow copying and moving
@@ -315,7 +314,6 @@ namespace edm {
315314
private:
316315
Sig& post_;
317316
std::string const& lfn_;
318-
bool usedFallback_;
319317
};
320318

321319
signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> preEventReadFromSourceSignal_;

FWCore/Framework/src/InputSource.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -495,17 +495,17 @@ namespace edm {
495495
source_.actReg()->postSourceProcessBlockSignal_(processName_);
496496
}
497497

498-
InputSource::FileOpenSentry::FileOpenSentry(InputSource const& source, std::string const& lfn, bool usedFallback)
499-
: post_(source.actReg()->postOpenFileSignal_), lfn_(lfn), usedFallback_(usedFallback) {
500-
source.actReg()->preOpenFileSignal_(lfn, usedFallback);
498+
InputSource::FileOpenSentry::FileOpenSentry(InputSource const& source, std::string const& lfn)
499+
: post_(source.actReg()->postOpenFileSignal_), lfn_(lfn) {
500+
source.actReg()->preOpenFileSignal_(lfn);
501501
}
502502

503-
InputSource::FileOpenSentry::~FileOpenSentry() { post_(lfn_, usedFallback_); }
503+
InputSource::FileOpenSentry::~FileOpenSentry() { post_(lfn_); }
504504

505-
InputSource::FileCloseSentry::FileCloseSentry(InputSource const& source, std::string const& lfn, bool usedFallback)
506-
: post_(source.actReg()->postCloseFileSignal_), lfn_(lfn), usedFallback_(usedFallback) {
507-
source.actReg()->preCloseFileSignal_(lfn, usedFallback);
505+
InputSource::FileCloseSentry::FileCloseSentry(InputSource const& source, std::string const& lfn)
506+
: post_(source.actReg()->postCloseFileSignal_), lfn_(lfn) {
507+
source.actReg()->preCloseFileSignal_(lfn);
508508
}
509509

510-
InputSource::FileCloseSentry::~FileCloseSentry() { post_(lfn_, usedFallback_); }
510+
InputSource::FileCloseSentry::~FileCloseSentry() { post_(lfn_); }
511511
} // namespace edm

FWCore/MessageService/plugins/MessageLogger.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,9 @@ namespace edm {
748748
void MessageLogger::preSourceRunLumi() { establish("source"); }
749749
void MessageLogger::postSourceRunLumi() { unEstablish("AfterSource"); }
750750

751-
void MessageLogger::preFile(std::string const&, bool) { establish("file_open"); }
752-
void MessageLogger::preFileClose(std::string const&, bool) { establish("file_close"); }
753-
void MessageLogger::postFile(std::string const&, bool) { unEstablish("AfterFile"); }
751+
void MessageLogger::preFile(std::string const&) { establish("file_open"); }
752+
void MessageLogger::preFileClose(std::string const&) { establish("file_close"); }
753+
void MessageLogger::postFile(std::string const&) { unEstablish("AfterFile"); }
754754

755755
void MessageLogger::preEvent(StreamContext const& iContext) {
756756
assert(iContext.streamID().value() < transitionInfoCache_.size());

FWCore/MessageService/plugins/MessageLogger.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ namespace edm {
6363
void preSourceRunLumi();
6464
void postSourceRunLumi();
6565

66-
void preFile(std::string const&, bool);
67-
void preFileClose(std::string const&, bool);
68-
void postFile(std::string const&, bool);
66+
void preFile(std::string const&);
67+
void preFileClose(std::string const&);
68+
void postFile(std::string const&);
6969

7070
void preModuleConstruction(ModuleDescription const&);
7171
void postModuleConstruction(ModuleDescription const&);

FWCore/ServiceRegistry/interface/ActivityRegistry.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,31 +231,30 @@ namespace edm {
231231
AR_WATCH_USING_METHOD_1(watchPostSourceProcessBlock)
232232

233233
/// signal is emitted before the source opens a file
234-
typedef signalslot::Signal<void(std::string const&, bool)> PreOpenFile;
234+
typedef signalslot::Signal<void(std::string const&)> PreOpenFile;
235235
PreOpenFile preOpenFileSignal_;
236236
void watchPreOpenFile(PreOpenFile::slot_type const& iSlot) { preOpenFileSignal_.connect(iSlot); }
237-
AR_WATCH_USING_METHOD_2(watchPreOpenFile)
237+
AR_WATCH_USING_METHOD_1(watchPreOpenFile)
238238

239239
/// signal is emitted after the source opens a file
240240
// Note this is only done for a primary file, not a secondary one.
241-
typedef signalslot::Signal<void(std::string const&, bool)> PostOpenFile;
241+
typedef signalslot::Signal<void(std::string const&)> PostOpenFile;
242242
PostOpenFile postOpenFileSignal_;
243243
void watchPostOpenFile(PostOpenFile::slot_type const& iSlot) { postOpenFileSignal_.connect_front(iSlot); }
244-
AR_WATCH_USING_METHOD_2(watchPostOpenFile)
244+
AR_WATCH_USING_METHOD_1(watchPostOpenFile)
245245

246-
/// signal is emitted before the Closesource closes a file
246+
/// signal is emitted before the source closes a file
247247
// First argument is the LFN of the file which is being closed.
248-
// Second argument is false if fallback is used; true otherwise.
249-
typedef signalslot::Signal<void(std::string const&, bool)> PreCloseFile;
248+
typedef signalslot::Signal<void(std::string const&)> PreCloseFile;
250249
PreCloseFile preCloseFileSignal_;
251250
void watchPreCloseFile(PreCloseFile::slot_type const& iSlot) { preCloseFileSignal_.connect(iSlot); }
252-
AR_WATCH_USING_METHOD_2(watchPreCloseFile)
251+
AR_WATCH_USING_METHOD_1(watchPreCloseFile)
253252

254-
/// signal is emitted after the source opens a file
255-
typedef signalslot::Signal<void(std::string const&, bool)> PostCloseFile;
253+
/// signal is emitted after the source closes a file
254+
typedef signalslot::Signal<void(std::string const&)> PostCloseFile;
256255
PostCloseFile postCloseFileSignal_;
257256
void watchPostCloseFile(PostCloseFile::slot_type const& iSlot) { postCloseFileSignal_.connect_front(iSlot); }
258-
AR_WATCH_USING_METHOD_2(watchPostCloseFile)
257+
AR_WATCH_USING_METHOD_1(watchPostCloseFile)
259258

260259
typedef signalslot::Signal<void(StreamContext const&, ModuleCallingContext const&)> PreModuleBeginStream;
261260
PreModuleBeginStream preModuleBeginStreamSignal_;

FWCore/Services/plugins/CheckTransitions.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ namespace edm {
5353
void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&);
5454
void postEndJob();
5555

56-
void preOpenFile(std::string const&, bool);
56+
void preOpenFile(std::string const&);
5757

58-
void preCloseFile(std::string const& lfn, bool primary);
58+
void preCloseFile(std::string const& lfn);
5959

6060
void preGlobalBeginRun(GlobalContext const&);
6161

@@ -283,9 +283,9 @@ void CheckTransitions::postEndJob() {
283283
}
284284
}
285285

286-
void CheckTransitions::preOpenFile(std::string const& lfn, bool b) {}
286+
void CheckTransitions::preOpenFile(std::string const& lfn) {}
287287

288-
void CheckTransitions::preCloseFile(std::string const& lfn, bool b) {}
288+
void CheckTransitions::preCloseFile(std::string const& lfn) {}
289289

290290
void CheckTransitions::preGlobalBeginRun(GlobalContext const& gc) {
291291
auto id = gc.luminosityBlockID();

FWCore/Services/plugins/CondorStatusUpdater.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace edm {
6060
void beginPre(PathsAndConsumesOfModulesBase const &, ProcessContext const &processContext);
6161
void beginPost();
6262
void endPost();
63-
void filePost(std::string const &, bool);
63+
void filePost(std::string const &);
6464

6565
bool m_debug;
6666
std::atomic_flag m_shouldUpdate;
@@ -136,7 +136,7 @@ void CondorStatusService::runPost(GlobalContext const &) {
136136
update();
137137
}
138138

139-
void CondorStatusService::filePost(std::string const & /*lfn*/, bool /*usedFallback*/) {
139+
void CondorStatusService::filePost(std::string const & /*lfn*/) {
140140
m_files++;
141141
update();
142142
}

FWCore/Services/plugins/Timing.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ namespace edm {
7373
void preSourceRun(RunIndex);
7474
void postSourceRun(RunIndex);
7575

76-
void preOpenFile(std::string const&, bool);
77-
void postOpenFile(std::string const&, bool);
76+
void preOpenFile(std::string const&);
77+
void postOpenFile(std::string const&);
7878

7979
void preModule(ModuleDescription const& md);
8080
void postModule(ModuleDescription const& md);
@@ -553,9 +553,9 @@ namespace edm {
553553

554554
void Timing::postSourceRun(RunIndex index) { postCommon(); }
555555

556-
void Timing::preOpenFile(std::string const& lfn, bool b) { pushStack(configuredInTopLevelProcess_); }
556+
void Timing::preOpenFile(std::string const& lfn) { pushStack(configuredInTopLevelProcess_); }
557557

558-
void Timing::postOpenFile(std::string const& lfn, bool b) { postCommon(); }
558+
void Timing::postOpenFile(std::string const& lfn) { postCommon(); }
559559

560560
void Timing::preModule(ModuleDescription const&) { pushStack(configuredInTopLevelProcess_); }
561561

FWCore/Services/plugins/Tracer.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ namespace edm {
8888
void preSourceProcessBlock();
8989
void postSourceProcessBlock(std::string const&);
9090

91-
void preOpenFile(std::string const&, bool);
92-
void postOpenFile(std::string const&, bool);
91+
void preOpenFile(std::string const&);
92+
void postOpenFile(std::string const&);
9393

94-
void preCloseFile(std::string const& lfn, bool primary);
95-
void postCloseFile(std::string const&, bool);
94+
void preCloseFile(std::string const& lfn);
95+
void postCloseFile(std::string const&);
9696

9797
void preModuleBeginStream(StreamContext const&, ModuleCallingContext const&);
9898
void postModuleBeginStream(StreamContext const&, ModuleCallingContext const&);
@@ -603,24 +603,24 @@ void Tracer::postSourceProcessBlock(std::string const& processName) {
603603
<< " finished: source process block " << processName;
604604
}
605605

606-
void Tracer::preOpenFile(std::string const& lfn, bool b) {
606+
void Tracer::preOpenFile(std::string const& lfn) {
607607
LogAbsolute out("Tracer");
608608
out << TimeStamper(printTimestamps_);
609609
out << indention_ << indention_ << " starting: open input file: lfn = " << lfn;
610610
}
611611

612-
void Tracer::postOpenFile(std::string const& lfn, bool b) {
612+
void Tracer::postOpenFile(std::string const& lfn) {
613613
LogAbsolute out("Tracer");
614614
out << TimeStamper(printTimestamps_);
615615
out << indention_ << indention_ << " finished: open input file: lfn = " << lfn;
616616
}
617617

618-
void Tracer::preCloseFile(std::string const& lfn, bool b) {
618+
void Tracer::preCloseFile(std::string const& lfn) {
619619
LogAbsolute out("Tracer");
620620
out << TimeStamper(printTimestamps_);
621621
out << indention_ << indention_ << " starting: close input file: lfn = " << lfn;
622622
}
623-
void Tracer::postCloseFile(std::string const& lfn, bool b) {
623+
void Tracer::postCloseFile(std::string const& lfn) {
624624
LogAbsolute out("Tracer");
625625
out << TimeStamper(printTimestamps_);
626626
out << indention_ << indention_ << " finished: close input file: lfn = " << lfn;

HeterogeneousCore/CUDAServices/plugins/NVProfilerService.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ class NVProfilerService {
182182
void postModuleEventPrefetching(edm::StreamContext const&, edm::ModuleCallingContext const&);
183183

184184
// these signal pair are guaranteed to be called by the same thread
185-
void preOpenFile(std::string const&, bool);
186-
void postOpenFile(std::string const&, bool);
185+
void preOpenFile(std::string const&);
186+
void postOpenFile(std::string const&);
187187

188188
// these signal pair are guaranteed to be called by the same thread
189-
void preCloseFile(std::string const&, bool);
190-
void postCloseFile(std::string const&, bool);
189+
void preCloseFile(std::string const&);
190+
void postCloseFile(std::string const&);
191191

192192
// these signal pair are guaranteed to be called by the same thread
193193
void preSourceConstruction(edm::ModuleDescription const&);
@@ -585,25 +585,25 @@ void NVProfilerService::postSourceRun(edm::RunIndex index) {
585585
}
586586
}
587587

588-
void NVProfilerService::preOpenFile(std::string const& lfn, bool) {
588+
void NVProfilerService::preOpenFile(std::string const& lfn) {
589589
if (not skipFirstEvent_ or globalFirstEventDone_) {
590590
nvtxDomainRangePush(global_domain_, ("open file "s + lfn).c_str());
591591
}
592592
}
593593

594-
void NVProfilerService::postOpenFile(std::string const& lfn, bool) {
594+
void NVProfilerService::postOpenFile(std::string const& lfn) {
595595
if (not skipFirstEvent_ or globalFirstEventDone_) {
596596
nvtxDomainRangePop(global_domain_);
597597
}
598598
}
599599

600-
void NVProfilerService::preCloseFile(std::string const& lfn, bool) {
600+
void NVProfilerService::preCloseFile(std::string const& lfn) {
601601
if (not skipFirstEvent_ or globalFirstEventDone_) {
602602
nvtxDomainRangePush(global_domain_, ("close file "s + lfn).c_str());
603603
}
604604
}
605605

606-
void NVProfilerService::postCloseFile(std::string const& lfn, bool) {
606+
void NVProfilerService::postCloseFile(std::string const& lfn) {
607607
if (not skipFirstEvent_ or globalFirstEventDone_) {
608608
nvtxDomainRangePop(global_domain_);
609609
}

0 commit comments

Comments
 (0)