-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Unify Random-Access API and Streaming API into Series::snapshots() #1592
base: dev
Are you sure you want to change the base?
Conversation
0ee77a2
to
73336c9
Compare
1e862b7
to
ab0991d
Compare
src/snapshots/StatefulIterator.cpp
Outdated
switch (series.iterationEncoding()) | ||
{ | ||
using IE = IterationEncoding; | ||
case IE::fileBased: | ||
series.readFileBased(); | ||
break; | ||
case IE::groupBased: | ||
case IE::variableBased: { | ||
Parameter<Operation::OPEN_FILE> fOpen; | ||
fOpen.name = series.get().m_name; | ||
series.IOHandler()->enqueue(IOTask(&series, fOpen)); | ||
series.IOHandler()->flush(internal::defaultFlushParams); | ||
using PP = Parameter<Operation::OPEN_FILE>::ParsePreference; | ||
switch (*fOpen.out_parsePreference) | ||
{ | ||
case PP::PerStep: | ||
series.advance(AdvanceMode::BEGINSTEP); | ||
series.readGorVBased( | ||
/* do_always_throw_errors = */ false, /* init = */ true); | ||
break; | ||
case PP::UpFront: | ||
series.readGorVBased( | ||
/* do_always_throw_errors = */ false, /* init = */ true); | ||
/* | ||
* In linear read mode (where no parsing at all is done upon | ||
* constructing the Series), it might turn out after parsing | ||
* that what we expected to be a group-based Series was in fact | ||
* a single file of a file-based Series. | ||
* (E.g. when opening "data00000100.h5" directly instead of | ||
* "data%T.h5") | ||
* So we need to check the current value of | ||
* `iterationEncoding()` once more. | ||
*/ | ||
if (series.iterationEncoding() != IterationEncoding::fileBased) | ||
{ | ||
series.advance(AdvanceMode::BEGINSTEP); | ||
} | ||
break; | ||
} | ||
data.parsePreference = *fOpen.out_parsePreference; | ||
break; | ||
} | ||
} |
Check notice
Code scanning / CodeQL
Long switch case Note
variableBased (38 lines)
3845ed7
to
b5e4217
Compare
b5e4217
to
9987204
Compare
src/Series.cpp
Outdated
Access at, | ||
std::string const &options, | ||
// Either an MPI_Comm or none, the template works for both options | ||
MPI_Communicator &&...comm) |
Check notice
Code scanning / CodeQL
Unused local variable Note
667ee24
to
f5d8433
Compare
f5d8433
to
26e5a49
Compare
// increment/decrement | ||
// ChildClass &operator++(); | ||
// ChildClass &operator--(); | ||
// ChildClass &operator++(int); | ||
// ChildClass &operator--(int); |
Check notice
Code scanning / CodeQL
Commented-out code Note
// dereference | ||
// value_type const &operator*() const = 0; | ||
// value_type &operator*() = 0; |
Check notice
Code scanning / CodeQL
Commented-out code Note
@@ -185,6 +196,7 @@ | |||
} | |||
// ~Series intentionally not yet called | |||
|
|||
// std::cout << "READ " << filename << std::endl; |
Check notice
Code scanning / CodeQL
Commented-out code Note test
@@ -163,6 +173,7 @@ | |||
auxiliary::getEnvNum("OPENPMD_TEST_NFILES_MAX", 1030); | |||
std::string filename = | |||
"../samples/many_iterations/many_iterations_%T." + ext; | |||
// std::cout << "WRITE " << filename << std::endl; |
Check notice
Code scanning / CodeQL
Commented-out code Note test
19395b0
to
5b85307
Compare
for more information, see https://pre-commit.ci
Proper return() is supported beginning with CMake 3.25 only
for more information, see https://pre-commit.ci
ebc02cc
to
a73c4c6
Compare
description soon
TODO:
using
definitions, empty headerssnapshots(Snapshots::RandomAccess)
vssnapshots(Snapshots::CollectiveAccess)
or sosnapshots().begin()
-> reset to start, add sth likesnapshots().current()
defer_iteration_parsing
in READ_LINEAR modeDiff: franzpoeschel/openPMD-api@shared-attributable-data...topic-iterator