Skip to content

Commit eac55c6

Browse files
committed
Further fixes
1 parent f94f4b6 commit eac55c6

3 files changed

Lines changed: 9 additions & 19 deletions

File tree

include/openPMD/Iteration.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,6 @@ class IndexedIteration : public Iteration
461461
{}
462462
};
463463

464-
inline void breakpoint()
465-
{}
466-
467464
namespace traits
468465
{
469466
template <>
@@ -473,9 +470,14 @@ namespace traits
473470
template <typename T, typename Container>
474471
void operator()(T &ret, Container *c)
475472
{
476-
breakpoint();
477473
if (ret.IOHandler()->m_encoding == IterationEncoding::variableBased)
478474
{
475+
for (auto &pair :
476+
static_cast<Attributable &>(ret).get().m_attributes)
477+
{
478+
static_cast<Attributable &>(*c).get().m_attributes.emplace(
479+
std::move(pair));
480+
}
479481
static_cast<
480482
std::shared_ptr<internal::SharedAttributableData> &>(
481483
*ret.m_attri) =

src/Iteration.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,7 @@ void Iteration::flushGroupBased(
293293
void Iteration::flushVariableBased(
294294
IterationIndex_t i, internal::FlushParams const &flushParams)
295295
{
296-
if (!written())
297-
{
298-
/* create iteration path */
299-
Parameter<Operation::OPEN_PATH> pOpen;
300-
pOpen.path = "";
301-
IOHandler()->enqueue(IOTask(this, pOpen));
302-
}
296+
setDirty(true);
303297

304298
switch (flushParams.flushLevel)
305299
{
@@ -312,12 +306,8 @@ void Iteration::flushVariableBased(
312306
break;
313307
}
314308

315-
if (!written())
309+
// @todo maybe dont repeat this upon each invocation
316310
{
317-
/* create iteration path */
318-
Parameter<Operation::OPEN_PATH> pOpen;
319-
pOpen.path = "";
320-
IOHandler()->enqueue(IOTask(this, pOpen));
321311
/*
322312
* In v-based encoding, the snapshot attribute must always be written.
323313
* Reason: Even in backends that don't support changing attributes,

src/Series.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,8 +1500,6 @@ void Series::flushGorVBased(
15001500
series.iterations.flush(
15011501
auxiliary::replace_first(basePath(), "%T/", ""), flushParams);
15021502

1503-
debug::printDirty(*this);
1504-
15051503
for (auto it = begin; it != end; ++it)
15061504
{
15071505
// Phase 1
@@ -2417,7 +2415,7 @@ Series::iterations_iterator Series::indexOf(Iteration const &iteration)
24172415
for (auto it = series.iterations.begin(); it != series.iterations.end();
24182416
++it)
24192417
{
2420-
if (it->second.m_attri->get() == iteration.m_attri->get())
2418+
if (it->second.m_attri.get() == iteration.m_attri.get())
24212419
{
24222420
return it;
24232421
}

0 commit comments

Comments
 (0)