8 #ifndef OPENFPM_IO_SRC_HDF5_WR_HDF5_WRITER_UNIT_TESTS_HPP_
9 #define OPENFPM_IO_SRC_HDF5_WR_HDF5_WRITER_UNIT_TESTS_HPP_
11 #include "HDF5_wr.hpp"
15 BOOST_AUTO_TEST_SUITE( vd_hdf5_chckpnt_rstrt_test )
20 BOOST_AUTO_TEST_CASE( vector_dist_hdf5_save_test )
27 for (
size_t i = 0 ; i < 1024 ; i++)
38 vprp.template get<0>(vprp.
size()-1)[0] = p.
get(0) + 100.0;
39 vprp.template get<0>(vprp.
size()-1)[1] = p.
get(1) + 200.0;
40 vprp.template get<0>(vprp.
size()-1)[2] = p.
get(2) + 300.0;
46 h5.save(
"vector_dist.h5",vpos,vprp);
54 h5r.load(
"vector_dist.h5",vpos2,vprp2,g_m);
56 BOOST_REQUIRE_EQUAL(1024ul,vpos2.
size());
57 BOOST_REQUIRE_EQUAL(1024ul,vprp2.
size());
59 BOOST_REQUIRE_EQUAL(1024ul,g_m);
64 for (
size_t i = 0 ; i < vpos.
size() ; i++)
66 check &= (vpos.get(i) == vpos2.get(i));
67 check &= (vprp.get_o(i) == vprp2.get_o(i));
70 BOOST_REQUIRE_EQUAL(check,
true);
75 BOOST_AUTO_TEST_CASE( vector_dist_hdf5_load_test )
87 h5.load(
"test_data/vector_dist_24.h5",vpos,vprp,g_m);
92 size_t n_part = vpos.
size();
96 BOOST_REQUIRE_EQUAL(n_part,1024ul*24ul);
98 BOOST_REQUIRE_EQUAL(vpos.
size(),vprp.
size());
102 for (
size_t i = 0 ; i < vpos.
size() ; i++)
104 check &= (vprp.template get<0>(i)[0] == vpos.template get<0>(i)[0] + 100.0);
105 check &= (vprp.template get<0>(i)[1] == vpos.template get<0>(i)[1] + 200.0);
106 check &= (vprp.template get<0>(i)[2] == vpos.template get<0>(i)[2] + 300.0);
112 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.
This class implement the point shape in an N-dimensional space.
Implementation of VCluster class.
const T & get(size_t i) const
Get coordinate.
Implementation of 1-D std::vector like structure.