Skip to content

Move CPUServiceBase, RootHandlers, and TimingServiceBase to FWCore/AbstractServices #47466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef FWCore_Utilities_CPUServiceBase_h
#define FWCore_Utilities_CPUServiceBase_h
#ifndef FWCore_AbstractServices_interface_CPUServiceBase_h
#define FWCore_AbstractServices_interface_CPUServiceBase_h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not normally put _interface_ here. Should this be consistent or do you want to change all the other files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have already some headers with _interface_ in FWCore. 4.1 in https://cms-sw.github.io/cms_coding_rules.html#4--technical-coding-rules-1 has the wording

If necessary to create a unique name, one can add the directory name

Strictly speaking the _interface is not necessary here, as there are no other headers with the same file name in this package.

I think the question of including _interface_ or not when not strictly necessary is somewhat of a personal taste, and I'd be fine with us not being fully consistent with that.

// -*- C++ -*-
//
// Package: FWCore/Utilities
// Package: FWCore/AbstractServices
// Class : CPUServiceBase
//
/**\class edm::CPUServiceBase
Expand All @@ -23,8 +23,10 @@ namespace edm {
class CPUServiceBase {
public:
CPUServiceBase();
CPUServiceBase(const CPUServiceBase &) = delete; // stop default
const CPUServiceBase &operator=(const CPUServiceBase &) = delete; // stop default
CPUServiceBase(const CPUServiceBase &) = delete;
const CPUServiceBase &operator=(const CPUServiceBase &) = delete;
CPUServiceBase(CPUServiceBase &&) = delete;
const CPUServiceBase &operator=(CPUServiceBase &&) = delete;

virtual ~CPUServiceBase();
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef FWCore_Utilities_RootHandlers_h
#define FWCore_Utilities_RootHandlers_h
#ifndef FWCore_AbstractServices_interface_RootHandlers_h
#define FWCore_AbstractServices_interface_RootHandlers_h

#include "FWCore/Utilities/interface/propagate_const.h"
namespace edm {
Expand All @@ -20,7 +20,12 @@ namespace edm {
friend class edm::EventProcessor;

public:
virtual ~RootHandlers() {}
RootHandlers() = default;
RootHandlers(RootHandlers const&) = delete;
RootHandlers& operator=(RootHandlers const&) = delete;
RootHandlers(RootHandlers&&) = delete;
RootHandlers& operator=(RootHandlers&&) = delete;
virtual ~RootHandlers() = default;

template <typename F>
void ignoreWarningsWhileDoing(F iFunc, SeverityLevel level = SeverityLevel::kWarning) {
Expand All @@ -36,4 +41,4 @@ namespace edm {
};
} // end of namespace edm

#endif // InitRootHandlers_H
#endif
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef FWCore_Utilities_TimingServiceBase_h
#define FWCore_Utilities_TimingServiceBase_h
#ifndef FWCore_AbstractServices_interface_TimingServiceBase_h
#define FWCore_AbstractServices_interface_TimingServiceBase_h
// -*- C++ -*-
//
// Package: FWCore/Utilities
// Package: FWCore/AbstractServices
// Class : TimingServiceBase
//
/**\class TimingServiceBase TimingServiceBase.h "TimingServiceBase.h"
Expand All @@ -29,8 +29,10 @@ namespace edm {
class TimingServiceBase {
public:
TimingServiceBase();
TimingServiceBase(const TimingServiceBase&) = delete; // stop default
const TimingServiceBase& operator=(const TimingServiceBase&) = delete; // stop default
TimingServiceBase(const TimingServiceBase&) = delete;
const TimingServiceBase& operator=(const TimingServiceBase&) = delete;
TimingServiceBase(TimingServiceBase&&) = delete;
const TimingServiceBase& operator=(TimingServiceBase&&) = delete;
virtual ~TimingServiceBase();

// ---------- member functions ---------------------------
Expand Down
18 changes: 18 additions & 0 deletions FWCore/AbstractServices/src/CPUServiceBase.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// -*- C++ -*-
//
// Package: FWCore/AbstractServices
// Class : CPUServiceBase
//
// Implementation:
// Stub class information for CPU service.
//
// Original Author: Brian Bockelman
// Created: Wed Sep 7 12:05:13 CDT 2016
//

#include "FWCore/AbstractServices/interface/CPUServiceBase.h"

namespace edm {
CPUServiceBase::CPUServiceBase() = default;
CPUServiceBase::~CPUServiceBase() = default;
} // namespace edm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -*- C++ -*-
//
// Package: Subsystem/Package
// Package: FWCore/AbstractServices
// Class : TimingServiceBase
//
// Implementation:
Expand All @@ -15,7 +15,7 @@
#include <sys/time.h>

// user include files
#include "FWCore/Utilities/interface/TimingServiceBase.h"
#include "FWCore/AbstractServices/interface/TimingServiceBase.h"

using namespace edm;
//
Expand All @@ -32,6 +32,6 @@ void TimingServiceBase::jobStarted() {
//
// constructors and destructor
//
TimingServiceBase::TimingServiceBase() {}
TimingServiceBase::TimingServiceBase() = default;

TimingServiceBase::~TimingServiceBase() {}
TimingServiceBase::~TimingServiceBase() = default;
7 changes: 7 additions & 0 deletions FWCore/Framework/bin/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<use name="tbb"/>
<use name="boost"/>
<use name="boost_program_options"/>
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/PluginManager"/>
Expand All @@ -17,6 +18,7 @@
<use name="boost"/>
<use name="boost_program_options"/>
<use name="tcmalloc_minimal"/>
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/PluginManager"/>
Expand All @@ -31,6 +33,7 @@
<use name="boost"/>
<use name="boost_program_options"/>
<use name="jemalloc"/>
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/PluginManager"/>
Expand All @@ -46,6 +49,7 @@
<use name="boost"/>
<use name="boost_program_options"/>
<use name="jemalloc"/>
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/PluginManager"/>
Expand All @@ -60,6 +64,7 @@
<use name="boost"/>
<use name="boost_program_options"/>
<use name="jemalloc"/>
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/PluginManager"/>
Expand All @@ -74,6 +79,7 @@
<use name="boost"/>
<use name="boost_program_options"/>
<use name="gperf_tcmalloc_and_profiler"/>
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/PluginManager"/>
Expand All @@ -88,6 +94,7 @@
<use name="boost"/>
<use name="boost_program_options"/>
<use name="jemalloc-prof"/>
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/PluginManager"/>
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/bin/cmsRun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ This is a generic main that can be used with any plugin and a
PSet script. See notes in EventProcessor.cpp for details about it.
----------------------------------------------------------------------*/

#include "FWCore/AbstractServices/interface/TimingServiceBase.h"
#include "FWCore/Framework/interface/CmsRunParser.h"
#include "FWCore/Framework/interface/EventProcessor.h"
#include "FWCore/Framework/interface/defaultCmsRunServices.h"
Expand All @@ -26,7 +27,6 @@ PSet script. See notes in EventProcessor.cpp for details about it.
#include "FWCore/Utilities/interface/EDMException.h"
#include "FWCore/Utilities/interface/ConvertException.h"
#include "FWCore/Utilities/interface/Presence.h"
#include "FWCore/Utilities/interface/TimingServiceBase.h"
#include "FWCore/Utilities/interface/thread_safety_macros.h"

#include "TError.h"
Expand Down
3 changes: 2 additions & 1 deletion FWCore/Framework/src/EventProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
#include "FWCore/ParameterSet/interface/Registry.h"
#include "FWCore/ParameterSet/interface/validateTopLevelParameterSets.h"

#include "FWCore/AbstractServices/interface/RootHandlers.h"

#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/ServiceRegistry/interface/StreamContext.h"
Expand All @@ -74,7 +76,6 @@
#include "FWCore/Utilities/interface/UnixSignalHandlers.h"
#include "FWCore/Utilities/interface/ExceptionCollector.h"
#include "FWCore/Utilities/interface/StreamID.h"
#include "FWCore/Utilities/interface/RootHandlers.h"
#include "FWCore/Utilities/interface/propagate_const.h"
#include "FWCore/Utilities/interface/thread_safety_macros.h"

Expand Down
2 changes: 1 addition & 1 deletion FWCore/Services/plugins/CPU.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Original Author: Natalia Garcia
// CPU.cc: v 1.0 2009/01/08 11:31:07

#include "FWCore/AbstractServices/interface/CPUServiceBase.h"
#include "FWCore/AbstractServices/interface/ResourceInformation.h"
#include "FWCore/MessageLogger/interface/JobReport.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
Expand All @@ -16,7 +17,6 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Utilities/interface/CPUServiceBase.h"

#include "cpu_features/cpu_features_macros.h"

Expand Down
2 changes: 1 addition & 1 deletion FWCore/Services/plugins/CondorStatusUpdater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include "DataFormats/Provenance/interface/ModuleDescription.h"
#include "DataFormats/Provenance/interface/ParameterSetID.h"
#include "FWCore/AbstractServices/interface/ResourceInformation.h"
#include "FWCore/AbstractServices/interface/TimingServiceBase.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/TimingServiceBase.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/ServiceRegistry/interface/ProcessContext.h"
#include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Services/plugins/InitRootHandlers.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "FWCore/Utilities/interface/RootHandlers.h"
#include "FWCore/AbstractServices/interface/RootHandlers.h"

#include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
#include "FWCore/ServiceRegistry/interface/SystemBounds.h"
Expand Down
5 changes: 2 additions & 3 deletions FWCore/Services/plugins/Timing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
// Original Author: Jim Kowalkowski
//

#include "FWCore/ServiceRegistry/interface/ServiceMaker.h"

#include "FWCore/Utilities/interface/TimingServiceBase.h"
#include "DataFormats/Provenance/interface/ModuleDescription.h"
#include "FWCore/AbstractServices/interface/TimingServiceBase.h"
#include "FWCore/MessageLogger/interface/JobReport.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
Expand All @@ -20,6 +18,7 @@
#include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
#include "FWCore/ServiceRegistry/interface/GlobalContext.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/ServiceRegistry/interface/ServiceMaker.h"
#include "FWCore/ServiceRegistry/interface/StreamContext.h"
#include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h"
#include "FWCore/ServiceRegistry/interface/ESModuleCallingContext.h"
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Services/plugins/tracer_setupFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "FWCore/Framework/interface/IOVSyncValue.h"
#include "FWCore/Framework/interface/ESRecordsToProductResolverIndices.h"

#include "FWCore/Utilities/interface/TimingServiceBase.h"
#include "FWCore/AbstractServices/interface/TimingServiceBase.h"

using namespace edm::service::monitor_file_utilities;

Expand Down
19 changes: 0 additions & 19 deletions FWCore/Utilities/src/CPUServiceBase.cc

This file was deleted.

1 change: 1 addition & 0 deletions IOPool/Common/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<use name="FWCore/AbstractServices"/>
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<export>
Expand Down
2 changes: 1 addition & 1 deletion IOPool/Common/src/RootServiceChecker.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "IOPool/Common/interface/RootServiceChecker.h"
#include "FWCore/AbstractServices/interface/RootHandlers.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include "FWCore/Utilities/interface/RootHandlers.h"

namespace edm {
RootServiceChecker::RootServiceChecker() {
Expand Down
1 change: 1 addition & 0 deletions IOPool/Output/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<use name="tbb"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/Provenance"/>
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
Expand Down
2 changes: 1 addition & 1 deletion IOPool/Output/src/RootOutputTree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

#include "DataFormats/Common/interface/RefCoreStreamer.h"
#include "DataFormats/Provenance/interface/ProductDescription.h"
#include "FWCore/AbstractServices/interface/RootHandlers.h"
#include "FWCore/MessageLogger/interface/JobReport.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Algorithms.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include "FWCore/Utilities/interface/RootHandlers.h"
#include "FWCore/Catalog/interface/SiteLocalConfig.h"
#include "FWCore/ServiceRegistry/interface/Service.h"

Expand Down
3 changes: 2 additions & 1 deletion PerfTools/AllocMonitor/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<use name="FWCore/AbstractServices"/>
<use name="FWCore/Concurrency"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ServiceRegistry"/>
<use name="PerfTools/AllocMonitor"/>
<use name="FWCore/Concurrency"/>
2 changes: 1 addition & 1 deletion PerfTools/AllocMonitor/plugins/moduleAlloc_setupFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "FWCore/Framework/interface/IOVSyncValue.h"
#include "FWCore/Framework/interface/ESRecordsToProductResolverIndices.h"

#include "FWCore/Utilities/interface/TimingServiceBase.h"
#include "FWCore/AbstractServices/interface/TimingServiceBase.h"

#include "ThreadAllocInfo.h"

Expand Down