Skip to content
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: Add OpenPMD support #1050

Open
wants to merge 94 commits into
base: develop
Choose a base branch
from
Open

WIP: Add OpenPMD support #1050

wants to merge 94 commits into from

Conversation

pgrete
Copy link
Collaborator

@pgrete pgrete commented Apr 12, 2024

PR Summary

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

Comment on lines 272 to 275
for (auto &pmb : pm->block_list) {
// TODO(pgrete) check if we should skip the suffix for level 0
const auto level = pmb->loc.level() - pm->GetRootLevel();
const std::string &mesh_record_name = var_name + "_lvl" + std::to_string(level);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing level

Comment on lines 120 to 125
for (auto &pmb : pm->block_list) {
// TODO(pgrete) check if we should skip the suffix for level 0
// TODO(pgrete) ask LR why this is not mirrored from writing
// const auto level = pmb->loc.level() - pm->GetRootLevel();
const auto level = pmb->loc.level();
const std::string &mesh_record_name = var_name + "_lvl" + std::to_string(level);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading level

@pgrete
Copy link
Collaborator Author

pgrete commented Sep 3, 2024

Another alternative would be to create a "mesh" called "Params" and one "record" per package that could carry all the attribute (or sth along those directions), but again, I would consider that a work around rather than a clean use of the intended standard.

@BenWibking
Copy link
Collaborator

Ok, that makes sense, but I think there's a risk this will be significantly delayed if this is blocked on a > 1 yr old PR in openPMD.

@BenWibking
Copy link
Collaborator

BenWibking commented Oct 11, 2024

I am unable to read the outputs this produces with Paraview. Has anyone else been able to do so?

Details: https://discourse.paraview.org/t/no-fields-are-rendered-after-opening-openpmd-file/15533

@BenWibking
Copy link
Collaborator

I am unable to read the outputs this produces with Paraview. Has anyone else been able to do so?

Details: https://discourse.paraview.org/t/no-fields-are-rendered-after-opening-openpmd-file/15533

In case anyone else encounters this, the files load fine using the ADIOS2 image reader in Paraview, but not with the OpenPMD-api reader: https://openpmd-api.readthedocs.io/en/latest/analysis/paraview.html#openpmd

@BenWibking
Copy link
Collaborator

BenWibking commented Oct 16, 2024

This PR is now broken due to changes in #1177:

[125/290] Building CXX object parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o
FAILED: parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DADIOS2_USE_MPI -DFS_HEADER="<filesystem>" -DFS_NAMESPACE=std::filesystem -DH5_BUILT_AS_DYNAMIC_LIB -DKOKKOS_DEPENDENCE -I/Users/benwibking/athenapk/external/parthenon/src -I/Users/benwibking/athenapk/build/parthenon/src/generated -I/Users/benwibking/athenapk/build/_deps/openpmd-src/include -I/Users/benwibking/athenapk/build/_deps/openpmd-build/include -I/Users/benwibking/athenapk/build/parthenon/Kokkos -I/Users/benwibking/athenapk/build/parthenon/Kokkos/core/src -I/Users/benwibking/athenapk/external/Kokkos/core/src -I/Users/benwibking/athenapk/external/Kokkos/core/src/../../tpls/desul/include -I/Users/benwibking/athenapk/external/Kokkos/core/src/../../tpls/mdspan/include -I/Users/benwibking/athenapk/build/parthenon/Kokkos/containers/src -I/Users/benwibking/athenapk/external/Kokkos/containers/src -I/Users/benwibking/athenapk/build/parthenon/Kokkos/algorithms/src -I/Users/benwibking/athenapk/external/Kokkos/algorithms/src -I/Users/benwibking/athenapk/build/parthenon/Kokkos/simd/src -I/Users/benwibking/athenapk/external/Kokkos/simd/src -isystem /opt/homebrew/Cellar/open-mpi/5.0.5/include -isystem /opt/homebrew/include -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -MD -MT parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o -MF parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o.d -o parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o -c /Users/benwibking/athenapk/external/parthenon/src/outputs/parthenon_opmd.cpp
/Users/benwibking/athenapk/external/parthenon/src/outputs/parthenon_opmd.cpp:403:35: error: use of undeclared identifier 'GetBoundaryString'; did you mean 'GetBoundaryFlag'?
      boundary_condition_str[i] = GetBoundaryString(pm->mesh_bcs[i]);
                                  ^~~~~~~~~~~~~~~~~
                                  GetBoundaryFlag
/Users/benwibking/athenapk/external/parthenon/src/bvals/bvals.hpp:52:14: note: 'GetBoundaryFlag' declared here
BoundaryFlag GetBoundaryFlag(const std::string &input_string);
             ^
/Users/benwibking/athenapk/external/parthenon/src/outputs/parthenon_opmd.cpp:403:53: error: reference to type 'const std::string' (aka 'const basic_string<char>') could not bind to an lvalue of type 'value_type' (aka 'parthenon::BoundaryFlag')
      boundary_condition_str[i] = GetBoundaryString(pm->mesh_bcs[i]);
                                                    ^~~~~~~~~~~~~~~
/Users/benwibking/athenapk/external/parthenon/src/bvals/bvals.hpp:52:49: note: passing argument to parameter 'input_string' here
BoundaryFlag GetBoundaryFlag(const std::string &input_string);
                                                ^
2 errors generated.
[136/290] Building CXX object parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o
FAILED: parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DADIOS2_USE_MPI -DFS_HEADER="<filesystem>" -DFS_NAMESPACE=std::filesystem -DH5_BUILT_AS_DYNAMIC_LIB -DKOKKOS_DEPENDENCE -I/Users/benwibking/athenapk/external/parthenon/src -I/Users/benwibking/athenapk/build/parthenon/src/generated -I/Users/benwibking/athenapk/build/_deps/openpmd-src/include -I/Users/benwibking/athenapk/build/_deps/openpmd-build/include -I/Users/benwibking/athenapk/build/parthenon/Kokkos -I/Users/benwibking/athenapk/build/parthenon/Kokkos/core/src -I/Users/benwibking/athenapk/external/Kokkos/core/src -I/Users/benwibking/athenapk/external/Kokkos/core/src/../../tpls/desul/include -I/Users/benwibking/athenapk/external/Kokkos/core/src/../../tpls/mdspan/include -I/Users/benwibking/athenapk/build/parthenon/Kokkos/containers/src -I/Users/benwibking/athenapk/external/Kokkos/containers/src -I/Users/benwibking/athenapk/build/parthenon/Kokkos/algorithms/src -I/Users/benwibking/athenapk/external/Kokkos/algorithms/src -I/Users/benwibking/athenapk/build/parthenon/Kokkos/simd/src -I/Users/benwibking/athenapk/external/Kokkos/simd/src -isystem /opt/homebrew/Cellar/open-mpi/5.0.5/include -isystem /opt/homebrew/include -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -MD -MT parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o -MF parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o.d -o parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o -c /Users/benwibking/athenapk/external/parthenon/src/outputs/restart_opmd.cpp
/Users/benwibking/athenapk/external/parthenon/src/outputs/restart_opmd.cpp:80:13: error: no member named 'bound_cond' in 'parthenon::RestartReader::MeshInfo'
  mesh_info.bound_cond =
  ~~~~~~~~~ ^
1 error generated.

@Yurlungur is there an easy fix for this?

@pgrete
Copy link
Collaborator Author

pgrete commented Nov 9, 2024

This PR is now broken due to changes in #1177:

[125/290] Building CXX object parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o
FAILED: parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DADIOS2_USE_MPI -DFS_HEADER="<filesystem>" -DFS_NAMESPACE=std::filesystem -DH5_BUILT_AS_DYNAMIC_LIB -DKOKKOS_DEPENDENCE -I/Users/benwibking/athenapk/external/parthenon/src -I/Users/benwibking/athenapk/build/parthenon/src/generated -I/Users/benwibking/athenapk/build/_deps/openpmd-src/include -I/Users/benwibking/athenapk/build/_deps/openpmd-build/include -I/Users/benwibking/athenapk/build/parthenon/Kokkos -I/Users/benwibking/athenapk/build/parthenon/Kokkos/core/src -I/Users/benwibking/athenapk/external/Kokkos/core/src -I/Users/benwibking/athenapk/external/Kokkos/core/src/../../tpls/desul/include -I/Users/benwibking/athenapk/external/Kokkos/core/src/../../tpls/mdspan/include -I/Users/benwibking/athenapk/build/parthenon/Kokkos/containers/src -I/Users/benwibking/athenapk/external/Kokkos/containers/src -I/Users/benwibking/athenapk/build/parthenon/Kokkos/algorithms/src -I/Users/benwibking/athenapk/external/Kokkos/algorithms/src -I/Users/benwibking/athenapk/build/parthenon/Kokkos/simd/src -I/Users/benwibking/athenapk/external/Kokkos/simd/src -isystem /opt/homebrew/Cellar/open-mpi/5.0.5/include -isystem /opt/homebrew/include -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -MD -MT parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o -MF parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o.d -o parthenon/src/CMakeFiles/parthenon.dir/outputs/parthenon_opmd.cpp.o -c /Users/benwibking/athenapk/external/parthenon/src/outputs/parthenon_opmd.cpp
/Users/benwibking/athenapk/external/parthenon/src/outputs/parthenon_opmd.cpp:403:35: error: use of undeclared identifier 'GetBoundaryString'; did you mean 'GetBoundaryFlag'?
      boundary_condition_str[i] = GetBoundaryString(pm->mesh_bcs[i]);
                                  ^~~~~~~~~~~~~~~~~
                                  GetBoundaryFlag
/Users/benwibking/athenapk/external/parthenon/src/bvals/bvals.hpp:52:14: note: 'GetBoundaryFlag' declared here
BoundaryFlag GetBoundaryFlag(const std::string &input_string);
             ^
/Users/benwibking/athenapk/external/parthenon/src/outputs/parthenon_opmd.cpp:403:53: error: reference to type 'const std::string' (aka 'const basic_string<char>') could not bind to an lvalue of type 'value_type' (aka 'parthenon::BoundaryFlag')
      boundary_condition_str[i] = GetBoundaryString(pm->mesh_bcs[i]);
                                                    ^~~~~~~~~~~~~~~
/Users/benwibking/athenapk/external/parthenon/src/bvals/bvals.hpp:52:49: note: passing argument to parameter 'input_string' here
BoundaryFlag GetBoundaryFlag(const std::string &input_string);
                                                ^
2 errors generated.
[136/290] Building CXX object parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o
FAILED: parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DADIOS2_USE_MPI -DFS_HEADER="<filesystem>" -DFS_NAMESPACE=std::filesystem -DH5_BUILT_AS_DYNAMIC_LIB -DKOKKOS_DEPENDENCE -I/Users/benwibking/athenapk/external/parthenon/src -I/Users/benwibking/athenapk/build/parthenon/src/generated -I/Users/benwibking/athenapk/build/_deps/openpmd-src/include -I/Users/benwibking/athenapk/build/_deps/openpmd-build/include -I/Users/benwibking/athenapk/build/parthenon/Kokkos -I/Users/benwibking/athenapk/build/parthenon/Kokkos/core/src -I/Users/benwibking/athenapk/external/Kokkos/core/src -I/Users/benwibking/athenapk/external/Kokkos/core/src/../../tpls/desul/include -I/Users/benwibking/athenapk/external/Kokkos/core/src/../../tpls/mdspan/include -I/Users/benwibking/athenapk/build/parthenon/Kokkos/containers/src -I/Users/benwibking/athenapk/external/Kokkos/containers/src -I/Users/benwibking/athenapk/build/parthenon/Kokkos/algorithms/src -I/Users/benwibking/athenapk/external/Kokkos/algorithms/src -I/Users/benwibking/athenapk/build/parthenon/Kokkos/simd/src -I/Users/benwibking/athenapk/external/Kokkos/simd/src -isystem /opt/homebrew/Cellar/open-mpi/5.0.5/include -isystem /opt/homebrew/include -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -MD -MT parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o -MF parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o.d -o parthenon/src/CMakeFiles/parthenon.dir/outputs/restart_opmd.cpp.o -c /Users/benwibking/athenapk/external/parthenon/src/outputs/restart_opmd.cpp
/Users/benwibking/athenapk/external/parthenon/src/outputs/restart_opmd.cpp:80:13: error: no member named 'bound_cond' in 'parthenon::RestartReader::MeshInfo'
  mesh_info.bound_cond =
  ~~~~~~~~~ ^
1 error generated.

@Yurlungur is there an easy fix for this?

Yes, I'll take care of it.

@pgrete
Copy link
Collaborator Author

pgrete commented Nov 9, 2024

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants