From bdb0f3655f3a6f1fb85231f7efcb4bb0f8fad402 Mon Sep 17 00:00:00 2001 From: Pietro Incardona Date: Wed, 5 Apr 2017 14:13:35 +0200 Subject: [PATCH] With the latest modules --- openfpm_io | 2 +- src/Decomposition/CartDecomposition.hpp | 13 +----------- .../Distribution/DistParMetisDistribution.hpp | 17 +++++++++++----- .../Distribution/ParMetisDistribution.hpp | 20 ++++++++++++++----- .../Distribution/SpaceDistribution.hpp | 4 +++- src/Vector/vector_dist.hpp | 2 +- 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/openfpm_io b/openfpm_io index 63f84d6..fa73ac9 160000 --- a/openfpm_io +++ b/openfpm_io @@ -1 +1 @@ -Subproject commit 63f84d6cb412686aa96642b1128e632b17e26bcf +Subproject commit fa73ac920c9f6593245999add78ca5490c797520 diff --git a/src/Decomposition/CartDecomposition.hpp b/src/Decomposition/CartDecomposition.hpp index 79649e8..f283550 100755 --- a/src/Decomposition/CartDecomposition.hpp +++ b/src/Decomposition/CartDecomposition.hpp @@ -295,19 +295,8 @@ public: // fine_s structure contain the processor id for each sub-sub-domain // with sub-sub-domain we mean the sub-domain decomposition before // running dec_optimizer (before merging sub-domains) -/* auto it = dist.getGraph().getVertexIterator(); - while (it.isNext()) - { - size_t key = it.get(); - - // fill with the fine decomposition - fine_s.get(key) = dist.getGraph().template vertex_p(key); - - ++it; - }*/ - grid_key_dx_iterator git(gr); while (git.isNext()) @@ -1008,7 +997,7 @@ public: for (size_t i = 0 ; i < dim ; i++) { if (gr.size(i) % gm.size(i) != 0) - std::cerr << __FILE__ << ":" << __LINE__ << ".Error the distribution grid must be multiple of the decomposition grid" << std::endl; + std::cerr << __FILE__ << ":" << __LINE__ << ".Error the decomposition grid specified as gr.size(" << i << ")=" << gr.size(i) << " is not multiple of the distribution grid gm.size(" << i << ")=" << gm.size(i) << std::endl; magn[i] = gr.size(i) / gm.size(i); } diff --git a/src/Decomposition/Distribution/DistParMetisDistribution.hpp b/src/Decomposition/Distribution/DistParMetisDistribution.hpp index fd67feb..e88c4d6 100644 --- a/src/Decomposition/Distribution/DistParMetisDistribution.hpp +++ b/src/Decomposition/Distribution/DistParMetisDistribution.hpp @@ -189,8 +189,10 @@ public: */ void getSubSubDomainPosition(size_t id, T (&pos)[dim]) { +#ifdef SE_CLASS1 if (id >= g.getNVertex()) - std::cerr << "Position - Such vertex doesn't exist (id = " << id << ", " << "total size = " << g.getNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << " Position - Such vertex doesn't exist (id = " << id << ", " << "total size = " << g.getNVertex() << ")\n"; +#endif pos[0] = g.vertex(id).template get()[0]; pos[1] = g.vertex(id).template get()[1]; @@ -207,9 +209,10 @@ public: inline void setComputationCost(size_t id, size_t weight) { verticesGotWeights = true; - +#ifdef SE_CLASS1 if (id >= g.getNVertex()) - std::cerr << "Weight - Such vertex doesn't exist (id = " << id << ", " << "total size = " << g.getNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << "Weight - Such vertex doesn't exist (id = " << id << ", " << "total size = " << g.getNVertex() << ")\n"; +#endif // If the vertex is inside this processor update the value g.vertex(id).template get() = weight; @@ -232,8 +235,10 @@ public: */ size_t getVertexWeight(size_t id) { +#ifdef SE_CLASS1 if (id >= g.getNVertex()) - std::cerr << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << g.getTotNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << g.getTotNVertex() << ")\n"; +#endif return g.vertex(id).template get(); } @@ -284,8 +289,10 @@ public: */ void setMigrationCost(size_t id, size_t migration) { +#ifdef SE_CLASS1 if (id >= g.getNVertex()) - std::cerr << "Migration - Such vertex doesn't exist (id = " << id << ", " << "total size = " << g.getNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << "Migration - Such vertex doesn't exist (id = " << id << ", " << "total size = " << g.getNVertex() << ")\n"; +#endif g.vertex(id).template get() = migration; } diff --git a/src/Decomposition/Distribution/ParMetisDistribution.hpp b/src/Decomposition/Distribution/ParMetisDistribution.hpp index 1c61eeb..ed14061 100644 --- a/src/Decomposition/Distribution/ParMetisDistribution.hpp +++ b/src/Decomposition/Distribution/ParMetisDistribution.hpp @@ -446,8 +446,10 @@ public: */ void getSubSubDomainPosition(size_t id, T (&pos)[dim]) { +#ifdef SE_CLASS1 if (id >= gp.getNVertex()) - std::cerr << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; +#endif // Copy the geometrical informations inside the pos vector pos[0] = gp.vertex(id).template get()[0]; @@ -467,8 +469,10 @@ public: if (!verticesGotWeights) verticesGotWeights = true; +#ifdef SE_CLASS1 if (id >= gp.getNVertex()) - std::cerr << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; + std::cerr << << __FILE__ << ":" << __LINE__ << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; +#endif // Update vertex in main graph gp.vertex(id).template get() = weight; @@ -490,8 +494,10 @@ public: */ size_t getSubSubDomainComputationCost(size_t id) { +#ifdef SE_CLASS1 if (id >= gp.getNVertex()) - std::cerr << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; +#endif return gp.vertex(id).template get(); } @@ -523,8 +529,10 @@ public: */ void setMigrationCost(size_t id, size_t migration) { +#ifdef SE_CLASS1 if (id >= gp.getNVertex()) - std::cerr << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; +#endif gp.vertex(id).template get() = migration; } @@ -559,8 +567,10 @@ public: */ size_t getNSubSubDomainNeighbors(size_t id) { +#ifdef SE_CLASS1 if (id >= gp.getNVertex()) - std::cerr << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; +#endif return gp.getNChilds(id); } diff --git a/src/Decomposition/Distribution/SpaceDistribution.hpp b/src/Decomposition/Distribution/SpaceDistribution.hpp index 346008d..80b67ce 100644 --- a/src/Decomposition/Distribution/SpaceDistribution.hpp +++ b/src/Decomposition/Distribution/SpaceDistribution.hpp @@ -245,8 +245,10 @@ public: */ void getSubSubDomainPosition(size_t id, T (&pos)[dim]) { +#ifdef SE_CLASS1 if (id >= gp.getNVertex()) - std::cerr << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; + std::cerr << __FILE__ << ":" << __LINE__ << "Such vertex doesn't exist (id = " << id << ", " << "total size = " << gp.getNVertex() << ")\n"; +#endif // Copy the geometrical informations inside the pos vector pos[0] = gp.vertex(id).template get()[0]; diff --git a/src/Vector/vector_dist.hpp b/src/Vector/vector_dist.hpp index dd54c6e..821bdc9 100644 --- a/src/Vector/vector_dist.hpp +++ b/src/Vector/vector_dist.hpp @@ -1564,7 +1564,7 @@ public: Decomposition & dec = getDecomposition(); - cdsm.setDimensions(dec.getDomain(), dec.getGrid().getSize(), 0); + cdsm.setDimensions(dec.getDomain(), dec.getDistGrid().getSize(), 0); for (size_t i = 0; i < getDecomposition().getNSubSubDomains(); i++) dec.setSubSubDomainComputationCost(i, 1); -- GitLab