8 #ifndef SRC_VECTOR_VECTOR_DIST_HDF5_CHCKPNT_RESTART_TEST_HPP_
9 #define SRC_VECTOR_VECTOR_DIST_HDF5_CHCKPNT_RESTART_TEST_HPP_
11 #include "vector_dist.hpp"
12 #include "Packer_Unpacker/Pack_selector.hpp"
13 #include "Packer_Unpacker/Packer.hpp"
14 #include "Packer_Unpacker/Unpacker.hpp"
15 #include "Vector/performance/vector_dist_performance_util.hpp"
20 BOOST_AUTO_TEST_SUITE( vd_hdf5_chckpnt_rstrt_test )
25 BOOST_AUTO_TEST_CASE( vector_dist_hdf5_save_test )
29 for (
size_t i = 0; i < dim; i++)
41 size_t sz[dim] = {Ng,Ng,Ng};
43 for (
size_t i = 0; i < dim; i++)
53 auto it = vd.getGridIterator(sz);
61 vd.getLastPos()[0] =
key.get(0) * it.getSpacing(0);
62 vd.getLastPos()[1] =
key.get(1) * it.getSpacing(1);
63 vd.getLastPos()[2] =
key.get(2) * it.getSpacing(2);
72 auto it2 = vd.getDomainIterator();
79 for (
size_t i = 0; i < dim; i++)
80 vd.template getProp<0>(
key)[i] = 0.51234 + vd.getPos(
key)[0] + vd.getPos(
key)[1]+ vd.getPos(
key)[2];
86 vd.save(
"vector_dist.h5");
90 vd2.load(
"vector_dist.h5");
94 auto it3 = vd.getDomainIterator();
96 BOOST_REQUIRE_EQUAL(vd.size_local(),vd2.size_local());
108 check &= (vd.template getProp<0>(p)[0] == vd2.template getProp<0>(p)[0]);
109 check &= (vd.template getProp<0>(p)[1] == vd2.template getProp<0>(p)[1]);
110 check &= (vd.template getProp<0>(p)[2] == vd2.template getProp<0>(p)[2]);
115 BOOST_REQUIRE_EQUAL(check,
true);
120 BOOST_AUTO_TEST_CASE( vector_dist_hdf5_load_test )
124 Vcluster & v_cl = create_vcluster();
128 for (
size_t i = 0; i < dim; i++)
137 for (
size_t i = 0; i < dim; i++)
138 bc[i] = NON_PERIODIC;
141 const size_t Ng = 32;
149 vd.load(
"test_data/vector_dist_24.h5");
154 size_t n_part = vd.size_local();
158 BOOST_REQUIRE_EQUAL(n_part,Ng*Ng*Ng);
162 auto it2 = vd.getDomainIterator();
166 auto key = it2.get();
169 for (
size_t i = 0; i < dim; i++)
170 BOOST_REQUIRE_EQUAL(vd.template getProp<0>(
key)[i],(
float)(0.51234 + vd.getPos(
key)[0] + vd.getPos(
key)[1]+ vd.getPos(
key)[2]));
178 BOOST_AUTO_TEST_SUITE_END()
void sum(T &num)
Sum the numbers across all processors and get the result.
void execute()
Execute all the requests.
void setHigh(int i, T val)
set the high interval of the box
This class implement the point shape in an N-dimensional space.
Implementation of VCluster class.
This class decompose a space into sub-sub-domains and distribute them across processors.
void setLow(int i, T val)
set the low interval of the box
This class represent an N-dimensional box.
This class is a trick to indicate the compiler a specific specialization pattern. ...