Skip to content
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

DD4hep: Sim Application Based on DD4hep #26823

Closed
wants to merge 4 commits into from

Conversation

ianna
Copy link
Contributor

@ianna ianna commented May 17, 2019

PR description:

  • Interim Sim Application implementation and its full configuration
  • Retrieving G4 production cuts, but not yet setting them
  • No sensitive volume assignment yet

Note: the code contains commented out fragments from original classes and it will be cleaned up when an equivalent functionality is provided. I'm submitting the code in order to migrate the developers area from 10_6 to 11.

PR validation:

The altered GEN_SIM step1 of a 10042.0 workflow runs fine(*) as follows. The events are empty due to an absence of sensitive volumes.

cmsRun SimG4Core/DD4hepGeometry/test/python/testZMM_13TeV_TuneCUETP8M1_cfi_GEN_SIM.py

*) if biglibs are disabled.

if this PR is a backport please specify the original PR:

no back port is needed

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-26823/9844

  • This PR adds an extra 56KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-26823/9858

  • This PR adds an extra 56KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @ianna (Ianna Osborne) for master.

It involves the following packages:

Configuration/Geometry
Configuration/StandardSequences
DetectorDescription/DDCMS
SimG4Core/Application
SimG4Core/Configuration
SimG4Core/DD4hepGeometry

@civanch, @Dr15Jones, @cvuosalo, @ianna, @mdhildreth, @cmsbuild, @franzoni, @kpedro88, @fabiocos, @davidlange6 can you please review it and eventually sign? Thanks.
@vargasa, @makortel, @felicepantaleo, @GiacomoSguazzoni, @rovere, @VinInn, @Martin-Grunewald, @dgulhan this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@ianna
Copy link
Contributor Author

ianna commented May 20, 2019

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 20, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/329/console Started: 2019/05/20 08:54

@cmsbuild
Copy link
Contributor

-1

Tested at: 476e437

You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c99017/329/summary.html

I found follow errors while testing this PR

Failed tests: ClangBuild

  • Clang:

I found compilation warning 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'

See details on the summary page.

@cmsbuild
Copy link
Contributor

Comparison not run due to Build errors/Fireworks only changes/No short matrix requested (RelVals and Igprof tests were also skipped)

@kpedro88
Copy link
Contributor

I'm not the only one who is working on the migration, so maintaining a separate test package is not an option.

@ianna the second statement does not follow from the first statement.

@davidlange6
Copy link
Contributor

davidlange6 commented May 21, 2019 via email

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@kpedro88
Copy link
Contributor

Here's the checkdeps from the latest test of this PR:

09:51:40 + git cms-checkdeps -A -a
09:51:44 >> Checking DetectorDescription/DDCMS CMSSW_11_0_X_2019-05-21-1100
09:51:44    x DetectorDescription/DDCMS/interface/DDSpecParRegistry.h
09:51:44    x DetectorDescription/DDCMS/plugins/DDTestSpecParsFilter.cc
09:51:44    x DetectorDescription/DDCMS/src/DDSpecparRegistry.cc
09:51:44 >> Checking SimG4Core/DD4hepGeometry CMSSW_11_0_X_2019-05-21-1100
09:51:44    - SimG4Core/DD4hepGeometry/plugins/DD4hep_GeometryESProducer.cc
09:51:44    x SimG4Core/DD4hepGeometry/BuildFile.xml
09:51:44    x SimG4Core/DD4hepGeometry/interface/DD4hep_DDDWorld.h
09:51:44    x SimG4Core/DD4hepGeometry/plugins/BuildFile.xml
09:51:44    x SimG4Core/DD4hepGeometry/src/DD4hep_DDDWorld.cc
09:51:44 >> Creating dummy files under /build/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_0_X_2019-05-21-1100/poison directory.
09:51:44    SimG4Core/DD4hepGeometry/plugins/DD4hep_GeometryESProducer.cc
09:51:44 Checking out these packages: 2
09:51:44 Geometry/DTGeometryBuilder (header)
09:51:44 Geometry/MuonNumbering (header)

The small changes in other packages from this PR could be included in CMSSW without a problem. My concern is the several thousand lines of duplicated sim code. There's no reason for this to entire the official repository.

@ianna
Copy link
Contributor Author

ianna commented May 21, 2019

@kpedro88 and @smuzaffar - I'd suggest to branch a separate IB for DD4hep migration.

@kpedro88
Copy link
Contributor

@ianna I remain unconvinced of the necessity of anything beyond a separate test repo (or equivalently a private CMSSW branch with the duplicated code in the SimG4Core/DD4hepGeometry package). Nothing depends on this new package, so this has virtually zero burden on developers. Your working area shows a bunch of unnecessary dependencies probably because you updated your branch by merging instead of rebasing.

@civanch
Copy link
Contributor

civanch commented May 21, 2019

@ianna, I would suggest schedule discussion at the next SIM meeting or offline. The ideal solution would be not a separate branch - for me no difference if it is a separate branch or a separate sub-package.

Why two different DDs may be called from RunManager? because it is only one connection point. Geometry should be defined during initialisation, in run time, SIM does not make any call to DD. So, the task is only to initialise things properly for one or another DD.

@ianna
Copy link
Contributor Author

ianna commented May 21, 2019

@kpedro88 - we have to duplicate the code to decouple current production version from a dev version to run fair comparison.
The current code is tightly coupled to the DD types and DD API: the records the plugins observe, the volume map, the logical volumes, etc. I also try to avoid circular dependencies - unavoidable if some of the classes reside where they are. In any case this package is a temporary solution.

@kpedro88
Copy link
Contributor

@ianna I understand that duplicating the code helps you iterate faster in the testing and migration. I just don't see a reason that the duplicated code has to be included in the official CMSSW (until the time when it is ready to enter production and the changes are moved to the original code).

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c99017/378/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 33
  • DQMHistoTests: Total histograms compared: 3206828
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3206492
  • DQMHistoTests: Total skipped: 334
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 32 files compared)
  • Checked 137 log files, 14 edm output root files, 33 DQM output files

@cvuosalo
Copy link
Contributor

A separate IB for DD4hep migration would appear to be a good compromise.

@davidlange6
Copy link
Contributor

davidlange6 commented May 21, 2019 via email

@kpedro88
Copy link
Contributor

The difference is that 100s of CMSSW packages depend on ROOT, while 0 packages depend on SimG4Core/DD4hepGeometry.

I am not just making a philosophical point here. I have done the entire GeantV integration and testing using a separate test repo https://github.com/kpedro88/SimGVCore. This affords the flexibility to try things and fix bugs without being tied to the CMSSW development cycle and maintenance requirements. Eventually, the final product can be brought over in a minimally intrusive way.

@kpedro88
Copy link
Contributor

It is a recommendation for what will be, in the end, the least burdensome way to proceed with testing migrated interfaces. I have no power to assign a cat A to do anything, nor do I think it would be necessary in this case. (What maintenance does a test repo require?)

If there is some reason that the approach I suggest will not work or will cause undesirable difficulty, it has not been communicated in this conversation in a way that I can understand.

@ianna
Copy link
Contributor Author

ianna commented May 22, 2019

+1

@civanch
Copy link
Contributor

civanch commented May 23, 2019

@ianna , SIM is using GEANT4 special branch for rolling tests of new Geant4 versions. It forbidden to make commits and PRs to this branch of CMSSW. This is a useful constrain to avoid diversity in software development.

Concerning DD: Geant4 geometry is static, in sense that it is created once at initialisation and changed in run time of SIM step. There are geometry description itself, materials, regions, production cuts, and sensitive detectors. The geometry is complex. Other SIM data are trivial, moreover, these additional properties should be added after the geometry is built, except materials, which likely are filled already with geometry. We have ~300 materials, ~25 regions and production cuts, ~10 sensitive detectors. These data are 1-dimensional data structures. For example, production cut requires from 1 to 4 double for each object. Total memory for these simple objects is negligible. The requirement to the parser is to create this small data structures (shared between threads). The code to assign logical volumes to these data exist and is correct, no sense rewrite it, you need only take part from CompactView and add to the new equivalent class. Using template it is easy to switch between CompactView and new equivalent class. Only this place should be changed in SIM packages - it is basically few lines of code.

@ianna
Copy link
Contributor Author

ianna commented May 23, 2019

@civanch - I'd like to remove SimG4Core/Physics package direct dependency on DetectorDescription/Core by moving DDG4ProductionCuts class to SimG4Core/Geometry. Please, let me know if you are ok with that. Thanks.

@civanch
Copy link
Contributor

civanch commented May 23, 2019

@ianna , please do this, it is more correct to move this class to SimG4Core/Geometry, do not forget to change SimG4Core/Application/RunManager* lenks to headers.

@ianna
Copy link
Contributor Author

ianna commented May 23, 2019

@civanch - ok, done here: #26901

@ianna
Copy link
Contributor Author

ianna commented May 30, 2019

Most of the functionality of this PR except for the sim application itself has been integrated in the IB. The latter is under discussion and will be submitted as a separate PR.

@ianna ianna closed this May 30, 2019
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.

None yet

6 participants