Skip to content

Commit b3a43a8

Browse files
committed
Unify naming scheme for helper namespaces
1 parent 4a0d217 commit b3a43a8

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

include/openPMD/IO/ADIOS/ADIOS2Auxiliary.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace adios_defs
7070
* The following strings are used during parsing of the JSON configuration
7171
* string for the ADIOS2 backend.
7272
*/
73-
namespace ADIOS2Defaults
73+
namespace adios_defaults
7474
{
7575
using const_str = char const *const;
7676
constexpr const_str str_engine = "engine";
@@ -85,7 +85,7 @@ namespace ADIOS2Defaults
8585
constexpr const_str str_activeTablePrefix = "__openPMD_groups";
8686
constexpr const_str str_groupBasedWarning =
8787
"__openPMD_internal/warning_bugprone_groupbased_encoding";
88-
} // namespace ADIOS2Defaults
88+
} // namespace adios_defaults
8989

9090
#if openPMD_HAVE_ADIOS2
9191
namespace detail

src/IO/ADIOS/ADIOS2Auxiliary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ FlushTarget flushTargetFromString(std::string const &str)
5151
else
5252
{
5353
throw error::BackendConfigSchema(
54-
{"adios2", "engine", ADIOS2Defaults::str_flushtarget},
54+
{"adios2", "engine", adios_defaults::str_flushtarget},
5555
"Flush target must be either 'disk' or 'buffer', but "
5656
"was " +
5757
str + ".");

src/IO/ADIOS/ADIOS2File.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ void ADIOS2File::configure_IO()
494494
// set engine parameters
495495
std::set<std::string> alreadyConfigured;
496496
bool wasTheFlushTargetSpecifiedViaJSON = false;
497-
auto engineConfig = m_impl->config(ADIOS2Defaults::str_engine);
497+
auto engineConfig = m_impl->config(adios_defaults::str_engine);
498498
if (!engineConfig.json().is_null())
499499
{
500-
auto params = m_impl->config(ADIOS2Defaults::str_params, engineConfig);
500+
auto params = m_impl->config(adios_defaults::str_params, engineConfig);
501501
params.declareFullyRead();
502502
if (params.json().is_object())
503503
{
@@ -520,7 +520,7 @@ void ADIOS2File::configure_IO()
520520
}
521521
}
522522
auto _useAdiosSteps =
523-
m_impl->config(ADIOS2Defaults::str_usesteps, engineConfig);
523+
m_impl->config(adios_defaults::str_usesteps, engineConfig);
524524
if (!_useAdiosSteps.json().is_null() && writeOnly(m_mode))
525525
{
526526
std::cerr << "[ADIOS2 backend] WARNING: Parameter "
@@ -529,14 +529,14 @@ void ADIOS2File::configure_IO()
529529
<< std::endl;
530530
}
531531

532-
if (engineConfig.json().contains(ADIOS2Defaults::str_flushtarget))
532+
if (engineConfig.json().contains(adios_defaults::str_flushtarget))
533533
{
534534
auto target = json::asLowerCaseStringDynamic(
535-
engineConfig[ADIOS2Defaults::str_flushtarget].json());
535+
engineConfig[adios_defaults::str_flushtarget].json());
536536
if (!target.has_value())
537537
{
538538
throw error::BackendConfigSchema(
539-
{"adios2", "engine", ADIOS2Defaults::str_flushtarget},
539+
{"adios2", "engine", adios_defaults::str_flushtarget},
540540
"Flush target must be either 'disk' or 'buffer', but "
541541
"was non-literal type.");
542542
}
@@ -713,10 +713,10 @@ auto ADIOS2File::detectGroupTable() -> UseGroupTable
713713
{
714714
auto const &attributes = availableAttributes();
715715
auto lower_bound =
716-
attributes.lower_bound(ADIOS2Defaults::str_activeTablePrefix);
716+
attributes.lower_bound(adios_defaults::str_activeTablePrefix);
717717
if (lower_bound != attributes.end() &&
718718
auxiliary::starts_with(
719-
lower_bound->first, ADIOS2Defaults::str_activeTablePrefix))
719+
lower_bound->first, adios_defaults::str_activeTablePrefix))
720720
{
721721
return UseGroupTable::Yes;
722722
}
@@ -819,7 +819,7 @@ adios2::Engine &ADIOS2File::getEngine()
819819
{
820820
case StreamStatus::Undecided: {
821821
auto attr = m_IO.InquireAttribute<bool_representation>(
822-
ADIOS2Defaults::str_usesstepsAttribute);
822+
adios_defaults::str_usesstepsAttribute);
823823
if (attr && attr.Data()[0] == 1)
824824
{
825825
if (parsePreference == ParsePreference::UpFront)
@@ -861,7 +861,7 @@ adios2::Engine &ADIOS2File::getEngine()
861861
if (m_impl->m_useGroupTable.value() ==
862862
UseGroupTable::No &&
863863
m_IO.InquireAttribute<std::string>(
864-
ADIOS2Defaults::str_groupBasedWarning))
864+
adios_defaults::str_groupBasedWarning))
865865
{
866866
throw error::OperationUnsupportedInBackend(
867867
"ADIOS2",
@@ -969,7 +969,7 @@ void ADIOS2File::flush_impl(
969969
// Currently only schema 0 supported
970970
if (m_impl->m_writeAttributesFromThisRank)
971971
{
972-
m_IO.DefineAttribute<uint64_t>(ADIOS2Defaults::str_adios2Schema, 0);
972+
m_IO.DefineAttribute<uint64_t>(adios_defaults::str_adios2Schema, 0);
973973
}
974974
initializedDefaults = true;
975975
}
@@ -1132,10 +1132,10 @@ AdvanceStatus ADIOS2File::advance(AdvanceMode mode)
11321132

11331133
if (writeOnly(m_mode) && m_impl->m_writeAttributesFromThisRank &&
11341134
!m_IO.InquireAttribute<bool_representation>(
1135-
ADIOS2Defaults::str_usesstepsAttribute))
1135+
adios_defaults::str_usesstepsAttribute))
11361136
{
11371137
m_IO.DefineAttribute<bool_representation>(
1138-
ADIOS2Defaults::str_usesstepsAttribute, 1);
1138+
adios_defaults::str_usesstepsAttribute, 1);
11391139
}
11401140

11411141
flush(
@@ -1281,7 +1281,7 @@ void ADIOS2File::markActive(Writable *writable)
12811281
auto filePos = m_impl->setAndGetFilePosition(
12821282
writable, /* write = */ false);
12831283
auto fullPath =
1284-
ADIOS2Defaults::str_activeTablePrefix + filePos->location;
1284+
adios_defaults::str_activeTablePrefix + filePos->location;
12851285
m_IO.DefineAttribute<attr_t>(
12861286
fullPath,
12871287
currentStepBuffered,

src/IO/ADIOS/ADIOS2IOHandler.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ void ADIOS2IOHandlerImpl::init(
228228
m_config["attribute_writing_ranks"].json());
229229
}
230230

231-
auto engineConfig = config(ADIOS2Defaults::str_engine);
231+
auto engineConfig = config(adios_defaults::str_engine);
232232
if (!engineConfig.json().is_null())
233233
{
234234
auto engineTypeConfig =
235-
config(ADIOS2Defaults::str_type, engineConfig).json();
235+
config(adios_defaults::str_type, engineConfig).json();
236236
if (!engineTypeConfig.is_null())
237237
{
238238
// convert to string
@@ -468,14 +468,14 @@ ADIOS2IOHandlerImpl::flush(internal::ParsedFlushParams &flushParams)
468468
if (adios2Config.json().contains("engine"))
469469
{
470470
auto engineConfig = adios2Config["engine"];
471-
if (engineConfig.json().contains(ADIOS2Defaults::str_flushtarget))
471+
if (engineConfig.json().contains(adios_defaults::str_flushtarget))
472472
{
473473
auto target = json::asLowerCaseStringDynamic(
474-
engineConfig[ADIOS2Defaults::str_flushtarget].json());
474+
engineConfig[adios_defaults::str_flushtarget].json());
475475
if (!target.has_value())
476476
{
477477
throw error::BackendConfigSchema(
478-
{"adios2", "engine", ADIOS2Defaults::str_flushtarget},
478+
{"adios2", "engine", adios_defaults::str_flushtarget},
479479
"Flush target must be either 'disk' or 'buffer', but "
480480
"was non-literal type.");
481481
}
@@ -604,7 +604,7 @@ void ADIOS2IOHandlerImpl::createFile(
604604
printedWarningsAlready.noGroupBased = true;
605605
}
606606
fileData.m_IO.DefineAttribute(
607-
ADIOS2Defaults::str_groupBasedWarning,
607+
adios_defaults::str_groupBasedWarning,
608608
std::string("Consider using file-based or variable-based "
609609
"encoding instead in ADIOS2."));
610610
}
@@ -1247,7 +1247,7 @@ void ADIOS2IOHandlerImpl::listPaths(
12471247
}
12481248
case UseGroupTable::Yes: {
12491249
{
1250-
auto tablePrefix = ADIOS2Defaults::str_activeTablePrefix + myName;
1250+
auto tablePrefix = adios_defaults::str_activeTablePrefix + myName;
12511251
std::vector attrs =
12521252
fileData.availableAttributesPrefixed(tablePrefix);
12531253
if (fileData.streamStatus ==
@@ -1628,7 +1628,7 @@ namespace detail
16281628
}
16291629

16301630
std::string metaAttr;
1631-
metaAttr = ADIOS2Defaults::str_isBoolean + name;
1631+
metaAttr = adios_defaults::str_isBoolean + name;
16321632
/*
16331633
* In verbose mode, attributeInfo will yield a warning if not
16341634
* finding the requested attribute. Since we expect the attribute
@@ -1862,7 +1862,7 @@ namespace detail
18621862
else if constexpr (std::is_same_v<T, bool>)
18631863
{
18641864
IO.DefineAttribute<bool_representation>(
1865-
ADIOS2Defaults::str_isBoolean + fullName, 1);
1865+
adios_defaults::str_isBoolean + fullName, 1);
18661866
auto representation = bool_repr::toRep(value);
18671867
defineAttribute(representation);
18681868
}

0 commit comments

Comments
 (0)