21 #define BOOST_TEST_MAIN HighFiveTest 22 #include <boost/mpl/list.hpp> 23 #include <boost/test/included/unit_test.hpp> 27 int argc = boost::unit_test::framework::master_test_suite().argc;
28 char**
argv = boost::unit_test::framework::master_test_suite().argv;
38 typedef boost::mpl::list<int,
unsigned int, long,
unsigned long,
unsigned char,
39 char, float, double,
long long,
unsigned long long>
45 : _init(init_val), _inc(inc_val) {}
62 if (++_init >= (
'a' + 26))
76 std::string random_string;
77 const size_t size_string = std::rand() % 1000;
78 random_string.resize(size_string);
79 std::generate(random_string.begin(), random_string.end(), gen);
87 int mpi_rank, mpi_size;
88 MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
89 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
91 typedef typename std::vector<T> Vector;
94 filename <<
"h5_rw_select_parallel_test_" <<
typeid(T).name() <<
"_test.h5";
96 const size_t size_x = mpi_size;
97 const size_t offset_x = mpi_rank, count_x = mpi_size - mpi_rank;
104 std::generate(values.begin(), values.end(), generator);
113 dataset.write(values);
119 std::vector<size_t> offset;
120 offset.push_back(offset_x);
121 std::vector<size_t> size;
122 size.push_back(count_x);
131 BOOST_CHECK_EQUAL(result.size(), count_x);
133 for (
size_t i = offset_x; i < count_x; ++i) {
135 BOOST_CHECK_EQUAL(values[i + offset_x], result[i]);
141 selectionArraySimpleTestParallel<T>();
DataSpace getSpace() const
getSpace
void read(T &array) const
ContentGenerate(T init_val=T(0), T inc_val=T(1)+T(1)/T(10))
static DataSpace From(const ScalarValue &scalar_value)
static const int ReadWrite
Open flag: Read Write access.
static const int Truncate
Open flag: Truncate a file if already existing.
MPIIO Driver for Parallel HDF5.
BOOST_AUTO_TEST_CASE_TEMPLATE(selectionArraySimple, T, numerical_test_types)
DataSpace getMemSpace() const
getMemSpace
BOOST_GLOBAL_FIXTURE(MpiFixture)
boost::mpl::list< int, unsigned int, long, unsigned long, unsigned char, char, float, double, long long, unsigned long long > numerical_test_types
Selection select(const std::vector< size_t > &offset, const std::vector< size_t > &count, const std::vector< size_t > &stride=std::vector< size_t >()) const
void selectionArraySimpleTestParallel()
Selection: represent a view on a slice/part of a dataset.
std::vector< size_t > getDimensions() const
getDimensions
boost::mpl::list< int, unsigned int, long, unsigned long, unsigned char, char, float, double, long long, unsigned long long, complex > numerical_test_types
static const int Create
Open flag: Create non existing file.
const std::string DATASET_NAME("dset")