From 76b26a9bce249a0371677b9dcc2b53e9fc2c9356 Mon Sep 17 00:00:00 2001 From: Pietro Incardona <incardon@mpi-cbg.de> Date: Sun, 9 Aug 2015 23:13:56 +0200 Subject: [PATCH] Testing on taurus --- src/Grid/grid_dist_id_unit_test.hpp | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/Grid/grid_dist_id_unit_test.hpp b/src/Grid/grid_dist_id_unit_test.hpp index 49780864..61a3e4b3 100644 --- a/src/Grid/grid_dist_id_unit_test.hpp +++ b/src/Grid/grid_dist_id_unit_test.hpp @@ -117,6 +117,42 @@ 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); -- GitLab