Commit cc1bea27 authored by kraus's avatar kraus
Browse files

moving from free floating variables defined somewhere in the input file to proper options

parent b802c9f9
...@@ -965,13 +965,13 @@ void ParallelTTracker::dumpStats(long long step, bool psDump, bool statDump) { ...@@ -965,13 +965,13 @@ void ParallelTTracker::dumpStats(long long step, bool psDump, bool statDump) {
void ParallelTTracker::setOptionalVariables() { void ParallelTTracker::setOptionalVariables() {
Inform msg("ParallelTTracker ", *gmsg); Inform msg("ParallelTTracker ", *gmsg);
minBinEmitted_m = 10; minBinEmitted_m = Options::minBinEmitted;
RealVariable *ar = dynamic_cast<RealVariable *>(OpalData::getInstance()->find("MINBINEMITTED")); RealVariable *ar = dynamic_cast<RealVariable *>(OpalData::getInstance()->find("MINBINEMITTED"));
if (ar) if (ar)
minBinEmitted_m = static_cast<size_t>(ar->getReal()); minBinEmitted_m = static_cast<size_t>(ar->getReal());
msg << level2 << "MINBINEMITTED " << minBinEmitted_m << endl; msg << level2 << "MINBINEMITTED " << minBinEmitted_m << endl;
minStepforReBin_m = 200; minStepforReBin_m = Options::minStepForRebin;
RealVariable *br = dynamic_cast<RealVariable *>(OpalData::getInstance()->find("MINSTEPFORREBIN")); RealVariable *br = dynamic_cast<RealVariable *>(OpalData::getInstance()->find("MINSTEPFORREBIN"));
if (br) if (br)
minStepforReBin_m = static_cast<int>(br->getReal()); minStepforReBin_m = static_cast<int>(br->getReal());
...@@ -981,7 +981,7 @@ void ParallelTTracker::setOptionalVariables() { ...@@ -981,7 +981,7 @@ void ParallelTTracker::setOptionalVariables() {
if (Ippl::getNodes() == 1) { if (Ippl::getNodes() == 1) {
repartFreq_m = numeric_limits<unsigned int>::max(); repartFreq_m = numeric_limits<unsigned int>::max();
} else { } else {
repartFreq_m = 1000; repartFreq_m = Options::repartFreq * 100;
RealVariable *rep = dynamic_cast<RealVariable *>(OpalData::getInstance()->find("REPARTFREQ")); RealVariable *rep = dynamic_cast<RealVariable *>(OpalData::getInstance()->find("REPARTFREQ"));
if (rep) if (rep)
repartFreq_m = static_cast<int>(rep->getReal()); repartFreq_m = static_cast<int>(rep->getReal());
......
...@@ -86,6 +86,8 @@ namespace { ...@@ -86,6 +86,8 @@ namespace {
AMR_YT_DUMP_FREQ, AMR_YT_DUMP_FREQ,
#endif #endif
MEMORYDUMP, MEMORYDUMP,
MINBINEMITTED,
MINSTEPFORREBIN,
SIZE SIZE
}; };
} }
...@@ -160,7 +162,15 @@ Option::Option(): ...@@ -160,7 +162,15 @@ Option::Option():
itsAttr[REPARTFREQ] = Attributes::makeReal itsAttr[REPARTFREQ] = Attributes::makeReal
("REPARTFREQ", "The frequency to do particles repartition " ("REPARTFREQ", "The frequency to do particles repartition "
"for better load balance between nodes, its " "for better load balance between nodes, its "
"default value is 10.", repartFreq); "default value is " + std::to_string(repartFreq) + ".", repartFreq);
itsAttr[MINBINEMITTED] = Attributes::makeReal
("MINBINEMITTED", "The number of bins that have to be emitted before the bins are squashed into "
"a single bin; the default value is " + std::to_string(minBinEmitted) + ".", minBinEmitted);
itsAttr[MINSTEPFORREBIN] = Attributes::makeReal
("MINSTEPFORREBIN", "The number of steps into the simulation before the bins are squashed into "
"a single bin; the default value is " + std::to_string(minStepForRebin) + ".", minStepForRebin);
itsAttr[REBINFREQ] = Attributes::makeReal itsAttr[REBINFREQ] = Attributes::makeReal
("REBINFREQ", "The frequency to reset energy bin ID for " ("REBINFREQ", "The frequency to reset energy bin ID for "
......
...@@ -60,6 +60,12 @@ namespace Options { ...@@ -60,6 +60,12 @@ namespace Options {
// The frequency to do particles repartition for better load balance between nodes // The frequency to do particles repartition for better load balance between nodes
int repartFreq = 10; int repartFreq = 10;
// The number of bins that have to be emitted before the bin are squashed into a single bin
int minBinEmitted = 10;
// The number of steps into the simulation before the bins are squashed into a single bin
int minStepForRebin = 200;
// The frequency to reset energy bin ID for all particles // The frequency to reset energy bin ID for all particles
int rebinFreq = 100; int rebinFreq = 100;
......
...@@ -89,6 +89,12 @@ namespace Options { ...@@ -89,6 +89,12 @@ namespace Options {
/// The frequency to do particles repartition for better load balance between nodes /// The frequency to do particles repartition for better load balance between nodes
extern int repartFreq; extern int repartFreq;
/// The number of bins that have to be emitted before the bin are squashed into a single bin
extern int minBinEmitted;
/// The number of steps into the simulation before the bins are squashed into a single bin
extern int minStepForRebin;
/// The frequency to reset energy bin ID for all particles /// The frequency to reset energy bin ID for all particles
extern int rebinFreq; extern int rebinFreq;
......
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