QMCPACK
test_hdf_parallel.cpp
Go to the documentation of this file.
1 
2 //////////////////////////////////////////////////////////////////////////////////////
3 // This file is distributed under the University of Illinois/NCSA Open Source License.
4 // See LICENSE file in top directory for details.
5 //
6 // Copyright (c) 2018 Jeongnim Kim and QMCPACK developers.
7 //
8 // File developed by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
9 //
10 // File created by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 
14 #include "catch.hpp"
15 
16 #include <vector>
17 #include "hdf/hdf_archive.h"
18 #include "Message/Communicate.h"
19 
20 using namespace qmcplusplus;
21 
22 // So far these tests only instantiate the types based on the type of MPI wrapper passed to the
23 // constructor.
24 // Todo: Add tests that check parallel IO in the various configurations (ENABLE_PDHF5, etc)
25 
26 TEST_CASE("hdf_archive_parallel", "[hdf]")
27 {
29  hdf_archive hd(c);
30  hd.create("test_communicate.hdf");
31  int i = 23;
32  bool okay = hd.writeEntry(i, "int");
33  REQUIRE(okay);
34 }
35 
36 #ifdef HAVE_MPI
37 TEST_CASE("hdf_archive_parallel_mpi3", "[hdf]")
38 {
40  hdf_archive hd(c->comm);
41  hd.create("test_mpi3_communicator.hdf");
42  int i = 23;
43  bool okay = hd.writeEntry(i, "int");
44  REQUIRE(okay);
45 }
46 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
TEST_CASE("complex_helper", "[type_traits]")
class to handle hdf file
Definition: hdf_archive.h:51
Communicate * Controller
Global Communicator for a process.
Definition: Communicate.cpp:35
Wrapping information on parallelism.
Definition: Communicate.h:68
REQUIRE(std::filesystem::exists(filename))
bool create(const std::filesystem::path &fname, unsigned flags=H5F_ACC_TRUNC)
create a file
bool writeEntry(T &data, const std::string &aname)
write the data to the group aname and return status use write() for inbuilt error checking ...
Definition: hdf_archive.h:244