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

Fix max channels #480

Closed
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
6 changes: 5 additions & 1 deletion HLTrigger/Configuration/python/customizeHLTforPatatrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ def customise_gpu_ecal(process):
process.load("RecoLocalCalo.EcalRecProducers.ecalLaserAlphasGPUESProducer_cfi")
process.load("RecoLocalCalo.EcalRecProducers.ecalLinearCorrectionsGPUESProducer_cfi")


# Modules and EDAliases

process.hltEcalDigisGPU = cms.EDProducer("EcalRawToDigiGPU",
Expand Down Expand Up @@ -555,6 +554,11 @@ def customise_gpu_hcal(process):
+ process.hltHbhereco) # copy to host and convert to legacy format


#
# hltEcalUncalibRecHitSoA + hltEcalUncalibRecHit
# Needed by phi-symmetry filter for calibration stream -> ECAL will follow up
#

# done
return process

Expand Down
2 changes: 2 additions & 0 deletions RecoLocalCalo/EcalRecAlgos/interface/DeclsForKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ namespace ecal {
EcalSampleMask const& sampleMask;
EcalTimeOffsetConstant const& timeOffsetConstant;
uint32_t offsetForHashes;
uint32_t nchannels;
};

//*/
Expand Down Expand Up @@ -339,6 +340,7 @@ namespace ecal {
//
//
uint32_t offsetForHashes;
uint32_t nchannels;
};

} // namespace rechit
Expand Down
8 changes: 6 additions & 2 deletions RecoLocalCalo/EcalRecAlgos/src/EcalRecHitBuilderKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,14 @@ namespace ecal {
ConditionsProducts const& conditions,
ConfigurationParameters const& configParameters,
uint32_t const nChannelsBarrel,
// uint32_t const nchannels,
edm::TimeValue_t const event_time,
cudaStream_t cudaStream) {
int nchannels = eventInputGPU.ebUncalibRecHits.size + eventInputGPU.eeUncalibRecHits.size;

// int nchannels = eventInputGPU.ebUncalibRecHits.size + eventInputGPU.eeUncalibRecHits.size;
int nchannels = conditions.nchannels;
//
// nChannelsBarrel and offsetForHashes should be the same? TEST
//
// unsigned int nchannels_per_block = 32;
unsigned int nchannels_per_block = 16;
unsigned int threads_min = nchannels_per_block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ namespace ecal {

uint32_t const offsetForHashes = conditions.offsetForHashes;
uint32_t const offsetForInputs = eventInputGPU.ebDigis.ndigis;
unsigned int totalChannels = eventInputGPU.ebDigis.ndigis + eventInputGPU.eeDigis.ndigis;

// unsigned int totalChannels = eventInputGPU.ebDigis.ndigis + eventInputGPU.eeDigis.ndigis;
unsigned int totalChannels = conditions.nchannels;

//
// 1d preparation kernel
//
Expand Down
15 changes: 12 additions & 3 deletions RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducerGPU.cc
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,16 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event,

if ((neb_ + nee_) > maxNumberHits_) {
edm::LogError("EcalRecHitProducerGPU") << "max number of channels exceeded. See options 'maxNumberHits' ";
if (neb_ > maxNumberHits_) {
neb_ = maxNumberHits_;
nee_ = 0;
} else if ((neb_ + nee_) > maxNumberHits_) {
nee_ = maxNumberHits_ - neb_;
}
}

int nchannelsEB = ebUncalibRecHits.size; // --> offsetForInput, first EB and then EE
uint32_t nchannels = neb_ + nee_;
// int nchannelsEB = neb_; // --> offsetForInput, first EB and then EE

// conditions
// - laser correction
Expand Down Expand Up @@ -340,7 +347,9 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event,
LaserAlphasProduct,
LinearCorrectionsProduct,
//
IntercalibConstantsHandle_->getOffset()};
//IntercalibConstantsHandle_->getOffset(),
neb_,
nchannels};

//
// schedule algorithms
Expand All @@ -353,7 +362,7 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event,
// eventDataForScratchGPU_,
conditions,
configParameters_,
nchannelsEB,
neb_,
event_time,
ctx.stream());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,14 @@ void EcalUncalibRecHitProducerGPU::acquire(edm::Event const& event,

if ((neb_ + nee_) > maxNumberHits_) {
edm::LogError("EcalUncalibRecHitProducerGPU") << "max number of channels exceeded. See options 'maxNumberHits' ";
if (neb_ > maxNumberHits_) {
neb_ = maxNumberHits_;
nee_ = 0;
} else if ((neb_ + nee_) > maxNumberHits_) {
nee_ = maxNumberHits_ - neb_;
}
}
auto nchannels = neb_ + nee_;

// conditions
setup.get<EcalPedestalsRcd>().get(pedestalsHandle_);
Expand Down Expand Up @@ -320,7 +327,9 @@ void EcalUncalibRecHitProducerGPU::acquire(edm::Event const& event,
timeCalibConstantsProduct,
*sampleMaskHandle_,
*timeOffsetConstantHandle_,
timeCalibConstantsHandle_->getOffset()};
//timeCalibConstantsHandle_->getOffset(),
neb_,
nchannels};

//
// schedule algorithms
Expand Down