From 92d9afe59f858a7e0ff4c0fb72195088061b4621 Mon Sep 17 00:00:00 2001 From: Paul Heinzlreiter Date: Fri, 5 Aug 2016 14:33:13 +0200 Subject: [PATCH] * debugging --- bh_tree_mpi/datastructures/BarnesHutTree.cpp | 8 ++++---- bh_tree_mpi/datastructures/Tree.cpp | 2 ++ bh_tree_mpi/datastructures/Tree.hpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bh_tree_mpi/datastructures/BarnesHutTree.cpp b/bh_tree_mpi/datastructures/BarnesHutTree.cpp index 97edcf2..022c942 100644 --- a/bh_tree_mpi/datastructures/BarnesHutTree.cpp +++ b/bh_tree_mpi/datastructures/BarnesHutTree.cpp @@ -58,13 +58,13 @@ namespace nbody { void BarnesHutTree::splitNode(Node* current) { //TODO: check why to Process accumulates nodes - this->control.toProcess.push(current); + //this->control.toProcess.push(current); if (current->isSplitable(&this->control)) { vector subboxes = this->splitBB(current); current->leaf = false; Node* after = current->next; - this->control.toProcess.pop(); + //this->control.toProcess.pop(); for (vector::iterator it = subboxes.begin(); it != subboxes.end(); it++) { Node* child = new Node(this); @@ -80,12 +80,12 @@ namespace nbody { child->prevSibling = child->prev; child->prev->afterSubtree = child; } - this->control.toProcess.push(child); + //this->control.toProcess.push(child); } after->prev->afterSubtree = current->afterSubtree; current->bodies.clear(); } else { - this->control.toProcess.pop(); + //this->control.toProcess.pop(); } } diff --git a/bh_tree_mpi/datastructures/Tree.cpp b/bh_tree_mpi/datastructures/Tree.cpp index 3ee2e08..1829878 100644 --- a/bh_tree_mpi/datastructures/Tree.cpp +++ b/bh_tree_mpi/datastructures/Tree.cpp @@ -44,11 +44,13 @@ namespace nbody { } current = current->next; } + /* BarnesHutTree* bht = dynamic_cast(this); if (bht != NULL && !(bht->control.processedNodes == 0 && bht->control.toProcess.empty())) { cout << bht->control.toProcess.size() << endl; return false; } + */ return true; } diff --git a/bh_tree_mpi/datastructures/Tree.hpp b/bh_tree_mpi/datastructures/Tree.hpp index 10757ea..3503a8c 100644 --- a/bh_tree_mpi/datastructures/Tree.hpp +++ b/bh_tree_mpi/datastructures/Tree.hpp @@ -19,7 +19,7 @@ namespace nbody { unsigned int maxLeafBodies; Tree* tree; int processedNodes; - stack toProcess; + //stack toProcess; pthread_rwlock_t lock; } Control; -- GitLab