Commit 24813c9b authored by Stefan Hoeche's avatar Stefan Hoeche
Browse files

documented leak detection

allow to set threshold using units
parent 5e3d6287
......@@ -275,8 +275,10 @@ 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);
dr.SetAllowUnits(true);
gen.SetVariable("MEMLEAK_WARNING_THRESHOLD",
ToString(dr.GetValue<int>("MEMLEAK_WARNING_THRESHOLD",1<<24)));
dr.SetAllowUnits(false);
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();
......
......@@ -14,7 +14,7 @@ The following parameters describe general run information. They may be set in th
* ANALYSIS:: Switch internal analysis on or off.
* ANALYSIS_OUTPUT:: Directory for generated analysis histogram files.
* TIMEOUT:: Run time limitation.
* RLIMIT_AS:: Memory limitation.
* RLIMIT_AS:: Memory limitation and leak detection.
* BATCH_MODE:: Batch mode settings.
* NUM_ACCURACY:: Accuracy for gauge tests.
......@@ -191,14 +191,23 @@ having no run time limitation at all. The unit is seconds.
@subsection RLIMIT_AS
@cindex RLIMIT_AS
@cindex RLIMIT_BY_CPU
@cindex MEMLEAK_WARNING_THRESHOLD
A memory limitation can be given to prevent Sherpa to crash the system it is
running on as it continues to build up matrix elements and loads additional
libraries at run time. Per default the maximum RAM of the system is determined
and set as the memory limit. This can be changed by giving
@code{RLIMIT_AS=<size>} where the size is given as eg. @code{500MB} or
@code{4 GB}. When running with @ref{MPI parallelization} it might be necessary
to divide the total maximum by the number of cores. This can be done by
setting @code{RLIMIT_BY_CPU=1}.
@option{RLIMIT_AS=<size>} where the size is given in the format @code{500 MB},
@code{4 GB}, or @code{10 %}. The space between number and unit is mandatory.
When running with @ref{MPI parallelization} it might be necessary to divide
the total maximum by the number of cores. This can be done by setting
@code{RLIMIT_BY_CPU=1}.
Sherpa checks for memory leaks during integration and event generation.
If the allocated memory after start of integration or event generation exceeds
the parameter @option{MEMLEAK_WARNING_THRESHOLD}, a warning is printed.
Like @option{RLIMIT_AS}, @option{MEMLEAK_WARNING_THRESHOLD} can be set
using units. However, no spaces are allowed between the number and the unit.
The warning threshold defaults to @code{16MB}.
@node BATCH_MODE
@subsection BATCH_MODE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment