Skip to content
Snippets Groups Projects
Commit dcd2bbc6 authored by Paul Heinzlreiter's avatar Paul Heinzlreiter
Browse files

* moved iterations loop

parent 34b632a1
Branches
No related merge requests found
......@@ -11,7 +11,9 @@ int main(int argc, char* argv[]) {
MpiSimulation simulation(argc, argv);
simulation.distributeBodies();
simulation.runStep();
for (int i = 0; i < 6; i++) {
simulation.runStep();
}
simulation.cleanup();
MPI::Finalize();
return 0;
......
......@@ -50,7 +50,6 @@ namespace nbody {
bool MpiBodyComm::sendUnblocking(int target, vector<Body> bodies) {
if (this->request != MPI::REQUEST_NULL && !this->request.Test()) {
//unblocking send still not finished
//cout << "Test failed" << endl;
return false;
}
/*
......
......@@ -182,23 +182,21 @@ namespace nbody {
void MpiSimulation::runStep() {
Box overallDomain;
for (int k = 0; k < 3; k++) {
this->distributeDomains();
//this->domains[this->mpiRank].print();
for (unsigned int i = 0; i < this->mpiSize; i++) {
overallDomain.extend(this->domains[i]);
}
/*
if (this->mpiRank == 0) {
overallDomain.print();
}
*/
this->tree.rebuild(overallDomain);
this->distributeLETs();
this->tree.computeForces();
this->tree.advance();
this->domains[this->mpiRank] = this->tree.getLocalBB();
this->distributeDomains();
//this->domains[this->mpiRank].print();
for (unsigned int i = 0; i < this->mpiSize; i++) {
overallDomain.extend(this->domains[i]);
}
/*
if (this->mpiRank == 0) {
overallDomain.print();
}
*/
this->tree.rebuild(overallDomain);
this->distributeLETs();
this->tree.computeForces();
this->tree.advance();
this->domains[this->mpiRank] = this->tree.getLocalBB();
}
}
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