Commit cb130fcf authored by incardon's avatar incardon

Small fix for emty processors

parent bdb0f365
...@@ -268,12 +268,24 @@ public: ...@@ -268,12 +268,24 @@ public:
d_o.template optimize<nm_v::sub_id, nm_v::proc_id>(dist.getGraph(), p_id, loc_box, box_nn_processor,ghe,bc); d_o.template optimize<nm_v::sub_id, nm_v::proc_id>(dist.getGraph(), p_id, loc_box, box_nn_processor,ghe,bc);
// Initialize // Initialize
if (loc_box.size() >= 0) if (loc_box.size() > 0)
{ {
bbox = convertDecBoxIntoSubDomain(loc_box.get(0)); bbox = convertDecBoxIntoSubDomain(loc_box.get(0));
proc_box = loc_box.get(0); proc_box = loc_box.get(0);
sub_domains.add(bbox); sub_domains.add(bbox);
} }
else
{
// invalidate all the boxes
for (size_t i = 0 ; i < dim ; i++)
{
proc_box.setLow(i,0.0);
proc_box.setHigh(i,(size_t)-1);
bbox.setLow(i,0.0);
bbox.setHigh(i,(size_t)-1);
}
}
// convert into sub-domain // convert into sub-domain
for (size_t s = 1; s < loc_box.size(); s++) for (size_t s = 1; s < loc_box.size(); s++)
...@@ -327,19 +339,23 @@ public: ...@@ -327,19 +339,23 @@ public:
{ {
// Get the processor bounding Box // Get the processor bounding Box
::Box<dim,T> bound = getProcessorBounds(); ::Box<dim,T> bound = getProcessorBounds();
// Not necessary, but I prefer
bound.enlarge(ghost);
// calculate the sub-divisions if (bound.isValid() == true)
size_t div[dim]; {
for (size_t i = 0; i < dim; i++) // Not necessary, but I prefer
div[i] = (size_t) ((bound.getHigh(i) - bound.getLow(i)) / cd.getCellBox().getP2()[i]); bound.enlarge(ghost);
// Initialize the geo_cell structure // calculate the sub-divisions
ie_ghost<dim,T>::Initialize_geo_cell(bound,div); size_t div[dim];
for (size_t i = 0; i < dim; i++)
div[i] = (size_t) ((bound.getHigh(i) - bound.getLow(i)) / cd.getCellBox().getP2()[i]);
// Initialize shift vectors // Initialize the geo_cell structure
ie_ghost<dim,T>::generateShiftVectors(domain); ie_ghost<dim,T>::Initialize_geo_cell(bound,div);
// Initialize shift vectors
ie_ghost<dim,T>::generateShiftVectors(domain);
}
} }
/*! \brief Calculate communication and migration costs /*! \brief Calculate communication and migration costs
......
...@@ -471,7 +471,7 @@ public: ...@@ -471,7 +471,7 @@ public:
#ifdef SE_CLASS1 #ifdef SE_CLASS1
if (id >= gp.getNVertex()) if (id >= gp.getNVertex())
std::cerr << << __FILE__ << ":" << __LINE__ << "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 #endif
// Update vertex in main graph // Update vertex in main graph
...@@ -545,10 +545,10 @@ public: ...@@ -545,10 +545,10 @@ public:
*/ */
void setCommunicationCost(size_t v_id, size_t e, size_t communication) void setCommunicationCost(size_t v_id, size_t e, size_t communication)
{ {
size_t e_id = v_id + e; #ifdef SE_CLASS1
if (e_id >= gp.getNEdge()) if (e_id >= gp.getNEdge())
std::cerr << "Such edge doesn't exist (id = " << e_id << ", " << "total size = " << gp.getNEdge() << ")\n"; std::cerr << "Such edge doesn't exist (id = " << e_id << ", " << "total size = " << gp.getNEdge() << ")\n";
#endif
gp.getChildEdge(v_id, e).template get<nm_e::communication>() = communication; gp.getChildEdge(v_id, e).template get<nm_e::communication>() = communication;
} }
......
...@@ -1488,6 +1488,14 @@ public: ...@@ -1488,6 +1488,14 @@ public:
*/ */
template<int ... prp> inline void ghost_get(size_t opt = WITH_POSITION) template<int ... prp> inline void ghost_get(size_t opt = WITH_POSITION)
{ {
#ifdef SE_CLASS1
if (getDecomposition().getProcessorBounds().isValid() == false && vd.size_local() != 0)
{
std::cerr << __FILE__ << ":" << __LINE__ << " Error the processor " << v_cl.getProcessorUnitID() << " has particles, but is supposed to be unloaded" << std::endl;
ACTION_ON_ERROR(VECTOR_DIST_ERROR_OBJECT);
}
#endif
#ifdef SE_CLASS3 #ifdef SE_CLASS3
se3.template ghost_get_pre<prp...>(opt); se3.template ghost_get_pre<prp...>(opt);
#endif #endif
......
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