Skip to content

Commit

Permalink
Merge pull request #321 from mach3-software/feature_OMP
Browse files Browse the repository at this point in the history
tidy: Move Spline Eval Away from parraler region
  • Loading branch information
KSkwarczynski authored Feb 5, 2025
2 parents 063450b + f0172c8 commit 1f102f4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions samplePDF/samplePDFFDBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,13 @@ void samplePDFFDBase::fillArray_MP() {
size_t nXBins = int(XBinEdges.size()-1);
size_t nYBins = int(YBinEdges.size()-1);

PrepFunctionalParameters();
//==================================================
//Calc Weights and fill Array
if(SplineHandler){
SplineHandler->Evaluate();
}

//This is stored as [y][x] due to shifts only occurring in the x variable (Erec/Lep mom) - I believe this will help reduce cache misses
double** samplePDFFD_array_private = nullptr;
double** samplePDFFD_array_private_w2 = nullptr;
Expand Down Expand Up @@ -481,14 +488,6 @@ void samplePDFFDBase::fillArray_MP() {
//
// We will hit <0.1 s/step eventually! :D

//ETA - does these three calls need to be inside the omp parrallel region?
//I don't think this will affect anything but maybe should check.
PrepFunctionalParameters();
//==================================================
//Calc Weights and fill Array
if(SplineHandler){
SplineHandler->Evaluate();
}
for (unsigned int iSample=0;iSample<MCSamples.size();iSample++) {
#pragma omp for
for (int iEvent=0;iEvent<MCSamples[iSample].nEvents;iEvent++) {
Expand Down

0 comments on commit 1f102f4

Please sign in to comment.