Commit cb130fcf authored by incardon's avatar incardon

Small fix for emty processors

parent bdb0f365
......@@ -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);
// Initialize
if (loc_box.size() >= 0)
if (loc_box.size() > 0)
{
bbox = convertDecBoxIntoSubDomain(loc_box.get(0));
proc_box = loc_box.get(0);
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
for (size_t s = 1; s < loc_box.size(); s++)
......@@ -327,19 +339,23 @@ public:
{
// Get the processor bounding Box
::Box<dim,T> bound = getProcessorBounds();
// Not necessary, but I prefer
bound.enlarge(ghost);
// calculate the sub-divisions
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]);
if (bound.isValid() == true)
{
// Not necessary, but I prefer
bound.enlarge(ghost);
// Initialize the geo_cell structure
ie_ghost<dim,T>::Initialize_geo_cell(bound,div);
// calculate the sub-divisions
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
ie_ghost<dim,T>::generateShiftVectors(domain);
// Initialize the geo_cell structure
ie_ghost<dim,T>::Initialize_geo_cell(bound,div);
// Initialize shift vectors
ie_ghost<dim,T>::generateShiftVectors(domain);
}
}
/*! \brief Calculate communication and migration costs
......
......@@ -471,7 +471,7 @@ public:
#ifdef SE_CLASS1
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
// Update vertex in main graph
......@@ -545,10 +545,10 @@ public:
*/
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())
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;
}
......
......@@ -1488,6 +1488,14 @@ public:
*/
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
se3.template ghost_get_pre<prp...>(opt);
#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