7#define BOOST_TEST_DYN_LINK
8#include <boost/test/unit_test.hpp>
10#include "Grid/grid_dist_id.hpp"
11#include "Point_test.hpp"
12#include "Grid/tests/grid_dist_id_util_tests.hpp"
14BOOST_AUTO_TEST_SUITE( amr_grid_dist_id_test )
17BOOST_AUTO_TEST_CASE( grid_dist_id_amr )
22 size_t sz[2] = {100,100};
40 size_t volume_key = 0;
41 for (
size_t i = 0 ; i < C_draw.
size() ; i++)
51 auto git = g_dist.getDomainIterator();
59 auto gkey = git.getGKey(key);
61 g_dist.template get<0>(key) = gs.LinId(gkey);
73 BOOST_REQUIRE_EQUAL(count,volume_key);
75 g_dist.ghost_get<0>();
80 size_t check_count = 0;
82 auto git2 = g_dist.getDomainGhostIterator();
85 auto key = git2.get();
86 auto gkey = git2.getGKey(key);
88 float value = g_dist.template get<0>(key);
92 for (
size_t k = 0; k < C_draw.
size() ; k++)
96 check &= value == gs.LinId(gkey);
99 auto & gdb_ext = g_dist.getLocalGridsInfo();
101 for (
size_t s = 0 ; s < gdb_ext.size() ; s++)
104 bx += gdb_ext.get(s).origin;
118 vcl.
sum(check_count);
121 BOOST_REQUIRE_EQUAL(check,
true);
122 BOOST_REQUIRE(check_count >= volume_key);
125BOOST_AUTO_TEST_CASE( amr_grid_dist_id_iterator_test_use_2D)
130#ifdef TEST_COVERAGE_MODE
131 long int k = 256*256*create_vcluster().getProcessingUnits();
133 long int k = 1024*1024*create_vcluster().getProcessingUnits();
135 k = std::pow(k, 1/2.);
137 long int big_step = k / 30;
138 big_step = (big_step == 0)?1:big_step;
139 long int small_step = 21;
141 print_test(
"AMR Testing 2D full grid k<=",k);
144 for ( ; k >= 2 ; k-= (k > 2*big_step)?big_step:small_step )
146 BOOST_TEST_CHECKPOINT(
"AMR Testing 2D full grid k=" << k );
167 Test2D_core(g_dist,sz,k);
171BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
__host__ __device__ bool isInside(const Point< dim, T > &p) const
Check if the point is inside the box.
T getVolumeKey() const
Get the volume spanned by the Box P1 and P2 interpreted as grid key.
void execute()
Execute all the requests.
void sum(T &num)
Sum the numbers across all processors and get the result.
Implementation of VCluster class.
This is a distributed grid.
Implementation of 1-D std::vector like structure.