From cdf64d16ac3344116d6cf2f4d6b20f4c7ffd2c65 Mon Sep 17 00:00:00 2001 From: henry-israel Date: Thu, 1 Aug 2024 08:33:17 -0400 Subject: [PATCH] Uses OMP C++ interface rather than grabbing potentially non-existent environment variable --- samplePDF/samplePDFFDBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samplePDF/samplePDFFDBase.cpp b/samplePDF/samplePDFFDBase.cpp index e22ef1d5..0083f630 100644 --- a/samplePDF/samplePDFFDBase.cpp +++ b/samplePDF/samplePDFFDBase.cpp @@ -859,7 +859,7 @@ void samplePDFFDBase::SetupOscCalc(double PathLength, double Density) //if we just want to use CUDAProb3 CPU then setup BeamCpuPropagator object #if defined (MULTITHREAD) //if we want to multithread then get number of threads from OMP_NUM_THREADS env variable - MCSamples[iSample].Oscillator = new cudaprob3::BeamCpuPropagator(MCSamples[iSample].nEvents, std::atoi(std::getenv("OMP_NUM_THREADS"))); + MCSamples[iSample].Oscillator = new cudaprob3::BeamCpuPropagator(MCSamples[iSample].nEvents, omp_get_max_threads())); MCSamples[iSample].Oscillator->setPathLength(PathLength); MCSamples[iSample].Oscillator->setDensity(Density); #else