8#ifndef SRC_GRID_TESTS_GRID_DIST_ID_UTIL_TESTS_HPP_
9#define SRC_GRID_TESTS_GRID_DIST_ID_UTIL_TESTS_HPP_
12static void print_test(std::string test,
size_t sz)
14 if (create_vcluster().getProcessUnitID() == 0)
15 std::cout << test <<
" " << sz <<
"\n";
22 bool val = g_dist.getDecomposition().check_consistency();
23 BOOST_REQUIRE_EQUAL(val,
true);
31 auto dom = g_dist.getDomainIterator();
36 auto key_g = g_dist.getGKey(key);
38 g_dist.template get<0>(key) = info.LinId(key_g);
56 BOOST_REQUIRE_EQUAL(count,(
size_t)k*k);
58 auto dom2 = g_dist.getDomainIterator();
63 BOOST_REQUIRE_EQUAL((
long int)stop.
get(0),(
long int)g_dist.size(0)-1);
64 BOOST_REQUIRE_EQUAL((
long int)stop.
get(1),(
long int)g_dist.size(1)-1);
66 BOOST_REQUIRE_EQUAL(start.
get(0),0);
67 BOOST_REQUIRE_EQUAL(start.
get(1),0);
74 auto key = dom2.get();
75 auto key_g = g_dist.getGKey(key);
77 match &= (g_dist.template get<0>(key) == info.LinId(key_g))?
true:false;
82 BOOST_REQUIRE_EQUAL(match,
true);
84 g_dist.template ghost_get<0>();
88 auto domg = g_dist.getDomainGhostIterator();
93 auto key = domg.get();
94 auto key_g = g_dist.getGKey(key);
97 if (g_dist.isInside(key_g))
99 match &= (g_dist.template get<0>(key) == info.LinId(key_g))?
true:false;
105 BOOST_REQUIRE_EQUAL(match,
true);
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.
grid_key_dx is the key to access any element in the grid
__device__ __host__ index_type get(index_type i) const
Get the i index.
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...