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

Write and read mesh using ADIOS2 #3291

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open

Conversation

ampdes
Copy link
Contributor

@ampdes ampdes commented Jul 4, 2024

This PR introduces module for native checkpointing using ADIOS2.

For the python APIs, we cannot use the ADIOS2 python bindings which are based on pybinds, hence a wrapper to ADIOS2 is created.

The ADIOS2 BeginStep() and EndStep() collectives are designed per write function. However, for the reader, we have that the BeginStep is external to function to first query the types and then call the reader with the correct type.

This PR has mesh writer/reader.

For time dependent mesh, the topology is written once and and only geometry is written with time dependency.
Therefore for reading, we have two separate functions read_mesh which reads the topology and geometry and constructs a mesh and then update_mesh which takes this mesh and updates the associated geometry at a later time.

TODO:

  • Add time dependent mesh write
  • Add time dependent mesh read
  • Add unit tests for time dependent mesh

@ampdes ampdes marked this pull request as draft July 9, 2024 10:11
@ampdes ampdes marked this pull request as ready for review July 9, 2024 19:15
@jhale
Copy link
Member

jhale commented Jul 23, 2024

What's going on with this one @ampdes? Is it ready to review?

@ampdes
Copy link
Contributor Author

ampdes commented Jul 24, 2024

A preliminary review of the structure/naming in the slack channel will be appropriate first.
I will update this then.

Comment on lines 82 to 83
const std::vector<int64_t> input_global_indices
= geometry.input_global_indices();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const std::vector<int64_t> input_global_indices
= geometry.input_global_indices();
const std::vector<int64_t>& input_global_indices
= geometry.input_global_indices();

This could be const right?

* Update copyright headers

* Remove ADIOS_utils.cpp

* Correct the global topology computation

* Rename vertices to nodes
Add Append adios mode

Add complete set of basix enum-string maps
ampdes added a commit to ampdes/dolfinx that referenced this pull request Aug 18, 2024
Comment on lines 44 to 47
for (std::size_t i = 0; i < x.size(); ++i)
{
x[i] *= 4;
}
Copy link
Member

@jorgensd jorgensd Aug 30, 2024

Choose a reason for hiding this comment

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

We could use std::for_each to illustrate good coding practices, see:
https://godbolt.org/z/97osavhb6

@mscroggs mscroggs added this to the 0.10.0 milestone Sep 3, 2024
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.

4 participants