Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Sherpa Team
sherpa
Commits
240f83a9
Commit
240f83a9
authored
Oct 19, 2013
by
Stefan Hoeche
Browse files
added memleak check in psi and event handler
parent
0e66aca6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
1 deletion
+30
-1
ATOOLS/Org/Run_Parameter.C
ATOOLS/Org/Run_Parameter.C
+2
-0
PHASIC++/Main/Phase_Space_Integrator.C
PHASIC++/Main/Phase_Space_Integrator.C
+12
-1
PHASIC++/Main/Phase_Space_Integrator.H
PHASIC++/Main/Phase_Space_Integrator.H
+3
-0
SHERPA/Single_Events/Event_Handler.C
SHERPA/Single_Events/Event_Handler.C
+12
-0
SHERPA/Single_Events/Event_Handler.H
SHERPA/Single_Events/Event_Handler.H
+1
-0
No files found.
ATOOLS/Org/Run_Parameter.C
View file @
240f83a9
...
...
@@ -275,6 +275,8 @@ void Run_Parameter::Init(std::string path,std::string file,int argc,char* argv[]
for
(
int
i
(
1
);
i
<
4
;
++
i
)
seedstr
+=
"_"
+
ToString
(
gen
.
m_seeds
[
i
]);
gen
.
SetVariable
(
"RNG_SEED"
,
ToString
(
gen
.
m_seeds
[
0
])
+
seedstr
);
gen
.
SetVariable
(
"MEMLEAK_WARNING_THRESHOLD"
,
ToString
(
dr
.
GetValue
<
int
>
(
"MEMLEAK_WARNING_THRESHOLD"
,
1
<<
20
)));
gen
.
m_timeout
=
dr
.
GetValue
<
double
>
(
"TIMEOUT"
,
std
::
numeric_limits
<
double
>::
max
());
if
(
gen
.
m_timeout
<
0
.)
gen
.
m_timeout
=
0
.;
rpa
->
gen
.
m_timer
.
Start
();
...
...
PHASIC++/Main/Phase_Space_Integrator.C
View file @
240f83a9
...
...
@@ -9,7 +9,7 @@
#include "ATOOLS/Org/My_MPI.H"
#include "PHASIC++/Main/Process_Integrator.H"
#include "ATOOLS/
Math/Random
.H"
#include "ATOOLS/
Org/RUsage
.H"
#include <unistd.h>
using
namespace
PHASIC
;
...
...
@@ -38,6 +38,7 @@ Phase_Space_Integrator::Phase_Space_Integrator()
if
(
!
read
.
ReadFromFile
(
ndecopt
,
"PSI_NDECOPT"
))
ndecopt
=
10
;
else
msg_Info
()
<<
METHOD
<<
"(): Set n_{opt,dec} = "
<<
ndecopt
<<
".
\n
"
;
addtime
=
0
.
0
;
lastrss
=
GetCurrentRSS
();
}
Phase_Space_Integrator
::~
Phase_Space_Integrator
()
...
...
@@ -306,6 +307,16 @@ bool Phase_Space_Integrator::AddPoint(const double value)
<<
FormatTime
(
size_t
(
timeest
)
-
size_t
((
time
-
starttime
)))
<<
" left ) ["
<<
rpa
->
gen
.
Timer
().
StrFTime
(
"%H:%M:%S"
)
<<
"] "
<<
endl
;
#endif
size_t
currentrss
=
GetCurrentRSS
();
if
(
currentrss
-
lastrss
>
ToType
<
int
>
(
rpa
->
gen
.
Variable
(
"MEMLEAK_WARNING_THRESHOLD"
)))
{
msg_Error
()
<<
METHOD
<<
"() {
\n
"
<<
om
::
bold
<<
" Memory usage increased by "
<<
(
currentrss
-
lastrss
)
/
(
1
<<
20
)
<<
" MB,"
<<
" now "
<<
currentrss
/
(
1
<<
20
)
<<
" MB.
\n
"
<<
om
::
red
<<
" This might indicate a memory leak!
\n
"
<<
" Please monitor this process closely.
\n
"
<<
om
::
reset
<<
"}"
<<
std
::
endl
;
}
lastrss
=
currentrss
;
std
::
vector
<
double
>
stats
(
6
);
stats
[
0
]
=
psh
->
Process
()
->
TotalResult
()
*
rpa
->
Picobarn
();
stats
[
1
]
=
psh
->
Process
()
->
TotalVar
()
*
rpa
->
Picobarn
();
...
...
PHASIC++/Main/Phase_Space_Integrator.H
View file @
240f83a9
#ifndef PHASIC_Main_Phase_Space_Integrator_H
#define PHASIC_Main_Phase_Space_Integrator_H
#include <stddef.h>
namespace
PHASIC
{
class
Phase_Space_Handler
;}
namespace
PHASIC
{
...
...
@@ -16,6 +18,7 @@ namespace PHASIC {
double
value
,
maxerror
,
maxabserror
,
rstarttime
,
rlotime
;
long
unsigned
int
n
,
ncontrib
,
endopt
,
nlo
,
fin_opt
,
nstep
,
ncstep
;
long
int
mn
,
mnstep
,
mncstep
;
size_t
lastrss
;
Phase_Space_Handler
*
psh
;
...
...
SHERPA/Single_Events/Event_Handler.C
View file @
240f83a9
...
...
@@ -14,6 +14,7 @@
#include "ATOOLS/Math/Random.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/RUsage.H"
using
namespace
SHERPA
;
...
...
@@ -29,6 +30,7 @@ Event_Handler::Event_Handler():
p_phases
=
new
Phase_List
;
Data_Reader
reader
(
" "
,
";"
,
"!"
,
"="
);
m_checkweight
=
reader
.
GetValue
<
int
>
(
"CHECK_WEIGHT"
,
0
);
m_lastrss
=
GetCurrentRSS
();
}
Event_Handler
::~
Event_Handler
()
...
...
@@ -477,6 +479,16 @@ void Event_Handler::MPISync()
delete
[]
values
;
}
#endif
size_t
currentrss
=
GetCurrentRSS
();
if
(
currentrss
-
m_lastrss
>
ToType
<
int
>
(
rpa
->
gen
.
Variable
(
"MEMLEAK_WARNING_THRESHOLD"
)))
{
msg_Error
()
<<
METHOD
<<
"() {
\n
"
<<
om
::
bold
<<
" Memory usage increased by "
<<
(
currentrss
-
m_lastrss
)
/
(
1
<<
20
)
<<
" MB,"
<<
" now "
<<
currentrss
/
(
1
<<
20
)
<<
" MB.
\n
"
<<
om
::
red
<<
" This might indicate a memory leak!
\n
"
<<
" Please monitor this process closely.
\n
"
<<
om
::
reset
<<
"}"
<<
std
::
endl
;
}
m_lastrss
=
currentrss
;
}
double
Event_Handler
::
TotalXS
()
...
...
SHERPA/Single_Events/Event_Handler.H
View file @
240f83a9
...
...
@@ -19,6 +19,7 @@ namespace SHERPA {
double
m_n
,
m_addn
,
m_sum
,
m_sumsqr
,
m_maxweight
;
double
m_mn
,
m_msum
,
m_msumsqr
;
bool
m_checkweight
;
size_t
m_lastrss
;
Phase_List
*
p_phases
;
ATOOLS
::
Blob_List
m_blobs
,
m_sblobs
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment