H5FileDriver_misc.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c), 2017-2018, Adrien Devresse <adrien.devresse@epfl.ch>
3  * Juan Hernando <juan.hernando@epfl.ch>
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE_1_0.txt or copy at
7  * http://www.boost.org/LICENSE_1_0.txt)
8  *
9  */
10 #ifndef H5FILEDRIVER_MISC_HPP
11 #define H5FILEDRIVER_MISC_HPP
12 
13 #include "../H5FileDriver.hpp"
14 
15 #include <H5Ppublic.h>
16 
17 #ifdef H5_HAVE_PARALLEL
18 #include <H5FDmpi.h>
19 #endif
20 
21 namespace HighFive {
22 
23 namespace {
24 
25 template <typename Comm, typename Info>
26 class MPIOFileAccess
27 {
28 public:
29  MPIOFileAccess(Comm comm, Info info)
30  : _comm(comm)
31  , _info(info)
32  {}
33 
34  void apply(const hid_t list) const {
35  if (H5Pset_fapl_mpio(list, _comm, _info) < 0) {
36  HDF5ErrMapper::ToException<FileException>(
37  "Unable to setup MPIO Driver configuration");
38  }
39  }
40 private:
41  Comm _comm;
42  Info _info;
43 };
44 
45 // depecrated, use Properties(Properties::FILE_ACCESS) instead
46 class DefaultFileDriver : public FileDriver {
47 };
48 }
49 
50 // file access property
51 inline FileDriver::FileDriver() : Properties(FILE_ACCESS) {}
52 
53 template <typename Comm, typename Info>
54 inline MPIOFileDriver::MPIOFileDriver(Comm comm, Info info) {
55  add(MPIOFileAccess<Comm, Info>(comm, info));
56 }
57 }
58 
59 #endif // H5FILEDRIVER_MISC_HPP
void add(const Property &property)
Comm _comm
Info _info
MPIOFileDriver(Comm mpi_comm, Info mpi_info)
Generic HDF5 property List.


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06