-
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
Fix append mode double attributes #1302
Fix append mode double attributes #1302
Conversation
719e8db
to
2f56ac0
Compare
8315402
to
f5e511f
Compare
This reverts commit a39b618. The test is added in PR openPMD#1302 which fixes the bug
f329c8c
to
1b5b053
Compare
a6c67b4
to
22be635
Compare
22be635
to
0f22a17
Compare
@@ -502,15 +502,18 @@ namespace | |||
int padding; | |||
uint64_t iterationIndex; | |||
std::set<int> paddings; | |||
for (auto const &entry : auxiliary::list_directory(directory)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes another subtle bug: Creating a Series via Append mode should be possible. But so far, this routine failed if the directory was not present.
0f22a17
to
77215b9
Compare
even if the specified directory does not exist
Needed later for checking file presence in parallel situations
Also use parallel logical or for file existence check
ac5504f
to
2bc1ac4
Compare
8972ff0
to
90194ad
Compare
include/openPMD/auxiliary/Mpi.hpp
Outdated
namespace | ||
{ | ||
template <typename> | ||
struct MPI_Types; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future refactoring: since this is an openPMD internal type trait, we should consider renaming this so it does not collide with the MPI_....
prefix used as convention in the MPI C libraries for all its functions.
Suggestions: MPI_Types
-> openPMD_MPI_Type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this, I'm asking myself if this code is even correct. If an MPI application runs on a heterogeneous system with differing CPU architectures, there will be undefined behavior, no?
Maybe, we should just use the largest numeric type for those cases? Or is there a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This depends a bit and would require more work, but I think not in the location here.
heterogeneous system with differing CPU architectures
The questions here is not really the CPU (micro) architecture but the data model: https://en.cppreference.com/w/cpp/language/types Essentially all modern systems you would put on an HPC system are LP64
.
If you would like to run with MPI on a system with heterogeneous hosts, you would have to compile your binaries for each of them and spawn them with MPI. That's the easy part, the hard part would be if someone ever implemented an MPI that would allow to communicate between LP64 and, let's say ILP32, or LP64 with big and little endian.
Either way, it would not change the local code in this location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can actually simplify this by using static constexpr MPI_Datatype const value = ...;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably even make this a simpler constexpr
function now, which might also benefit compile time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr
will probably not work fully since the MPI datatypes are not constexpr
in every implementation, but we can still replace the specialized class template with if constexpr
, yeah.
If you would like to run with MPI on a system with heterogeneous hosts, you would have to compile your binaries for each of them and spawn them with MPI. That's the easy part, the hard part would be if someone ever implemented an MPI that would allow to communicate between LP64 and, let's say ILP32, or LP64 with big and little endian.
Either way, it would not change the local code in this location.
Fair enough, thanks for clarifying!
for more information, see https://pre-commit.ci
I think that this won't work with every MPI implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splendid, thanks a lot! :)
* dev: (70 commits) Docs: Recommend Static Build for Superbuilds (openPMD#1325) Python 3.11 (openPMD#1323) pybind11: v2.10.1+ (openPMD#1322) Add Attribute::getOptional<T>() and use to add some more dynamic datatype conversions at read time (openPMD#1278) Mapping between ADIOS steps and openPMD iterations (openPMD#949) Deprecate shareRaw (openPMD#1229) Fix append mode double attributes (openPMD#1302) Constant scalars: Don't flush double (openPMD#1315) Remove caching cmake vars (openPMD#1313) [pre-commit.ci] pre-commit autoupdate (openPMD#1311) storeChunk: Add an overload for shared_ptr<T[]> (openPMD#1296) Fix `operationAsString` Export (openPMD#1309) ADIOS2: more fine-grained control for file endings (openPMD#1218) [pre-commit.ci] pre-commit autoupdate (openPMD#1307) Fix file existence check in parallel tests (openPMD#1303) ADIOS2: Flush to disk within a step (openPMD#1207) [pre-commit.ci] pre-commit autoupdate (openPMD#1304) [pre-commit.ci] pre-commit autoupdate (openPMD#1295) Update catch2 to v2.13.9 (openPMD#1299) [pre-commit.ci] pre-commit autoupdate (openPMD#1292) ... # Conflicts: # .github/workflows/linux.yml
When appending to an existing group/variable-based Series, don't define top-level attributes again (except
basePath
andopenPMD
, these are needed internally and ADIOS2 doesn't care as long as they are duplicate but equivalent)This fixes an Append mode bug that is already present on dev and has a low chance of making CI runs fail.
CHECK_FILE
task for other backends too (maybe not for ADIOS1)maybe merge, no this would require executingCHECK_FILE
andCREATE_FILE
tasksCREATE_FILE
very earlyThis seems to trigger an ADIOS2 bug?:I get this on dev already, will need to see what's going on