Skip to content

Commit 65f8146

Browse files
committed
CI fixes
1 parent cc673cb commit 65f8146

File tree

3 files changed

+36
-47
lines changed

3 files changed

+36
-47
lines changed

include/openPMD/IO/AbstractIOHandler.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ class AbstractIOHandler
247247
virtual ~AbstractIOHandler();
248248

249249
AbstractIOHandler(AbstractIOHandler const &) = delete;
250-
AbstractIOHandler(AbstractIOHandler &&) noexcept;
250+
// std::queue::queue(queue&&) is not noexcept
251+
// NOLINTNEXTLINE(performance-noexcept-move-constructor)
252+
AbstractIOHandler(AbstractIOHandler &&) noexcept(false);
251253

252254
AbstractIOHandler &operator=(AbstractIOHandler const &) = delete;
253255
AbstractIOHandler &operator=(AbstractIOHandler &&) noexcept;

include/openPMD/auxiliary/JSONMatcher.hpp

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#pragma once
22

3-
/* Copyright 2021-2023 Franz Poeschel
3+
/* Copyright 2021-2024 Franz Poeschel
44
*
5-
* This file is part of PIConGPU.
5+
* This file is part of openPMD-api.
66
*
7-
* PIConGPU is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU General Public License as published by
7+
* openPMD-api is free software: you can redistribute it and/or modify
8+
* it under the terms of of either the GNU General Public License or
9+
* the GNU Lesser General Public License as published by
910
* the Free Software Foundation, either version 3 of the License, or
1011
* (at your option) any later version.
1112
*
12-
* PIConGPU is distributed in the hope that it will be useful,
13+
* openPMD-api is distributed in the hope that it will be useful,
1314
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
* GNU General Public License for more details.
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License and the GNU Lesser General Public License
17+
* for more details.
1618
*
1719
* You should have received a copy of the GNU General Public License
18-
* along with PIConGPU.
20+
* and the GNU Lesser General Public License along with openPMD-api.
1921
* If not, see <http://www.gnu.org/licenses/>.
2022
*/
2123

@@ -57,15 +59,14 @@ class MatcherPerBackend
5759
*
5860
* This constructor will parse the given config.
5961
* It will distinguish between ordinary openPMD JSON configurations
60-
* and extended configurations as defined by PIConGPU.
61-
* If an ordinary JSON configuration was detected, given regex
62-
* patterns will be matched against "" (the empty string).
62+
* and dataset-specific configurations.
6363
*
64+
* @param backendName The backend's JSON key.
6465
* @param config The JSON configuration for one backend.
6566
* E.g. for ADIOS2, this will be the sub-object/array found
6667
* under config["adios2"]["dataset"].
6768
*/
68-
MatcherPerBackend(std::string backendName_in, TracingJSON config);
69+
MatcherPerBackend(std::string backendName, TracingJSON config);
6970

7071
std::string backendName;
7172

@@ -78,8 +79,7 @@ class MatcherPerBackend
7879
auto get(std::string const &datasetPath) const -> nlohmann::json const &;
7980
};
8081
/**
81-
* @brief Class to handle extended JSON configurations as used by
82-
* the openPMD plugin.
82+
* @brief Class to handle default and dataset-specific JSON configurations.
8383
*
8484
* This class handles parsing of the extended JSON patterns as well as
8585
* selection of one JSON configuration by regex.
@@ -100,22 +100,18 @@ class JsonMatcher
100100
explicit JsonMatcher();
101101

102102
/**
103-
* @brief Initialize JSON matcher from command line arguments.
103+
* @brief Initialize JSON matcher from a parsed JSON config.
104104
*
105-
* This constructor will parse the given config, after reading it
106-
* from a file if needed. In this case, the constructor is
107-
* MPI-collective.
108-
* It will distinguish between ordinary openPMD JSON configurations
109-
* and extended configurations as defined by PIConGPU.
110-
* If an ordinary JSON configuration was detected, given regex
111-
* patterns will be matched against "" (the empty string).
105+
* Will go through the backends' configurations (keys defined by
106+
* `backendKeys` in JSON_internal.hpp) and check for dataset-specific
107+
* configurations. It will then construct:
108+
*
109+
* 1. A default configuration.
110+
* 2. Matchers for retrieving dataset-specific configurations.
112111
*
113-
* @param config The JSON configuration, exactly as in
114-
* --openPMD.json.
115-
* @param comm MPI communicator for collective file reading,
116-
* if needed.
112+
* @param config The parsed JSON configuration as specified by the user.
117113
*/
118-
JsonMatcher(openPMD::json::TracingJSON);
114+
JsonMatcher(openPMD::json::TracingJSON config);
119115

120116
/**
121117
* @brief Get the JSON config associated with a regex pattern.

src/IO/AbstractIOHandler.cpp

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "openPMD/IO/FlushParametersInternal.hpp"
2525
#include "openPMD/auxiliary/JSONMatcher.hpp"
26+
#include <type_traits>
2627

2728
namespace openPMD
2829
{
@@ -46,40 +47,30 @@ std::future<void> AbstractIOHandler::flush(internal::FlushParams const &params)
4647
}
4748

4849
#if openPMD_HAVE_MPI
49-
template <typename TracingJSON>
50+
template <>
5051
AbstractIOHandler::AbstractIOHandler(
51-
std::string path, Access at, TracingJSON &&jsonConfig, MPI_Comm)
52-
: jsonMatcher(std::make_unique<json::JsonMatcher>(
53-
std::forward<TracingJSON>(jsonConfig)))
52+
std::string path, Access at, json::TracingJSON &&jsonConfig, MPI_Comm)
53+
: jsonMatcher(std::make_unique<json::JsonMatcher>(std::move(jsonConfig)))
5454
, directory{std::move(path)}
5555
, m_backendAccess{at}
5656
, m_frontendAccess{at}
5757
{}
58-
59-
template AbstractIOHandler::AbstractIOHandler(
60-
std::string path, Access at, json::TracingJSON &&jsonConfig, MPI_Comm);
6158
#endif
6259

63-
template <typename TracingJSON>
60+
template <>
6461
AbstractIOHandler::AbstractIOHandler(
65-
std::string path, Access at, TracingJSON &&jsonConfig)
66-
: jsonMatcher(std::make_unique<json::JsonMatcher>(
67-
std::forward<TracingJSON>(jsonConfig)))
62+
std::string path, Access at, json::TracingJSON &&jsonConfig)
63+
: jsonMatcher(std::make_unique<json::JsonMatcher>(std::move(jsonConfig)))
6864
, directory{std::move(path)}
6965
, m_backendAccess{at}
7066
, m_frontendAccess{at}
7167
{}
7268

73-
template AbstractIOHandler::AbstractIOHandler(
74-
std::string path, Access at, json::TracingJSON &&jsonConfig);
75-
7669
AbstractIOHandler::~AbstractIOHandler() = default;
70+
// std::queue::queue(queue&&) is not noexcept
71+
// NOLINTNEXTLINE(performance-noexcept-move-constructor)
72+
AbstractIOHandler::AbstractIOHandler(AbstractIOHandler &&) = default;
7773

78-
// AbstractIOHandler::AbstractIOHandler(AbstractIOHandler const &) = default;
79-
AbstractIOHandler::AbstractIOHandler(AbstractIOHandler &&) noexcept = default;
80-
81-
// AbstractIOHandler &
82-
// AbstractIOHandler::operator=(AbstractIOHandler const &) = default;
8374
AbstractIOHandler &
8475
AbstractIOHandler::operator=(AbstractIOHandler &&) noexcept = default;
8576
} // namespace openPMD

0 commit comments

Comments
 (0)