Commit 190a678c authored by incardon's avatar incardon

Changed step size + Fixing METIS

parent 76b26a9b
......@@ -1309,11 +1309,6 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IallreduceW.hpp \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IrecvW.hpp \
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IsendW.hpp \
../../OpenFPM_data/src/util/check_no_pointers.hpp \
../../OpenFPM_data/src/util/common.hpp \
../../OpenFPM_data/src/util/util_debug.hpp \
/usr/include/c++/4.9.2/cxxabi.h \
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h \
../../OpenFPM_vcluster/src/util/Vcluster_log.hpp \
../../OpenFPM_data/src/timer.hpp \
../../OpenFPM_data/src/Space/SpaceBox.hpp \
......@@ -1327,7 +1322,10 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_data/src/util/object_util.hpp \
../../OpenFPM_data/src/util/object_creator.hpp \
../../OpenFPM_data/src/util/util_debug.hpp \
/usr/include/c++/4.9.2/cxxabi.h \
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h \
../../OpenFPM_data/src/util/check_no_pointers.hpp \
../../OpenFPM_data/src/util/common.hpp \
../../OpenFPM_data/src/util/object_s_di.hpp \
../../OpenFPM_data/src/util/object_si_d.hpp \
../../OpenFPM_devices/src/memory/ExtPreAlloc.hpp \
......@@ -1402,6 +1400,7 @@ pdata-main.o: main.cpp /usr/include/stdc-predef.h \
../../OpenFPM_vcluster/src/Packer.hpp \
../../OpenFPM_data/src/Grid/util.hpp \
../../OpenFPM_data/src/Vector/util.hpp \
../../OpenFPM_data/src/util/util_debug.hpp \
../../OpenFPM_vcluster/src/Pack_stat.hpp \
../../OpenFPM_vcluster/src/Pack_selector.hpp \
../../OpenFPM_vcluster/src/Unpacker.hpp \
......@@ -4324,16 +4323,6 @@ Grid/grid_dist_id.hpp:
../../OpenFPM_vcluster/src/MPI_wrapper/MPI_IsendW.hpp:
../../OpenFPM_data/src/util/check_no_pointers.hpp:
../../OpenFPM_data/src/util/common.hpp:
../../OpenFPM_data/src/util/util_debug.hpp:
/usr/include/c++/4.9.2/cxxabi.h:
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h:
../../OpenFPM_vcluster/src/util/Vcluster_log.hpp:
../../OpenFPM_data/src/timer.hpp:
......@@ -4362,8 +4351,14 @@ Grid/grid_dist_key.hpp:
../../OpenFPM_data/src/util/util_debug.hpp:
/usr/include/c++/4.9.2/cxxabi.h:
/usr/include/c++/4.9.2/x86_64-redhat-linux/bits/cxxabi_tweaks.h:
../../OpenFPM_data/src/util/check_no_pointers.hpp:
../../OpenFPM_data/src/util/common.hpp:
../../OpenFPM_data/src/util/object_s_di.hpp:
../../OpenFPM_data/src/util/object_si_d.hpp:
......@@ -4512,6 +4507,8 @@ Grid/grid_dist_key.hpp:
../../OpenFPM_data/src/Vector/util.hpp:
../../OpenFPM_data/src/util/util_debug.hpp:
../../OpenFPM_vcluster/src/Pack_stat.hpp:
../../OpenFPM_vcluster/src/Pack_selector.hpp:
......
......@@ -357,6 +357,7 @@ private:
sub_domains.add(sub_d);
ss_box = sub_d;
ss_box -= ss_box.getP1();
bbox = sub_d;
}
......@@ -414,10 +415,10 @@ private:
// Get the processor bounding Box
::Box<dim,T> bound = getProcessorBounds();
// calculate the sub-divisions (0.5 for rounding error)
// 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)) / unit.getHigh(i) + 0.5);
div[i] = (size_t)((bound.getHigh(i) - bound.getLow(i)) / unit.getHigh(i));
// Create shift
Point<dim,T> orig;
......
......@@ -92,8 +92,12 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_domain_grid_unit_converter_test)
void Test2D(const Box<2,float> & domain, long int k)
{
long int big_step = k / 30;
big_step = (big_step == 0)?1:big_step;
long int small_step = 1;
// 2D test
for ( ; k >= 2 ; k-= (k >= 66)?33:1 )
for ( ; k >= 2 ; k-= (k > 2*big_step)?big_step:small_step )
{
BOOST_TEST_CHECKPOINT( "Testing 2D grid k=" << k );
......@@ -117,42 +121,6 @@ void Test2D(const Box<2,float> & domain, long int k)
bool val = g_dist.getDecomposition().check_consistency();
BOOST_REQUIRE_EQUAL(val,true);
/////////////// DEBUG /////////////////////
// get the decomposition
auto & dec = g_dist.getDecomposition();
Vcluster & v_cl = *global_v_cluster;
// check the consistency of the decomposition
val = dec.check_consistency();
BOOST_REQUIRE_EQUAL(val,true);
// for each local volume
// Get the number of local grid needed
size_t n_grid = dec.getNLocalHyperCube();
size_t vol = 0;
// Allocate the grids
for (size_t i = 0 ; i < n_grid ; i++)
{
// Get the local hyper-cube
SpaceBox<2,float> sub = dec.getLocalHyperCube(i);
Box<2,size_t> g_box = g_dist.getCellDecomposer().convertDomainSpaceIntoGridUnits(sub);
vol += g_box.getVolumeKey();
}
v_cl.reduce(vol);
v_cl.execute();
BOOST_REQUIRE_EQUAL(vol,k*k);
/////////////////////////////////////
// Grid sm
grid_sm<2,void> info(sz);
......@@ -228,8 +196,12 @@ void Test2D(const Box<2,float> & domain, long int k)
void Test3D(const Box<3,float> & domain, long int k)
{
// 3D test
for ( ; k >= 2 ; k-= (k >= 33)?5:1 )
long int big_step = k / 30;
big_step = (big_step == 0)?1:big_step;
long int small_step = 1;
// 2D test
for ( ; k >= 2 ; k-= (k > 2*big_step)?big_step:small_step )
{
BOOST_TEST_CHECKPOINT( "Testing 3D grid k=" << k );
if (global_v_cluster->getProcessUnitID() == 0)
......@@ -323,8 +295,6 @@ void Test3D(const Box<3,float> & domain, long int k)
++domg;
}
}
}
......@@ -338,8 +308,8 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_iterator_test_use)
long int k = 1024*1024*global_v_cluster->getProcessingUnits();
k = std::pow(k, 1/2.);
Test2D(domain,k);
Test2D(domain,k);
// Domain
Box<3,float> domain3({0.0,0.0,0.0},{1.0,1.0,1.0});
......
......@@ -216,8 +216,8 @@ LIBS =
LTLIBOBJS =
MAKEINFO = ${SHELL} /home/i-bird/Desktop/MOSAIC/OpenFPM_project/OpenFPM_pdata/missing makeinfo
METIS =
METIS_INCLUDE = -I/home/i-bird/METIS/include
METIS_LIB = -L/home/i-bird/METIS/lib
METIS_INCLUDE = -I/home/i-bird/Desktop/MOSAIC/OpenFPM_project/metis_install//include
METIS_LIB = -L/home/i-bird/Desktop/MOSAIC/OpenFPM_project/metis_install//lib
MKDIR_P = /usr/bin/mkdir -p
NVCC = /usr/local/cuda/bin/nvcc
NVCCFLAGS = -O3
......
......@@ -125,4 +125,44 @@
#endif
/////////////// DEBUG /////////////////////
// get the decomposition
auto & dec = g_dist.getDecomposition();
Vcluster & v_cl = *global_v_cluster;
// check the consistency of the decomposition
val = dec.check_consistency();
BOOST_REQUIRE_EQUAL(val,true);
// for each local volume
// Get the number of local grid needed
size_t n_grid = dec.getNLocalHyperCube();
size_t vol = 0;
openfpm::vector<Box<2,size_t>> v_b;
// Allocate the grids
for (size_t i = 0 ; i < n_grid ; i++)
{
// Get the local hyper-cube
SpaceBox<2,float> sub = dec.getLocalHyperCube(i);
Box<2,size_t> g_box = g_dist.getCellDecomposer().convertDomainSpaceIntoGridUnits(sub);
v_b.add(g_box);
vol += g_box.getVolumeKey();
}
v_cl.reduce(vol);
v_cl.execute();
BOOST_REQUIRE_EQUAL(vol,k*k);
/////////////////////////////////////
#endif /* GARGABE_HPP_ */
......@@ -254,7 +254,7 @@ public:
if (Mg.nparts[0] != 1)
{
// Decompose
METIS_PartGraphKway(Mg.nvtxs,Mg.ncon,Mg.xadj,Mg.adjncy,Mg.vwgt,Mg.vsize,Mg.adjwgt,
METIS_PartGraphRecursive(Mg.nvtxs,Mg.ncon,Mg.xadj,Mg.adjncy,Mg.vwgt,Mg.vsize,Mg.adjwgt,
Mg.nparts,Mg.tpwgts,Mg.ubvec,Mg.options,Mg.objval,Mg.part);
// vertex id
......
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