Commit bdb0f365 authored by incardon's avatar incardon

With the latest modules

parent 3099e276
openfpm_io @ fa73ac92
Subproject commit 63f84d6cb412686aa96642b1128e632b17e26bcf Subproject commit fa73ac920c9f6593245999add78ca5490c797520
...@@ -295,19 +295,8 @@ public: ...@@ -295,19 +295,8 @@ public:
// fine_s structure contain the processor id for each sub-sub-domain // fine_s structure contain the processor id for each sub-sub-domain
// with sub-sub-domain we mean the sub-domain decomposition before // with sub-sub-domain we mean the sub-domain decomposition before
// running dec_optimizer (before merging sub-domains) // 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<nm_v::proc_id>(key);
++it;
}*/
grid_key_dx_iterator<dim> git(gr); grid_key_dx_iterator<dim> git(gr);
while (git.isNext()) while (git.isNext())
...@@ -1008,7 +997,7 @@ public: ...@@ -1008,7 +997,7 @@ public:
for (size_t i = 0 ; i < dim ; i++) for (size_t i = 0 ; i < dim ; i++)
{ {
if (gr.size(i) % gm.size(i) != 0) 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); magn[i] = gr.size(i) / gm.size(i);
} }
......
...@@ -189,8 +189,10 @@ public: ...@@ -189,8 +189,10 @@ public:
*/ */
void getSubSubDomainPosition(size_t id, T (&pos)[dim]) void getSubSubDomainPosition(size_t id, T (&pos)[dim])
{ {
#ifdef SE_CLASS1
if (id >= g.getNVertex()) 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<nm_v::x>()[0]; pos[0] = g.vertex(id).template get<nm_v::x>()[0];
pos[1] = g.vertex(id).template get<nm_v::x>()[1]; pos[1] = g.vertex(id).template get<nm_v::x>()[1];
...@@ -207,9 +209,10 @@ public: ...@@ -207,9 +209,10 @@ public:
inline void setComputationCost(size_t id, size_t weight) inline void setComputationCost(size_t id, size_t weight)
{ {
verticesGotWeights = true; verticesGotWeights = true;
#ifdef SE_CLASS1
if (id >= g.getNVertex()) 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 // If the vertex is inside this processor update the value
g.vertex(id).template get<nm_v::computation>() = weight; g.vertex(id).template get<nm_v::computation>() = weight;
...@@ -232,8 +235,10 @@ public: ...@@ -232,8 +235,10 @@ public:
*/ */
size_t getVertexWeight(size_t id) size_t getVertexWeight(size_t id)
{ {
#ifdef SE_CLASS1
if (id >= g.getNVertex()) 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<nm_v::computation>(); return g.vertex(id).template get<nm_v::computation>();
} }
...@@ -284,8 +289,10 @@ public: ...@@ -284,8 +289,10 @@ public:
*/ */
void setMigrationCost(size_t id, size_t migration) void setMigrationCost(size_t id, size_t migration)
{ {
#ifdef SE_CLASS1
if (id >= g.getNVertex()) 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<nm_v::migration>() = migration; g.vertex(id).template get<nm_v::migration>() = migration;
} }
......
...@@ -446,8 +446,10 @@ public: ...@@ -446,8 +446,10 @@ public:
*/ */
void getSubSubDomainPosition(size_t id, T (&pos)[dim]) void getSubSubDomainPosition(size_t id, T (&pos)[dim])
{ {
#ifdef SE_CLASS1
if (id >= gp.getNVertex()) 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 // Copy the geometrical informations inside the pos vector
pos[0] = gp.vertex(id).template get<nm_v::x>()[0]; pos[0] = gp.vertex(id).template get<nm_v::x>()[0];
...@@ -467,8 +469,10 @@ public: ...@@ -467,8 +469,10 @@ public:
if (!verticesGotWeights) if (!verticesGotWeights)
verticesGotWeights = true; verticesGotWeights = true;
#ifdef SE_CLASS1
if (id >= gp.getNVertex()) 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 // Update vertex in main graph
gp.vertex(id).template get<nm_v::computation>() = weight; gp.vertex(id).template get<nm_v::computation>() = weight;
...@@ -490,8 +494,10 @@ public: ...@@ -490,8 +494,10 @@ public:
*/ */
size_t getSubSubDomainComputationCost(size_t id) size_t getSubSubDomainComputationCost(size_t id)
{ {
#ifdef SE_CLASS1
if (id >= gp.getNVertex()) 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<nm_v::computation>(); return gp.vertex(id).template get<nm_v::computation>();
} }
...@@ -523,8 +529,10 @@ public: ...@@ -523,8 +529,10 @@ public:
*/ */
void setMigrationCost(size_t id, size_t migration) void setMigrationCost(size_t id, size_t migration)
{ {
#ifdef SE_CLASS1
if (id >= gp.getNVertex()) 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<nm_v::migration>() = migration; gp.vertex(id).template get<nm_v::migration>() = migration;
} }
...@@ -559,8 +567,10 @@ public: ...@@ -559,8 +567,10 @@ public:
*/ */
size_t getNSubSubDomainNeighbors(size_t id) size_t getNSubSubDomainNeighbors(size_t id)
{ {
#ifdef SE_CLASS1
if (id >= gp.getNVertex()) 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); return gp.getNChilds(id);
} }
......
...@@ -245,8 +245,10 @@ public: ...@@ -245,8 +245,10 @@ public:
*/ */
void getSubSubDomainPosition(size_t id, T (&pos)[dim]) void getSubSubDomainPosition(size_t id, T (&pos)[dim])
{ {
#ifdef SE_CLASS1
if (id >= gp.getNVertex()) 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 // Copy the geometrical informations inside the pos vector
pos[0] = gp.vertex(id).template get<nm_v::x>()[0]; pos[0] = gp.vertex(id).template get<nm_v::x>()[0];
......
...@@ -1564,7 +1564,7 @@ public: ...@@ -1564,7 +1564,7 @@ public:
Decomposition & dec = getDecomposition(); 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++) for (size_t i = 0; i < getDecomposition().getNSubSubDomains(); i++)
dec.setSubSubDomainComputationCost(i, 1); dec.setSubSubDomainComputationCost(i, 1);
......
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