Commit 729f6c63 authored by Pietro Incardona's avatar Pietro Incardona

A disaster

parent 021ee35b
......@@ -1019,6 +1019,10 @@ public:
{
std::cout << std::setprecision(3) << unbalance << "\n";
}
// write(v_cl.getProcessUnitID() + "_"+ std::to_string(n_step) + "_AAAAAA");
// n_step++;
}
if (dlb.rebalanceNeeded())
......@@ -1030,6 +1034,8 @@ public:
return false;
}
// size_t n_step = 0;
/*! \brief Get the current un-balance value
*
* \return the un-balance percentage value
......
......@@ -67,6 +67,7 @@
#include "VCluster.hpp"
#define NO_EDGE -1
#define DIST_GRAPH_ERROR 7001
template<typename V, typename E, template<typename, typename, typename, unsigned int> class VertexList, template<typename, typename, typename, unsigned int> class EdgeList, typename Memory, typename grow_p>
class DistGraph_CSR;
......
......@@ -109,10 +109,10 @@ private:
openfpm::vector<size_t> ghost_prc_sz;
//! Sending buffer for the ghost particles properties
Memory g_prp_mem;
HeapMemory g_prp_mem;
//! Sending buffer for the ghost particles position
Memory g_pos_mem;
HeapMemory g_pos_mem;
//! For each adjacent processor it store the size of the receiving message in byte
openfpm::vector<size_t> recv_sz;
......@@ -232,9 +232,20 @@ private:
size_t p_id = vp_id.get(i).first;
// add particle to communicate
ghost_prc_sz.get(p_id)++;opart
.get(p_id).add(key);
ghost_prc_sz.get(p_id)++;
opart.get(p_id).add(key);
oshift.get(p_id).add(vp_id.get(i).second);
/////// DEBUG /////////////
if (v_pos.template get<0>(key)[0] >= 0.653903 && v_pos.template get<0>(key)[0] <= 0.653905 &&
v_pos.template get<0>(key)[1] >= 0.989091 && v_pos.template get<0>(key)[1] <= 0.989093)
{
std::cerr << "DETECTED BASTARD" << "\n";
}
////////////////////////////
}
++it;
......@@ -555,6 +566,26 @@ private:
// resize with the number of elements
v2.resize(n_ele);
///////// DEBUG /////////////////////
// Check that all the particles are inside the processor boud enlarged by ghost
Ghost<dim,St> g = dec.getGhost();
g.magnify(1.01);
auto pbox = dec.getProcessorBounds();
pbox.enlarge(g);
for (size_t j = 0 ; j < v2.size() ; j++)
{
if (pbox.isInside(v2.get(j)) == false)
{
std::cerr << "AAAAAAAAAAAAAAAAAAA" << "/n";
}
}
//////////////////////////////////////
// Add the ghost particle
v_pos.template add<PtrMemory, openfpm::grow_policy_identity>(v2);
}
......@@ -838,6 +869,13 @@ public:
*/
template<int ... prp> void ghost_get(size_t opt = WITH_POSITION)
{
// Unload receive buffer
for (size_t i = 0 ; i < recv_mem_gg.size() ; i++)
{
recv_mem_gg.get(i).destroy();
recv_sz.get(i) = 0;
}
// Sending property object
typedef object<typename object_creator<typename prop::type, prp...>::type> prp_object;
......@@ -1008,7 +1046,11 @@ public:
*/
template<typename CellL = CellList<dim, St, FAST, shift<dim, St> > > CellL getCellList(St r_cut)
{
return getCellList(r_cut, dec.getGhost());
// Get ghost and anlarge by 1%
Ghost<dim,St> g = dec.getGhost();
g.magnify(1.01);
return getCellList(r_cut, g);
}
/*! \brief Construct a cell list starting from the stored particles
......@@ -1237,6 +1279,14 @@ public:
g_m -= keys.size();
}
void remove(size_t key)
{
v_pos.remove(key);
v_prp.remove(key);
g_m--;
}
inline void addComputationCosts()
{
CellDecomposer_sm<dim, St> cdsm;
......@@ -1298,6 +1348,16 @@ public:
}*/
}
/*! \brief Delete the particles on the ghost
*
*
*/
void deleteGhost()
{
v_pos.resize(g_m);
v_prp.resize(g_m);
}
/*! \brief Output particle position and properties
*
* \param out output
......
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