Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Pawian
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PWA
Pawian
Commits
905d0712
Commit
905d0712
authored
12 years ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
added event based parallelization
parent
d146d53a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Jamroot
+10
-3
10 additions, 3 deletions
Jamroot
PwaUtils/AbsLhNew.cc
+45
-19
45 additions, 19 deletions
PwaUtils/AbsLhNew.cc
with
55 additions
and
22 deletions
Jamroot
+
10
−
3
View file @
905d0712
...
...
@@ -4,7 +4,14 @@ path-constant TOP : . ;
local rlibs = [ SHELL "$(ROOTSYS)/bin/root-config --libs" ] ;
ROOTLIBS = [ MATCH "(.*)[\n]" : $(rlibs) ] ;
BOOSTLIBS = -lboost_date_time -lboost_filesystem -lboost_program_options -lboost_regex -lboost_serialization -lboost_system -lboost_thread -lboost_test_exec_monitor ;
if $(MinuitVariant) = Minuit
{
OPEN_MP_FLAG = "" ;
}
else if $(MinuitVariant) = Minuit2noMP
{
OPEN_MP_FLAG = openmp ;
}
project :
requirements <include>./
<include>$(extern)/include
...
...
@@ -12,13 +19,13 @@ project :
<include>$(GENEVA)/include
<link>static
<cxxflags>-pthread
<cxxflags>-f
openmp
<cxxflags>-f
$(OPEN_MP_FLAG)
<linkflags>$(ROOTLIBS)
<linkflags>$(BOOSTLIBS)
<linkflags>-l$(MinuitVariant)
<linkflags>-lgomp
<linkflags>-pthread
<linkflags>-f
openmp
<linkflags>-f
$(OPEN_MP_FLAG)
;
actions rootlibs
...
...
This diff is collapsed.
Click to expand it.
PwaUtils/AbsLhNew.cc
+
45
−
19
View file @
905d0712
...
...
@@ -6,6 +6,10 @@
#include
"qft++/relativistic-quantum-mechanics/Utils.hh"
#include
"ErrLogger/ErrLogger.hh"
#ifdef _OPENMP
#include
<omp.h>
#endif
AbsLhNew
::
AbsLhNew
(
boost
::
shared_ptr
<
const
EvtDataBaseListNew
>
theEvtList
)
:
_evtListPtr
(
theEvtList
)
{
...
...
@@ -29,33 +33,55 @@ double AbsLhNew::calcLogLh(fitParamsNew& theParamVal){
double
logLH
=
0.
;
double
logLH_data
=
0.
;
double
weightSum
=
0.
;
double
LH_mc
=
0.
;
std
::
vector
<
EvtDataNew
*>::
iterator
iterd
;
for
(
iterd
=
_evtDataVec
.
begin
();
iterd
!=
_evtDataVec
.
end
();
++
iterd
){
double
intensity
=
calcEvtIntensity
((
*
iterd
),
theParamVal
);
if
(
intensity
>
0.
)
logLH_data
+=
((
*
iterd
)
->
evtWeight
)
*
log
(
intensity
);
weightSum
+=
(
*
iterd
)
->
evtWeight
;
}
double
LH_mc
=
0.
;
std
::
vector
<
EvtDataNew
*>::
iterator
iterm
;
for
(
iterm
=
_evtMCVec
.
begin
();
iterm
!=
_evtMCVec
.
end
();
++
iterm
){
double
intensity
=
calcEvtIntensity
((
*
iterm
),
theParamVal
);
LH_mc
+=
intensity
;
}
#ifdef _OPENMP
#pragma omp parallel for
#endif
for
(
unsigned
int
i
=
0
;
i
<
_evtDataVec
.
size
();
++
i
){
EvtDataNew
*
currentEvtData
=
_evtDataVec
[
i
];
double
intensity
=
calcEvtIntensity
(
currentEvtData
,
theParamVal
);
double
logLH_mc_Norm
=
0.
;
if
(
LH_mc
>
0.
)
logLH_mc_Norm
=
log
(
LH_mc
/
_evtMCVec
.
size
());
#ifdef _OPENMP
#pragma omp critical
{
#endif
if
(
intensity
>
0.
)
logLH_data
+=
(
currentEvtData
->
evtWeight
)
*
log
(
intensity
);
weightSum
+=
currentEvtData
->
evtWeight
;
#ifdef _OPENMP
}
#endif
}
#ifdef _OPENMP
#pragma omp parallel for
#endif
for
(
unsigned
int
i
=
0
;
i
<
_evtMCVec
.
size
();
++
i
){
EvtDataNew
*
currentEvtData
=
_evtMCVec
[
i
];
double
intensity
=
calcEvtIntensity
(
currentEvtData
,
theParamVal
);
#ifdef _OPENMP
#pragma omp critical
{
#endif
LH_mc
+=
intensity
;
#ifdef _OPENMP
}
#endif
}
double
logLH_mc_Norm
=
0.
;
if
(
LH_mc
>
0.
)
logLH_mc_Norm
=
log
(
LH_mc
/
_evtMCVec
.
size
());
logLH
=
0.5
*
weightSum
*
(
LH_mc
/
_evtMCVec
.
size
()
-
1.
)
*
(
LH_mc
/
_evtMCVec
.
size
()
-
1.
)
-
logLH_data
+
weightSum
*
logLH_mc_Norm
;
Info
<<
"current LH = "
<<
logLH
<<
endmsg
;
return
logLH
;
return
logLH
;
}
void
AbsLhNew
::
setHyps
(
const
std
::
map
<
const
std
::
string
,
bool
>&
theMap
,
bool
&
theHyp
,
std
::
string
&
theKey
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment