Skip to content

Conversation

@hyunyong
Copy link
Contributor

PR description:

esConsumes migration for the muon alignment modules.

PR validation:

PR has an issue.

I try to use consumesCollector() for Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc (https://github.com/hyunyong/cmssw/blob/76328c9d2b24b0365d41fbff38ac6208e590e249/Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc#L93)
However, es tokens are initialized at https://github.com/hyunyong/cmssw/blob/76328c9d2b24b0365d41fbff38ac6208e590e249/Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc#L168

I guess this is the reason why I got this issue.

A module declared it consumes an EventSetup product after its constructor.
This must be done in the constructor

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35659/25929

  • This PR adds an extra 60KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @hyunyong for master.

It involves the following packages:

  • Alignment/MuonAlignment (alca)
  • Alignment/MuonAlignmentAlgorithms (alca)
  • Alignment/SurveyAnalysis (alca)

@cmsbuild, @malbouis, @tvami, @yuanchao, @francescobrivio can you please review it and eventually sign? Thanks.
@pakhotin, @adewit, @abbiendi, @jhgoh, @tocheng, @tlampen, @mmusich, @trocino this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@tvami
Copy link
Contributor

tvami commented Oct 13, 2021

@makortel can you please help out with the error msg reported in the PR description?

@tvami
Copy link
Contributor

tvami commented Oct 13, 2021

@cmsbuild , please test

  • let's see if the unit tests also crash or not

@cmsbuild
Copy link
Contributor

-1

Failed Tests: Build ClangBuild
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f57575/19609/summary.html
COMMIT: 76328c9
CMSSW: CMSSW_12_1_X_2021-10-13-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/35659/19609/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I found compilation error when building:

>> Building  edm plugin tmp/slc7_amd64_gcc900/src/Alignment/MuonAlignment/plugins/MuonGeometryArrange/libMuonGeometryArrange.so
/cvmfs/cms-ib.cern.ch/nweek-02702/slc7_amd64_gcc900/external/gcc/9.3.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/9.3.0/../../../../x86_64-unknown-linux-gnu/bin/ld: tmp/slc7_amd64_gcc900/src/Alignment/MuonAlignment/plugins/MuonGeometryArrange/MuonGeometryArrange.cc.o: in function `MuonGeometryArrange::analyze(edm::Event const&, edm::EventSetup const&)':
MuonGeometryArrange.cc:(.text+0x5eba): undefined reference to `MuonAlignmentInputXML::MuonAlignmentInputXML(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >, edm::ConsumesCollector)'
/cvmfs/cms-ib.cern.ch/nweek-02702/slc7_amd64_gcc900/external/gcc/9.3.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/9.3.0/../../../../x86_64-unknown-linux-gnu/bin/ld: MuonGeometryArrange.cc:(.text+0x5f4f): undefined reference to `MuonAlignmentInputXML::MuonAlignmentInputXML(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >, edm::ConsumesCollector)'
/cvmfs/cms-ib.cern.ch/nweek-02702/slc7_amd64_gcc900/external/gcc/9.3.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/9.3.0/../../../../x86_64-unknown-linux-gnu/bin/ld: MuonGeometryArrange.cc:(.text+0x5fe0): undefined reference to `MuonAlignmentInputXML::MuonAlignmentInputXML(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >, edm::ConsumesCollector)'
collect2: error: ld returned 1 exit status
gmake: *** [tmp/slc7_amd64_gcc900/src/Alignment/MuonAlignment/plugins/MuonGeometryArrange/libMuonGeometryArrange.so] Error 1
Leaving library rule at src/Alignment/MuonAlignment/plugins
Entering library rule at src/Alignment/MuonAlignment/plugins
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_12_1_X_2021-10-13-1100/src/Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc
>> Building  edm plugin tmp/slc7_amd64_gcc900/src/Alignment/MuonAlignment/plugins/MuonGeometryDBConverter/libMuonGeometryDBConverter.so


Clang Build

I found compilation error while trying to compile with clang. Command used:

USER_CUDA_FLAGS='--expt-relaxed-constexpr' USER_CXXFLAGS='-Wno-register -fsyntax-only' scram build -k -j 32 COMPILER='llvm compile'

>> Compiling  /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_12_1_X_2021-10-13-1100/src/Alignment/MuonAlignment/src/MuonAlignmentInputMethod.cc
>> Compiling  /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_12_1_X_2021-10-13-1100/src/Alignment/MuonAlignment/src/MuonAlignmentInputSurveyDB.cc
>> Compiling  /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_12_1_X_2021-10-13-1100/src/Alignment/MuonAlignment/src/MuonAlignmentOutputXML.cc
>> Compiling  /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_12_1_X_2021-10-13-1100/src/Alignment/MuonAlignment/src/MuonAlignmentInputXML.cc
>> Compiling  /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_12_1_X_2021-10-13-1100/src/Alignment/MuonAlignment/src/MuonScenarioBuilder.cc
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_12_1_X_2021-10-13-1100/src/Alignment/MuonAlignment/src/MuonAlignmentOutputXML.cc:42:25: error: out-of-line definition of 'MuonAlignmentOutputXML' does not match any declaration in 'MuonAlignmentOutputXML'
MuonAlignmentOutputXML::MuonAlignmentOutputXML(const edm::ParameterSet &iConfig)
                        ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
gmake: *** [tmp/slc7_amd64_gcc900/src/Alignment/MuonAlignment/src/AlignmentMuonAlignment/MuonAlignmentOutputXML.cc.o] Error 1
Entering library rule at src/Alignment/MuonAlignment/test


class MuonAlignment {
public:
MuonAlignment(const edm::EventSetup& iSetup);
MuonAlignment(const edm::EventSetup& iSetup, edm::ConsumesCollector iC);
Copy link
Contributor

@makortel makortel Oct 13, 2021

Choose a reason for hiding this comment

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

The problem lies here. As the error message says, all consumes declarations must be done in EDModule (or ESProducer) constructor, or in functions called from the constructor. Therefore, any function that takes EventSetup (not available at module construction time) and ConsumesCollector (not usable outside module construction time) will not work.

This implies that the code needs to be organized differently. Based on a quick look on how MuonAlignment is used, I'd look into moving the construction of MuonAlignment to the constructors of the EDModules, and passing in the EventSetup in a member function call instead of the constructor.

Copy link
Contributor

Choose a reason for hiding this comment

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

@hyunyong any updates on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hyunyong any updates on this?
I'm testing and validating updates.
I will close this PR and make a new one.


const edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeoToken_;

edm::ConsumesCollector m_cc;
Copy link
Contributor

Choose a reason for hiding this comment

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

Never make a copy of the ConsumesCollector


DTSurveyConvert::DTSurveyConvert(const edm::ParameterSet &iConfig) : muonGeoToken_(esConsumes()) {
DTSurveyConvert::DTSurveyConvert(const edm::ParameterSet &iConfig)
: muonGeoToken_(esConsumes()), m_cc(consumesCollector()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Never copy a ConsumesCollector. It must be used in the constructors.

@tvami
Copy link
Contributor

tvami commented Oct 15, 2021

@hyunyong please also update the title to "Draft: esConsumes migration for the muon alignment modules" thanks

@tvami
Copy link
Contributor

tvami commented Oct 16, 2021

-alca

@hyunyong
Copy link
Contributor Author

I will make a new PR.

@hyunyong
Copy link
Contributor Author

I made a new PR #35719

@hyunyong hyunyong closed this Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants