Commit 30140d91 authored by Pietro Incardona's avatar Pietro Incardona

Test Suite working with Parmetis

parent 5e916b35
This diff is collapsed.
......@@ -92,7 +92,7 @@ public:
//! Create sub graph
DistGraphFactory<dim, DistGraph_CSR<nm_v, nm_e>> dist_g_factory;
g = dist_g_factory.template construct<NO_EDGE, T, dim - 1, 0, 1, 2>(gr.getSize(), domain);
g = dist_g_factory.template construct<NO_EDGE, T, dim - 1, 0>(gr.getSize(), domain);
g.getDecompositionVector(vtxdist);
if (dim == 2)
......@@ -125,7 +125,7 @@ public:
for (size_t i = 0, j = g.firstId(); i < g.getNVertex() && j <= g.lastId(); i++, j++)
{
if (partition[i] != v_cl.getProcessUnitID())
if ((size_t)partition[i] != v_cl.getProcessUnitID())
g.q_move(g.nodeById(j), partition[i]);
}
g.redistribute();
......@@ -150,7 +150,7 @@ public:
for (size_t i = 0, j = g.firstId(); i < g.getNVertex() && j <= g.lastId(); i++, j++)
{
if (partition[i] != v_cl.getProcessUnitID())
if ((size_t)partition[i] != v_cl.getProcessUnitID())
g.q_move(g.nodeById(j), partition[i]);
}
g.redistribute();
......
......@@ -154,7 +154,7 @@ public:
// Create a cartesian grid graph
CartesianGraphFactory<dim, Graph_CSR<nm_v, nm_e>> g_factory_part;
gp = g_factory_part.template construct<NO_EDGE, nm_v::id, T, dim - 1, 0, 1, 2>(gr.getSize(), domain, bc);
gp = g_factory_part.template construct<NO_EDGE, nm_v::id, T, dim - 1, 0>(gr.getSize(), domain, bc);
// Init to 0.0 axis z (to fix in graphFactory)
if (dim < 3)
......
......@@ -264,7 +264,7 @@ public:
// Create a cartesian grid graph
CartesianGraphFactory<dim, Graph_CSR<nm_v, nm_e>> g_factory_part;
gp = g_factory_part.template construct<NO_EDGE, nm_v::id, T, dim - 1, 0, 1, 2>(gr.getSize(), domain, bc);
gp = g_factory_part.template construct<NO_EDGE, nm_v::id, T, dim - 1, 0>(gr.getSize(), domain, bc);
initLocalToGlobalMap();
//! Get the number of processing units
......
......@@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE( Metis_test_use)
size_t bc[] = {NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
// Graph to decompose
Graph_CSR<nm_v,nm_e> g = g_factory.construct<nm_e::communication,NO_VERTEX_ID,float,2,0,1,2>(sz,box,bc);
Graph_CSR<nm_v,nm_e> g = g_factory.construct<nm_e::communication,NO_VERTEX_ID,float,2,0>(sz,box,bc);
// Processor graph
Graph_CSR<nm_part_v,nm_part_e> gp = g_factory_part.construct<NO_EDGE,NO_VERTEX_ID,float,2>(sz,box,bc);
......
......@@ -125,7 +125,7 @@ class DistParmetis
// init basic graph informations and part vector
Mg.nvtxs[0] = sub_g.getNVertex();
Mg.part = new idx_t[sub_g.getNVertex()];
for (int i = 0; i < sub_g.getNVertex(); i++)
for (size_t i = 0; i < sub_g.getNVertex(); i++)
Mg.part[i] = p_id;
// create xadj, adjlist, vwgt, adjwgt and vsize
......
......@@ -6287,7 +6287,7 @@ LOOKUP_TABLE default
509
510
511
SCALARS sub_id unsigned_long
SCALARS sub_id long
LOOKUP_TABLE default
0
0
......
......@@ -6287,7 +6287,7 @@ LOOKUP_TABLE default
509
510
511
SCALARS sub_id unsigned_long
SCALARS sub_id long
LOOKUP_TABLE default
0
0
......
......@@ -6287,7 +6287,7 @@ LOOKUP_TABLE default
0
0
0
SCALARS sub_id unsigned_long
SCALARS sub_id long
LOOKUP_TABLE default
0
0
......
......@@ -204,8 +204,14 @@ public:
void operator()(T& t) const
{
typedef typename boost::fusion::result_of::at<v, boost::mpl::int_<0>>::type t_val;
typedef typename boost::mpl::at<typename G_v::T_type::type,t_val>::type s_type;
for (size_t i = 0 ; i < std::extent<s_type>::value ; i++)
g_v.template get<t_val::value>()[i] = 0.0;
for (size_t i = 0 ; i < dim ; i++)
g_v.template get<t_val::value>()[i] = gk.get(i) * static_cast<float>(szd[i]);
g_v.template get<t_val::value>()[T::value] = gk.get(T::value) * static_cast<float>(szd[T::value]);
fill_id<dim, G_v, lin_id>::fill(g_v, gk, gs);
}
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -167,8 +167,8 @@ class fill_prop_v<dim, dT, G_v, v, 2>
public:
//! Fill the object from where to take the properties
fill_prop_v(G_v & g_v, const dT (&szd)[dim], grid_key_dx<dim> & gk, const grid_sm<dim, void> & gs) :
szd(szd), gk(gk), g_v(g_v), gs(gs)
fill_prop_v(G_v & g_v, const dT (&szd)[dim], grid_key_dx<dim> & gk, const grid_sm<dim, void> & gs)
:szd(szd), gk(gk), g_v(g_v), gs(gs)
{
}
......@@ -177,8 +177,13 @@ public:
void operator()(T& t) const
{
typedef typename boost::fusion::result_of::at<v, boost::mpl::int_<0>>::type t_val;
typedef typename boost::mpl::at<typename G_v::T_type::type,t_val>::type s_type;
g_v.template get<t_val::value>()[T::value] = gk.get(T::value) * szd[T::value];
for (size_t i = 0 ; i < std::extent<s_type>::value ; i++)
g_v.template get<t_val::value>()[i] = 0.0;
for (size_t i = 0 ; i < dim ; i++)
g_v.template get<t_val::value>()[i] = gk.get(i) * static_cast<float>(szd[i]);
}
};
......@@ -423,7 +428,7 @@ public:
//! Distribution vector
openfpm::vector<idx_t> vtxdist(v_cl.getProcessingUnits() + 1);
for (int i = 0; i <= Np; i++)
for (size_t i = 0; i <= Np; i++)
{
if (i < mod_v)
vtxdist.get(i) = (div_v + 1) * (i);
......@@ -458,7 +463,7 @@ public:
{
size_t v_id = g.LinId(k_it.get());
if (v_id < vtxdist.get(p_id + 1) && v_id >= vtxdist.get(p_id))
if (v_id < (size_t)vtxdist.get(p_id + 1) && v_id >= (size_t)vtxdist.get(p_id))
{
grid_key_dx<dim> key = k_it.get();
......
......@@ -593,11 +593,11 @@ class DistGraph_CSR
}
// Calculate how much preallocated memory we need to pack all the objects for each vector
size_t req = ExtPreAlloc<HeapMemory>::calculateMem(pap_prp);
ExtPreAlloc<HeapMemory>::calculateMem(pap_prp);
// allocate the memory
HeapMemory & pmem = *(new HeapMemory());
pmem.allocate(req);
// pmem.allocate(req);
ExtPreAlloc<HeapMemory> & mem = *(new ExtPreAlloc<HeapMemory>(pap_prp, pmem));
mem.incRef();
......@@ -929,7 +929,7 @@ class DistGraph_CSR
{
for (size_t i = 0; i < fvtxdist.size() - 1; ++i)
{
if (vid >= fvtxdist.get(i) && vid < fvtxdist.get(i + 1))
if (vid >= (size_t)fvtxdist.get(i) && vid < (size_t)fvtxdist.get(i + 1))
{
return i;
}
......@@ -1270,13 +1270,18 @@ public:
*/
auto getVertex(size_t id) -> decltype( v.get(id) )
{
try
{
return v.get(glb2loc.at(id));
} catch (const std::out_of_range& oor)
#ifdef SE_CLASS1
if (glb2loc.find(id) == glb2loc.end())
{
std::cerr << "The vertex with global id " << id << " is not in this sub-graph. Try to call reqVertex(" << id << ") and sync() first.\n";
std::cerr << __FILE__ << ":" << __LINE__ << " The vertex with global id " << id << " is not in this sub-graph. Try to call reqVertex(" << id << ") and sync() first.\n";
ACTION_ON_ERROR(DIST_GRAPH_ERROR);
}
#endif
return v.get(glb2loc.find(id)->second);
}
/*! \brief Function to access the vertexes
......
......@@ -6,7 +6,7 @@
#include "Packer_Unpacker/Packer.hpp"
#include "Packer_Unpacker/Unpacker.hpp"
#define GS_SIZE 4
#define DGRAPH_GS_SIZE 4
struct vx
{
......@@ -133,10 +133,10 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use)
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
if(vcl.getProcessingUnits() != 4)
return;
return;
//! Cartesian grid
size_t sz[2] = { GS_SIZE, GS_SIZE };
size_t sz[2] = { DGRAPH_GS_SIZE, DGRAPH_GS_SIZE };
//! Box
Box<2, float> box( { 0.0, 0.0 }, { 1.0, 1.0 });
......@@ -192,52 +192,52 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use)
if(vcl.getProcessUnitID() == 0)
{
BOOST_REQUIRE_EQUAL(gd.getVertexId(0), 0);
BOOST_REQUIRE_EQUAL(gd.getVertexId(1), 1);
BOOST_REQUIRE_EQUAL(gd.getVertexId(2), 2);
BOOST_REQUIRE_EQUAL(gd.getVertexId(3), 3);
BOOST_REQUIRE_EQUAL(gd.getNChilds(0), 3);
BOOST_REQUIRE_EQUAL(gd.getChild(0,0), 1);
BOOST_REQUIRE_EQUAL(gd.getChild(0,1), 14);
BOOST_REQUIRE_EQUAL(gd.getChild(0,2), 4);
BOOST_REQUIRE_EQUAL(gd.getNChilds(1), 4);
BOOST_REQUIRE_EQUAL(gd.getChild(1,0), 2);
BOOST_REQUIRE_EQUAL(gd.getChild(1,1), 0);
BOOST_REQUIRE_EQUAL(gd.getChild(1,2), 15);
BOOST_REQUIRE_EQUAL(gd.getChild(1,3), 5);
BOOST_REQUIRE_EQUAL(gd.getNChilds(2), 4);
BOOST_REQUIRE_EQUAL(gd.getChild(2,0), 3);
BOOST_REQUIRE_EQUAL(gd.getChild(2,1), 1);
BOOST_REQUIRE_EQUAL(gd.getChild(2,2), 8);
BOOST_REQUIRE_EQUAL(gd.getChild(2,3), 6);
BOOST_REQUIRE_EQUAL(gd.getNChilds(3), 3);
BOOST_REQUIRE_EQUAL(gd.getChild(3,0), 2);
BOOST_REQUIRE_EQUAL(gd.getChild(3,1), 9);
BOOST_REQUIRE_EQUAL(gd.getChild(3,2), 7);
BOOST_REQUIRE_EQUAL(gd.getVertexId(0), 0ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(1), 1ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(2), 2ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(3), 3ul);
BOOST_REQUIRE_EQUAL(gd.getNChilds(0), 3ul);
BOOST_REQUIRE_EQUAL(gd.getChild(0,0), 1ul);
BOOST_REQUIRE_EQUAL(gd.getChild(0,1), 14ul);
BOOST_REQUIRE_EQUAL(gd.getChild(0,2), 4ul);
BOOST_REQUIRE_EQUAL(gd.getNChilds(1), 4ul);
BOOST_REQUIRE_EQUAL(gd.getChild(1,0), 2ul);
BOOST_REQUIRE_EQUAL(gd.getChild(1,1), 0ul);
BOOST_REQUIRE_EQUAL(gd.getChild(1,2), 15ul);
BOOST_REQUIRE_EQUAL(gd.getChild(1,3), 5ul);
BOOST_REQUIRE_EQUAL(gd.getNChilds(2), 4ul);
BOOST_REQUIRE_EQUAL(gd.getChild(2,0), 3ul);
BOOST_REQUIRE_EQUAL(gd.getChild(2,1), 1ul);
BOOST_REQUIRE_EQUAL(gd.getChild(2,2), 8ul);
BOOST_REQUIRE_EQUAL(gd.getChild(2,3), 6ul);
BOOST_REQUIRE_EQUAL(gd.getNChilds(3), 3ul);
BOOST_REQUIRE_EQUAL(gd.getChild(3,0), 2ul);
BOOST_REQUIRE_EQUAL(gd.getChild(3,1), 9ul);
BOOST_REQUIRE_EQUAL(gd.getChild(3,2), 7ul);
}
if(vcl.getProcessUnitID() == 1)
{
BOOST_REQUIRE_EQUAL(gd.getVertexId(0), 4);
BOOST_REQUIRE_EQUAL(gd.getVertexId(1), 5);
BOOST_REQUIRE_EQUAL(gd.getVertexId(2), 6);
BOOST_REQUIRE_EQUAL(gd.getVertexId(3), 7);
BOOST_REQUIRE_EQUAL(gd.getVertexId(0), 4ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(1), 5ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(2), 6ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(3), 7ul);
}
if(vcl.getProcessUnitID() == 2)
{
BOOST_REQUIRE_EQUAL(gd.getVertexId(0), 8);
BOOST_REQUIRE_EQUAL(gd.getVertexId(1), 9);
BOOST_REQUIRE_EQUAL(gd.getVertexId(2), 10);
BOOST_REQUIRE_EQUAL(gd.getVertexId(3), 11);
BOOST_REQUIRE_EQUAL(gd.getVertexId(4), 12);
BOOST_REQUIRE_EQUAL(gd.getVertexId(5), 13);
BOOST_REQUIRE_EQUAL(gd.getVertexId(0), 8ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(1), 9ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(2), 10ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(3), 11ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(4), 12ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(5), 13ul);
}
if(vcl.getProcessUnitID() == 3)
{
BOOST_REQUIRE_EQUAL(gd.getVertexId(0), 14);
BOOST_REQUIRE_EQUAL(gd.getVertexId(1), 15);
BOOST_REQUIRE_EQUAL(gd.getVertexId(0), 14ul);
BOOST_REQUIRE_EQUAL(gd.getVertexId(1), 15ul);
}
}
......@@ -247,7 +247,7 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_redistribution)
Vcluster & vcl = *global_v_cluster;
if(vcl.getProcessingUnits() != 4)
return;
return;
//! Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
......@@ -326,131 +326,6 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_redistribution)
}
BOOST_AUTO_TEST_CASE( dist_map_graph_use_cartesian)
{
//! Vcluster
Vcluster & vcl = *global_v_cluster;
// if(vcl.getProcessingUnits() != 3)
// return;
// non-periodic boundary condition
size_t bc[3] = {NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
//! [Create CartDecomposition]
CartDecomposition<3, float> dec(vcl);
// Physical domain
Box<3, float> box( { 0.0, 0.0, 0.0 }, { 1.0, 1.0, 1.0 });
size_t div[3] = {8,8,8};
// Grid size and info
size_t gsz[3] = {8,8,8};
grid_sm<3,void> g_sm(gsz);
// Define ghost
Ghost<3, float> g(0.01);
// Decompose
dec.setParameters(div, box, bc, g);
dec.decompose();
grid_dist_id_iterator_dec<CartDecomposition<3,float>> it_dec(dec,gsz);
size_t cnt = 0;
while (it_dec.isNext())
{
cnt++;
++it_dec;
}
openfpm::vector<size_t> v_cnt(vcl.getProcessingUnits());
// Sent and receive the size of each subgraph
vcl.allGather(cnt, v_cnt);
vcl.execute();
cnt = 0;
for (long int i = 0; i <= ((long int)vcl.getProcessUnitID()) - 1 ; ++i)
cnt += v_cnt.get(i);
// count the points
//! Distributed graph
DistGraph_CSR<aggregate<size_t[3]>, aggregate<size_t>> dg;
grid_dist_id_iterator_dec<CartDecomposition<3,float>> it_dec2(dec,gsz);
while (it_dec2.isNext())
{
auto key = it_dec2.get();
aggregate<size_t[3]> v;
v.template get<0>()[0] = key.get(0);
v.template get<0>()[1] = key.get(1);
v.template get<0>()[2] = key.get(2);
size_t gid = g_sm.LinId(key);
dg.add_vertex(v, gid, cnt);
cnt++;
++it_dec2;
}
dg.init();
// we ask for some random vertex
std::default_random_engine rg;
std::uniform_int_distribution<size_t> d(0,g_sm.size()-1);
openfpm::vector<size_t> v_req;
/* for (size_t i = 0 ; i < 16 ; i++)
{
size_t v = d(rg);*/
if (vcl.getProcessUnitID() == 0)
dg.reqVertex(450);
/* dg.reqVertex(v);
}*/
dg.sync();
if (vcl.getProcessUnitID() == 0)
{
grid_key_dx<3> key;
// get the position information
key.set_d(0,dg.getVertex(450).template get<0>()[0]);
key.set_d(1,dg.getVertex(450).template get<0>()[1]);
key.set_d(2,dg.getVertex(450).template get<0>()[2]);
size_t lin_id = g_sm.LinId(key);
// BOOST_REQUIRE_EQUAL(lin_id,v_req.get(i));
std::cout << "Error: " << " " << lin_id << " " << key.to_string() << "\n";
}
/* for (size_t i = 0 ; i < 16 ; i++)
{
grid_key_dx<3> key;
// get the position information
key.set_d(0,dg.getVertex(v_req.get(i)).template get<0>()[0]);
key.set_d(1,dg.getVertex(v_req.get(i)).template get<0>()[1]);
key.set_d(2,dg.getVertex(v_req.get(i)).template get<0>()[2]);
size_t lin_id = g_sm.LinId(key);
// BOOST_REQUIRE_EQUAL(lin_id,v_req.get(i));
std::cout << "Error: " << i << " " << lin_id << " " << v_req.get(i) << "\n";
}*/
/* if (vcl.getProcessUnitID() == 0)
std::cout << "Error: " << i << " " << lin_id << " " << v_req.get(i) << "\n";*/
}
BOOST_AUTO_TEST_CASE( dist_map_graph_use_free_add)
{
......@@ -458,7 +333,7 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_free_add)
Vcluster & vcl = *global_v_cluster;
if(vcl.getProcessingUnits() != 4)
return;
return;
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc,&boost::unit_test::framework::master_test_suite().argv);
......@@ -549,7 +424,7 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_free_add)
gd.sync();
if(vcl.getProcessUnitID() == 0)
BOOST_REQUIRE_EQUAL(gd.getVertexId(5), 5);
BOOST_REQUIRE_EQUAL(gd.getVertexId(5), 5ul);
gd.deleteGhosts();
......@@ -617,7 +492,7 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_multi_free_add)
Vcluster & vcl = *global_v_cluster;
if(vcl.getProcessingUnits() != 4)
return;
return;
// Initialize the global VCluster
init_global_v_cluster(&boost::unit_test::framework::master_test_suite().argc, &boost::unit_test::framework::master_test_suite().argv);
......@@ -672,7 +547,7 @@ BOOST_AUTO_TEST_CASE( dist_map_graph_use_multi_free_add)
gd.sync();
BOOST_REQUIRE_EQUAL(gd.getVertexId(gd.getNVertex()-1), 15);
BOOST_REQUIRE_EQUAL(gd.getVertexId(gd.getNVertex()-1), 15ul);
}
BOOST_AUTO_TEST_SUITE_END()
......
......@@ -18,7 +18,7 @@
#include "Packer_Unpacker/Packer.hpp"
#include "Packer_Unpacker/Unpacker.hpp"
#define SUB_UNIT_FACTOR 64
#define GRID_SUB_UNIT_FACTOR 64
/*! \brief This is a distributed grid
......@@ -480,7 +480,7 @@ class grid_dist_id
// Get the number of processor and calculate the number of sub-domain
// for decomposition
size_t n_proc = v_cl.getProcessingUnits();
size_t n_sub = n_proc * SUB_UNIT_FACTOR;
size_t n_sub = n_proc * GRID_SUB_UNIT_FACTOR;
// Calculate the maximum number (before merging) of sub-domain on
// each dimension
......
......@@ -25,8 +25,11 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
print_test( "Testing 3D extended grid k<=",k);
// 3D test
for ( ; k >= 2 ; k-= (k > 2*big_step)?big_step:small_step )
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
// This test in order to work must have at least one ghost
for ( ; (0.01 / factor) > (domain.getHigh(0) - domain.getLow(0) / k) ; k-= (k > 2*big_step)?big_step:small_step )
{
BOOST_TEST_CHECKPOINT( "Testing 3D extended grid k=" << k );
......@@ -36,9 +39,6 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
sz[1] = k;
sz[2] = k;
// factor
float factor = pow(global_v_cluster->getProcessingUnits()/2.0f,1.0f/3.0f);
// Ghost
Ghost<3,float> g(0.01 / factor);
......@@ -86,8 +86,6 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
// Get domain iterator
grid_sm<3,void> info = g_dist2.getGridInfo();
size_t cnt = 0;
auto dom_g3 = g_dist2.getDomainIterator();
check = false;
......@@ -123,15 +121,9 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
auto key2 = g_dist2.getGKey(key1);
check &= g_dist2.template get<0>(key1)[0] == key2.get(0);
check &= g_dist2.template get<0>(key1)[1] == key2.get(1);
check &= g_dist2.template get<0>(key1)[2] == key2.get(2);
if (check == false)
{
int debug = 0;
debug++;
}
check &= g_dist2.template get<0>(key1)[0] == (size_t)key2.get(0);
check &= g_dist2.template get<0>(key1)[1] == (size_t)key2.get(1);
check &= g_dist2.template get<0>(key1)[2] == (size_t)key2.get(2);
auto key3 = dom_g4.get();
......@@ -141,20 +133,13 @@ void Test3D_extended_grid(const Box<3,float> & domain, long int k)
auto key4 = g_dist2.getGKey(key3);
check &= g_dist2.template get<0>(key3)[0] == key4.get(0);
check &= g_dist2.template get<0>(key3)[1] == key4.get(1);
check &= g_dist2.template get<0>(key3)[2] == key4.get(2);
if (check == false)
{
int debug = 0;
debug++;
}
check &= g_dist2.template get<0>(key3)[0] == (size_t)key4.get(0);
check &= g_dist2.template get<0>(key3)[1] == (size_t)key4.get(1);
check &= g_dist2.template get<0>(key3)[2] == (size_t)key4.get(2);
++dom_g4;
}
std::cout << "k=" << k << "\n";
BOOST_REQUIRE_EQUAL(check,true);
}
}
......
......@@ -5,14 +5,16 @@ pdata_SOURCES = main.cpp lib/pdata.cpp test_multiple_o.cpp ../openfpm_devices/sr
pdata_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(PARMETIS_INCLUDE) $(METIS_INCLUDE) $(BOOST_CPPFLAGS) $(H5PART_INCLUDE) -DPARALLEL_IO $(HDF5_CPPFLAGS) -Wno-unused-local-typedefs
pdata_CFLAGS = $(CUDA_CFLAGS)
pdata_LDADD = $(LINKLIBS) -lmetis -lparmetis
nobase_include_HEADERS = Decomposition/CartDecomposition.hpp Decomposition/common.hpp Decomposition/Decomposition.hpp Decomposition/ie_ghost.hpp \
nobase_include_HEADERS = Decomposition/CartDecomposition.hpp Decomposition/CartDecomposition_ext.hpp Decomposition/common.hpp Decomposition/Decomposition.hpp Decomposition/ie_ghost.hpp \
Decomposition/nn_processor.hpp Decomposition/ie_loc_ghost.hpp Decomposition/ORB.hpp \
Graph/CartesianGraphFactory.hpp \
Grid/grid_dist_id.hpp Grid/grid_dist_id_iterator_dec.hpp Grid/grid_dist_util.hpp Grid/grid_dist_id_iterator_sub.hpp Grid/grid_dist_id_iterator.hpp Grid/grid_dist_key.hpp \
Vector/vector_dist.hpp Vector/vector_dist_ofb.hpp Vector/vector_dist_iterator.hpp Vector/vector_dist_key.hpp \
config/config.h \
example.mk \
Decomposition/Distribution/metis_util.hpp Decomposition/Distribution/parmetis_util.hpp dec_optimizer.hpp SubdomainGraphNodes.hpp
Decomposition/Distribution/metis_util.hpp Decomposition/Distribution/parmetis_dist_util.hpp Decomposition/Distribution/parmetis_util.hpp Decomposition/Distribution/MetisDistribution.hpp Decomposition/Distribution/ParMetisDistribution.hpp Decomposition/Distribution/DistParMetisDistribution.hpp dec_optimizer.hpp SubdomainGraphNodes.hpp \
Graph/ids.hpp Graph/dist_map_graph.hpp Graph/DistGraphFactory.hpp \
DLB/DLB.hpp
lib_LIBRARIES = libofpm_pdata.a
libofpm_pdata_a_SOURCES = lib/pdata.cpp
......
......@@ -1035,8 +1035,6 @@ public:
// extend by the ghost
pbox.enlarge(enlarge);
// Box<dim, St> cell_box;
size_t div[dim];
// Calculate the division array and the cell box
......@@ -1273,7 +1271,7 @@ public:
* \return if the file has been written correctly
*
*/
inline bool write(std::string out, int opt = NO_GHOST | VTK_WRITER)
inline bool write(std::string out, int opt = NO_GHOST | CSV_WRITER)
{
if ((opt & 0xFFFF0000) == CSV_WRITER)
......@@ -1286,7 +1284,7 @@ public:
// Write the CSV
return csv_writer.write(output,v_pos,v_prp);
}
else if ((opt & 0xFFFF0000) == VTK_WRITER)
/* else if ((opt & 0xFFFF0000) == VTK_WRITER)
{
// CSVWriter test
VTKWriter<boost::mpl::pair<openfpm::vector<Point<dim,St>>, openfpm::vector<prop>>, VECTOR_POINTS> vtk_writer;
......@@ -1299,7 +1297,7 @@ public:
else if ((opt & 0xFFFF0000) == H5PART_WRITER)
{
}
}*/
}
/*! \brief Output particle position and properties
......
......@@ -250,7 +250,10 @@ BOOST_AUTO_TEST_CASE( vector_dist_ghost )
++g_it;
}
BOOST_REQUIRE(n_part != 0);
if (v_cl.getProcessingUnits() > 1)
{
BOOST_REQUIRE(n_part != 0);
}
CellDecomposer_sm<2,float> cd(SpaceBox<2,float>(box),g_div,0);
......
......@@ -672,12 +672,22 @@ public:
*/
template <unsigned int p_sub, unsigned int p_id> void optimize(Graph & graph, long int pr_id, openfpm::vector<Box<dim,size_t>> & lb, openfpm::vector< openfpm::vector<size_t> > & box_nn_processor, const size_t (& bc)[dim])
{
grid_key_dx<dim> key_seed;
key_seed.zero();
// if processor is -1 call optimize with -1 to do on all processors and exit
if (pr_id == -1)
{
optimize<p_sub,p_id>(key_seed,graph,pr_id,lb,box_nn_processor,bc);
return;
}