-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathconfig.cpp
77 lines (74 loc) · 2.21 KB
/
config.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* Copyright 2020-2021 Axel Huebl
*
* This file is part of openPMD-api.
*
* openPMD-api is free software: you can redistribute it and/or modify
* it under the terms of of either the GNU General Public License or
* the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* openPMD-api is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License and the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* and the GNU Lesser General Public License along with openPMD-api.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "openPMD/config.hpp"
#include "openPMD/version.hpp"
#if openPMD_HAVE_ADIOS2
#include "openPMD/IO/ADIOS/macros.hpp"
#include <adios2.h>
#endif
#include <map>
#include <string>
#include <vector>
// @todo add TOML here
std::map<std::string, bool> openPMD::getVariants()
{
// clang-format off
return std::map<std::string, bool>{
{"mpi", bool(openPMD_HAVE_MPI)},
{"json", true},
// https://github.com/ToruNiina/toml11/issues/205
#if !defined(__NVCOMPILER_MAJOR__) || __NVCOMPILER_MAJOR__ >= 23
{"toml", true},
#endif
{"hdf5", bool(openPMD_HAVE_HDF5)},
{"adios1", false},
{"adios2", bool(openPMD_HAVE_ADIOS2)}};
// clang-format on
}
std::vector<std::string> openPMD::getFileExtensions()
{
std::vector<std::string> fext;
fext.emplace_back("json");
// https://github.com/ToruNiina/toml11/issues/205
#if !defined(__NVCOMPILER_MAJOR__) || __NVCOMPILER_MAJOR__ >= 23
fext.emplace_back("toml");
#endif
#if openPMD_HAVE_ADIOS2
fext.emplace_back("bp");
#endif
#if openPMD_HAVE_ADIOS2
// BP4 is always available in ADIOS2
fext.emplace_back("bp4");
#endif
#if openPMD_HAVE_ADIOS2_BP5
fext.emplace_back("bp5");
#endif
#ifdef ADIOS2_HAVE_SST
fext.emplace_back("sst");
#endif
#ifdef ADIOS2_HAVE_SSC
fext.emplace_back("ssc");
#endif
#if openPMD_HAVE_HDF5
fext.emplace_back("h5");
#endif
return fext;
}