8#ifndef OPENFPM_IO_SRC_HDF5_WR_HDF5_WRITER_UNIT_TESTS_HPP_
9#define OPENFPM_IO_SRC_HDF5_WR_HDF5_WRITER_UNIT_TESTS_HPP_
15BOOST_AUTO_TEST_SUITE( vd_hdf5_chckpnt_rstrt_test_io )
20BOOST_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);
75BOOST_AUTO_TEST_CASE( vector_dist_hdf5_load_test )
81 std::string c2 = std::string(
"openfpm_io/test_data/vector_dist_24.h5");
85 std::string c2 = std::string(
"test_data/vector_dist_24.h5");
97 h5.load(c2,vpos,vprp,g_m);
102 size_t n_part = vpos.
size();
106 BOOST_REQUIRE_EQUAL(n_part,1024ul*24ul);
108 BOOST_REQUIRE_EQUAL(vpos.
size(),vprp.
size());
112 for (
size_t i = 0 ; i < vpos.
size() ; i++)
114 check &= (vprp.template get<0>(i)[0] == vpos.template get<0>(i)[0] + 100.0);
115 check &= (vprp.template get<0>(i)[1] == vpos.template get<0>(i)[1] + 200.0);
116 check &= (vprp.template get<0>(i)[2] == vpos.template get<0>(i)[2] + 300.0);
122BOOST_AUTO_TEST_SUITE_END()
This class implement the point shape in an N-dimensional space.
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
void execute()
Execute all the requests.
void sum(T &num)
Sum the numbers across all processors and get the result.
Implementation of VCluster class.
Implementation of 1-D std::vector like structure.