Commit 8239ed3d authored by frey_m's avatar frey_m

Merge branch '384-increase-simulation-efficiency' into 'master'

Resolve "Increase simulation efficiency"

Closes #384

See merge request OPAL/src!198
parents ccb07783 45aeb625
......@@ -2143,6 +2143,11 @@ bool ParallelCyclotronTracker::deleteParticle(bool flagNeedUpdate){
IpplTimings::startTimer(DelParticleTimer_m);
// Update immediately if any particles are lost during this step
if ((step_m + 1) % Options::delPartFreq != 0) {
IpplTimings::stopTimer(DelParticleTimer_m);
return false;
}
allreduce(flagNeedUpdate, 1, std::logical_or<bool>());
if(flagNeedUpdate) {
......
......@@ -88,6 +88,7 @@ namespace {
#endif
MEMORYDUMP,
HALOSHIFT,
DELPARTFREQ,
MINBINEMITTED,
MINSTEPFORREBIN,
SIZE
......@@ -202,7 +203,7 @@ Option::Option():
"for parallel plate and print special debug output", ppdebug);
itsAttr[SURFDUMPFREQ] = Attributes::makeReal
("SURFDUMPFREQ", "The frequency to dump surface-partcle "
("SURFDUMPFREQ", "The frequency to dump surface-particle "
"interaction data, its default value is -1 (no dump).",
surfDumpFreq);
......@@ -270,6 +271,9 @@ Option::Option():
itsAttr[HALOSHIFT] = Attributes::makeReal
("HALOSHIFT", "Constant parameter to shift halo value (default: 0.0)", haloShift);
itsAttr[DELPARTFREQ] = Attributes::makeReal
("DELPARTFREQ", "The frequency to delete particles, i.e. delete when step%delPartFreq == 0. Default: 1", delPartFreq);
registerOwnership(AttributeHandler::STATEMENT);
FileStream::setEcho(echo);
......@@ -319,6 +323,7 @@ Option::Option(const std::string &name, Option *parent):
#endif
Attributes::setBool(itsAttr[MEMORYDUMP], memoryDump);
Attributes::setReal(itsAttr[HALOSHIFT], haloShift);
Attributes::setReal(itsAttr[DELPARTFREQ], delPartFreq);
}
......@@ -355,8 +360,9 @@ void Option::execute() {
amrRegridFreq = int(Attributes::getReal(itsAttr[AMR_REGRID_FREQ]));
amrRegridFreq = ( amrRegridFreq < 1 ) ? 1 : amrRegridFreq;
#endif
memoryDump = Attributes::getBool(itsAttr[MEMORYDUMP]);
haloShift = Attributes::getReal(itsAttr[HALOSHIFT]);
memoryDump = Attributes::getBool(itsAttr[MEMORYDUMP]);
haloShift = Attributes::getReal(itsAttr[HALOSHIFT]);
delPartFreq = Attributes::getReal(itsAttr[DELPARTFREQ]);
if ( memoryDump ) {
IpplMemoryUsage::IpplMemory_p memory = IpplMemoryUsage::getInstance(
......
......@@ -108,4 +108,6 @@ namespace Options {
bool memoryDump = false;
double haloShift = 0.0;
unsigned int delPartFreq = 1;
}
\ No newline at end of file
......@@ -161,6 +161,9 @@ namespace Options {
/// The constant parameter C to shift halo, by < w^4 > / < w^2 > ^2 - C (w=x,y,z)
extern double haloShift;
/// The frequency to delete particles (currently: OPAL-cycl only)
extern unsigned int delPartFreq;
}
#endif // OPAL_Options_HH
\ No newline at end of file
This diff is collapsed.
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