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

Add and use preprocessors macros for loop unrolling #32499

Merged
merged 2 commits into from
Dec 16, 2020

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Dec 15, 2020

PR description:

Define preprocessor macros that exoand to pragmas controlling loop unrolling.
Two set of macrso are defined:

  • CMS_UNROLL_LOOP and friends are applied on both host and device compilation
  • CMS_DEVICE_UNROLL_LOOP and friends are only applied in device compilation, and expand to nothing on the host

The supported compilers are

  • CUDA nvcc
  • HIP (untested)
  • gcc
  • clang

Use CMS_UNROLL_LOOP instead of #pragma unroll.

PR validation:

None.

Define preprocessor macros that exoand to pragmas controlling loop unrolling.
Two set of macrso are defined:
  - CMS_UNROLL_LOOP and friends are applied on both host and device compilation
  - CMS_DEVICE_UNROLL_LOOP and friends is only applied in device compilation,
    and expands to nothing on the host

The supported compilers are
  - CUDA nvcc
  - HIP (untested)
  - gcc
  - clang
@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 15, 2020

please test

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 15, 2020

@makortel FYI

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32499/20425

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @fwyzard (Andrea Bocci) for master.

It involves the following packages:

DataFormats/CaloRecHit
FWCore/Utilities
HeterogeneousCore/CUDAUtilities
RecoLocalCalo/HcalRecProducers

@perrotta, @smuzaffar, @Dr15Jones, @makortel, @fwyzard, @slava77, @jpata can you please review it and eventually sign? Thanks.
@makortel, @felicepantaleo, @rovere, @apsallid, @wddgit, @mariadalfonso, @abdoulline this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 16, 2020

The error is likely unrelated:

>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/plugins/Herwig7Hadronizer.cc
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/interface/Herwig7Interface.h:22,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/plugins/Herwig7Hadronizer.cc:27:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/interface/HerwigUIProvider.h:7:10: fatal error: Herwig/API/HerwigUI.h: No such file or directory
    7 | #include <Herwig/API/HerwigUI.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake: *** [tmp/slc7_amd64_gcc900/src/GeneratorInterface/Herwig7Interface/plugins/GeneratorInterfaceHerwig7HadronizerPlugins/Herwig7Hadronizer.cc.o] Error 1

@cmsbuild
Copy link
Contributor

-1

Failed Tests: Build HeaderConsistency ClangBuild
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fc1eb9/11723/summary.html
CMSSW: CMSSW_11_3_X_2020-12-15-1100/slc7_amd64_gcc900

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fc1eb9/11723/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fc1eb9/11723/git-merge-result

Build

I found compilation error when building:

>> Package GeneratorInterface/Herwig7Interface built
Entering library rule at src/GeneratorInterface/Herwig7Interface/plugins
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/plugins/Herwig7Hadronizer.cc
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/interface/Herwig7Interface.h:22,
                 from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/plugins/Herwig7Hadronizer.cc:27:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/interface/HerwigUIProvider.h:7:10: fatal error: Herwig/API/HerwigUI.h: No such file or directory
    7 | #include 
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake: *** [tmp/slc7_amd64_gcc900/src/GeneratorInterface/Herwig7Interface/plugins/GeneratorInterfaceHerwig7HadronizerPlugins/Herwig7Hadronizer.cc.o] Error 1
>> Building  edm plugin tmp/slc7_amd64_gcc900/src/GeneratorInterface/Herwig7Interface/plugins/GeneratorInterfaceHerwig7HadronizerPlugins/libGeneratorInterfaceHerwig7HadronizerPlugins.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'

>> Entering Package GeneratorInterface/Herwig7Interface
Entering library rule at src/GeneratorInterface/Herwig7Interface/plugins
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/plugins/Herwig7Hadronizer.cc
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/plugins/Herwig7Hadronizer.cc:27:
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/interface/Herwig7Interface.h:22:
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/interface/HerwigUIProvider.h:7:10: fatal error: 'Herwig/API/HerwigUI.h' file not found
#include 
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/plugins/Herwig7Hadronizer.cc:27:
In file included from /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_11_3_X_2020-12-15-1100/src/GeneratorInterface/Herwig7Interface/interface/Herwig7Interface.h:22:


@fwyzard
Copy link
Contributor Author

fwyzard commented Dec 16, 2020

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fc1eb9/11737/summary.html
CMSSW: CMSSW_11_3_X_2020-12-15-2300/slc7_amd64_gcc900

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 36
  • DQMHistoTests: Total histograms compared: 2747284
  • DQMHistoTests: Total failures: 4
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2747258
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 35 files compared)
  • Checked 153 log files, 37 edm output root files, 36 DQM output files

@makortel
Copy link
Contributor

+1

@perrotta
Copy link
Contributor

+1

  • Technical: it allows compiler dependent usage of #pragma unroll
  • It silences the #pragma compilation warnings when it was present but it had to be ignored
  • Jenkins tests pass

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@silviodonato
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 24ed956 into cms-sw:master Dec 16, 2020
fwyzard added a commit to cms-patatrack/cmssw that referenced this pull request Dec 21, 2020
…#32499) (#596)

Define preprocessor macros that exoand to pragmas controlling loop unrolling.
Two set of macrso are defined:
  - CMS_UNROLL_LOOP and friends are applied on both host and device compilation
  - CMS_DEVICE_UNROLL_LOOP and friends is only applied in device compilation,
    and expands to nothing on the host

The supported compilers are
  - CUDA nvcc
  - HIP (untested)
  - gcc
  - clang

Use CMS_UNROLL_LOOP instead of #pragma unroll .
fwyzard added a commit to cms-patatrack/cmssw that referenced this pull request Dec 23, 2020
…#32499)

Define preprocessor macros that exoand to pragmas controlling loop unrolling.
Two set of macrso are defined:
  - CMS_UNROLL_LOOP and friends are applied on both host and device compilation
  - CMS_DEVICE_UNROLL_LOOP and friends is only applied in device compilation,
    and expands to nothing on the host

The supported compilers are
  - CUDA nvcc
  - HIP (untested)
  - gcc
  - clang

Use CMS_UNROLL_LOOP instead of #pragma unroll .
@fwyzard fwyzard deleted the CMS_UNROLL_LOOP branch December 27, 2020 09:27
ghugo83 added a commit to ghugo83/pixeltrack-standalone that referenced this pull request Feb 3, 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