ROOT
master
Reference Guide
Loading...
Searching...
No Matches
GradientCalculator.cxx
Go to the documentation of this file.
1
#include "
Minuit2/MnPrint.h
"
2
#include "
Minuit2/GradientCalculator.h
"
3
4
namespace
ROOT
{
5
6
namespace
Minuit2 {
7
8
/**
9
* Enable parallelization of gradient calculation using OpenMP.
10
* This is different from the default parallel mechanism elsewhere (IMT, threads, TBB, ...).
11
* It can only be used to minimise thread-safe functions in Minuit2.
12
* \param doParallel true to enable, false to disable.
13
* \note Enabling this function does not guarantee that the derived gradient calculator class
14
* has implemented a OMP-parallelized version of the code. For example, the numeric Hessian
15
* computation (HessianGradientCalculator) does not make any use of OpenMP, only
16
* Numerical2PGradientCalculator makes use of OMP pragmas at the moment.
17
* \note If OPENMP is not available, i.e. ROOT was built without OpenMP support (minuit2_omp),
18
* and an error is printed if doParallel=true; parallelization is disabled in any case.
19
* \return false if OPENMP is not available and doParallel=true, otherwise it returns true.
20
*/
21
bool
GradientCalculator::SetParallelOMP
(
bool
doParallel
)
22
{
23
#ifndef _OPENMP
24
if
(
doParallel
) {
25
MnPrint
print(
"GradientCalculator"
);
26
print.
Error
(
"Minuit 2 was built without OpenMP support! Can't enable OMP-parallel gradients."
);
27
fDoParallelOMP
=
false
;
28
return
false
;
29
}
else
{
30
fDoParallelOMP
=
false
;
31
return
true
;
32
}
33
#else
34
fDoParallelOMP
=
doParallel
;
35
return
true
;
36
#endif
37
}
38
39
}
// namespace Minuit2
40
41
}
// namespace ROOT
GradientCalculator.h
MnPrint.h
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
ROOT::Minuit2::GradientCalculator::fDoParallelOMP
static bool fDoParallelOMP
flag to indicate if parallel OpenMP processing is used
Definition
GradientCalculator.h:41
ROOT::Minuit2::GradientCalculator::SetParallelOMP
static bool SetParallelOMP(bool doParallel=true)
Enable parallelization of gradient calculation using OpenMP.
Definition
GradientCalculator.cxx:21
ROOT::Minuit2::MnPrint
Definition
MnPrint.h:69
ROOT::Minuit2::MnPrint::Error
void Error(const Ts &... args)
Definition
MnPrint.h:117
ROOT
Definition
EExecutionPolicy.hxx:4
math
minuit2
src
GradientCalculator.cxx
ROOT master - Reference Guide Generated on Tue Sep 23 2025 04:32:35 (GVA Time) using Doxygen 1.10.0