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
Create new ECAL DQM GpuTask to monitor and compare CPU and GPU generated ECAL RECO objects #36742
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c26b2fc
Create new GpuTask module to monitor and compare CPU and GPU generate…
alejands 0ba018e
suggestions from Andrea Bocci and small changes to meet cmssw coding …
alejands 856c2fd
rename single character variable to follow style rules and rename plo…
alejands c45503a
add new modifier specific to gpu validation
alejands 33736e9
replace gpuValidation modifier with modifier chain and create ECAL sp…
alejands f19e451
rename GpuTask_cfi.py to ecalGpuTask_cfi.py to match the main object …
alejands File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
Configuration/ProcessModifiers/python/gpuValidationEcal_cff.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
# This modifier is for turning on gpu validation modules for ECAL DQM | ||
|
||
gpuValidationEcal = cms.Modifier() |
11 changes: 11 additions & 0 deletions
11
Configuration/ProcessModifiers/python/gpuValidation_cff.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from Configuration.ProcessModifiers.gpu_cff import * | ||
from Configuration.ProcessModifiers.gpuValidationEcal_cff import * | ||
|
||
# This modifier chain is for turning on DQM modules used for gpu validation | ||
|
||
gpuValidation = cms.ModifierChain( | ||
gpu, | ||
gpuValidationEcal | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#ifndef DQM_EcalMonitorTasks_GpuTask_H | ||
#define DQM_EcalMonitorTasks_GpuTask_H | ||
|
||
#include "DQWorkerTask.h" | ||
|
||
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" | ||
#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" | ||
|
||
namespace ecaldqm { | ||
|
||
class GpuTask : public DQWorkerTask { | ||
public: | ||
GpuTask(); | ||
~GpuTask() override = default; | ||
|
||
void addDependencies(DependencySet&) override; | ||
|
||
bool filterRunType(short const*) override; | ||
|
||
void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; | ||
bool analyze(void const*, Collections) override; | ||
|
||
template <typename DigiCollection> | ||
void runOnCpuDigis(DigiCollection const&, Collections); | ||
template <typename DigiCollection> | ||
void runOnGpuDigis(DigiCollection const&, Collections); | ||
void runOnCpuUncalibRecHits(EcalUncalibratedRecHitCollection const&, Collections); | ||
void runOnGpuUncalibRecHits(EcalUncalibratedRecHitCollection const&, Collections); | ||
void runOnCpuRecHits(EcalRecHitCollection const&, Collections); | ||
void runOnGpuRecHits(EcalRecHitCollection const&, Collections); | ||
|
||
private: | ||
void setParams(edm::ParameterSet const&) override; | ||
|
||
bool runGpuTask_; | ||
bool gpuOnlyPlots_; | ||
std::vector<int> uncalibOOTAmps_; | ||
|
||
EBDigiCollection const* EBCpuDigis_; | ||
EEDigiCollection const* EECpuDigis_; | ||
|
||
EcalUncalibratedRecHitCollection const* EBCpuUncalibRecHits_; | ||
EcalUncalibratedRecHitCollection const* EECpuUncalibRecHits_; | ||
|
||
EcalRecHitCollection const* EBCpuRecHits_; | ||
EcalRecHitCollection const* EECpuRecHits_; | ||
}; | ||
|
||
inline bool GpuTask::analyze(void const* collection_data, Collections collection) { | ||
switch (collection) { | ||
case kEBCpuDigi: | ||
if (collection_data && runGpuTask_) | ||
runOnCpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection); | ||
return runGpuTask_; | ||
break; | ||
case kEECpuDigi: | ||
if (collection_data && runGpuTask_) | ||
runOnCpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection); | ||
return runGpuTask_; | ||
break; | ||
case kEBGpuDigi: | ||
if (collection_data && runGpuTask_) | ||
runOnGpuDigis(*static_cast<EBDigiCollection const*>(collection_data), collection); | ||
return runGpuTask_; | ||
break; | ||
case kEEGpuDigi: | ||
if (collection_data && runGpuTask_) | ||
runOnGpuDigis(*static_cast<EEDigiCollection const*>(collection_data), collection); | ||
return runGpuTask_; | ||
break; | ||
case kEBCpuUncalibRecHit: | ||
case kEECpuUncalibRecHit: | ||
if (collection_data && runGpuTask_) | ||
runOnCpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection); | ||
return runGpuTask_; | ||
break; | ||
case kEBGpuUncalibRecHit: | ||
case kEEGpuUncalibRecHit: | ||
if (collection_data && runGpuTask_) | ||
runOnGpuUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(collection_data), collection); | ||
return runGpuTask_; | ||
break; | ||
case kEBCpuRecHit: | ||
case kEECpuRecHit: | ||
if (collection_data && runGpuTask_) | ||
runOnCpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection); | ||
return runGpuTask_; | ||
break; | ||
case kEBGpuRecHit: | ||
case kEEGpuRecHit: | ||
if (collection_data && runGpuTask_) | ||
runOnGpuRecHits(*static_cast<EcalRecHitCollection const*>(collection_data), collection); | ||
return runGpuTask_; | ||
break; | ||
default: | ||
break; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
} // namespace ecaldqm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from DQM.EcalMonitorTasks.EcalMonitorTask_cfi import * | ||
|
||
# Customization to run the CPU vs GPU comparison task if the job runs on a GPU enabled machine | ||
from Configuration.ProcessModifiers.gpuValidationEcal_cff import gpuValidationEcal | ||
from DQM.EcalMonitorTasks.ecalGpuTask_cfi import ecalGpuTask | ||
|
||
gpuValidationEcal.toModify(ecalGpuTask.params, runGpuTask = cms.untracked.bool(True)) | ||
gpuValidationEcal.toModify(ecalMonitorTask.workers, func = lambda workers: workers.append("GpuTask")) | ||
gpuValidationEcal.toModify(ecalMonitorTask, workerParameters = dict(GpuTask = ecalGpuTask)) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.