Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tentative fix to ALL exit bug #245

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void Simulation::readXML(XMLfileUnits& xmlconfig) {
Simulation::exit(1);
}
delete _domainDecomposition;
_domainDecomposition = new GeneralDomainDecomposition(getcutoffRadius() + skin, _domain, forceLatchingToLinkedCellsGrid);
_domainDecomposition = new GeneralDomainDecomposition(getcutoffRadius() + skin, _domain, forceLatchingToLinkedCellsGrid, _numberOfTimesteps);
} else {
global_log->error() << "Unknown parallelisation type: " << parallelisationtype << endl;
Simulation::exit(1);
Expand Down
6 changes: 4 additions & 2 deletions src/parallel/GeneralDomainDecomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@

#include <numeric>

GeneralDomainDecomposition::GeneralDomainDecomposition(double interactionLength, Domain* domain, bool forceGrid)
GeneralDomainDecomposition::GeneralDomainDecomposition(double interactionLength, Domain* domain, bool forceGrid, unsigned long numTimesteps)
: _boxMin{0.},
_boxMax{0.},
_domainLength{domain->getGlobalLength(0), domain->getGlobalLength(1), domain->getGlobalLength(2)},
_interactionLength{interactionLength},
_forceLatchingToLinkedCellsGrid{forceGrid} {}
_forceLatchingToLinkedCellsGrid{forceGrid},
_numTimesteps{numTimesteps} {}

void GeneralDomainDecomposition::initializeALL() {
global_log->info() << "initializing ALL load balancer..." << std::endl;
Expand Down Expand Up @@ -252,6 +253,7 @@ void GeneralDomainDecomposition::readXML(XMLfileUnits& xmlconfig) {
#endif

xmlconfig.getNodeValue("updateFrequency", _rebuildFrequency);
_rebuildFrequency = std::min(_rebuildFrequency, _numTimesteps);
global_log->info() << "GeneralDomainDecomposition update frequency: " << _rebuildFrequency << endl;

xmlconfig.getNodeValue("initialPhaseTime", _initPhase);
Expand Down
3 changes: 2 additions & 1 deletion src/parallel/GeneralDomainDecomposition.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class GeneralDomainDecomposition : public DomainDecompMPIBase {
* @param domain
* @param forceGrid
*/
GeneralDomainDecomposition(double interactionLength, Domain* domain, bool forceGrid);
GeneralDomainDecomposition(double interactionLength, Domain* domain, bool forceGrid, unsigned long numTimesteps);

// documentation see father class (DomainDecompBase.h)
~GeneralDomainDecomposition() override;
Expand Down Expand Up @@ -189,6 +189,7 @@ class GeneralDomainDecomposition : public DomainDecompMPIBase {

size_t _steps{0};
size_t _rebuildFrequency{10000};
unsigned long _numTimesteps;

size_t _initPhase{0};
size_t _initFrequency{500};
Expand Down