Skip to content

Support reading Array/Matrix/Tensor<int> in OptionsAdios2#3207

Merged
ZedThree merged 13 commits into
nextfrom
test-options-adios2
Nov 21, 2025
Merged

Support reading Array/Matrix/Tensor<int> in OptionsAdios2#3207
ZedThree merged 13 commits into
nextfrom
test-options-adios2

Conversation

@ZedThree
Copy link
Copy Markdown
Member

Although writing was supported, we didn't actually support reading these types. I've refactored the implementation to reduce a lot of duplication in calculating/setting the Adios2 starts/counts etc.

Also fixes a bug with reading/writing FieldPerp

I've also replaced the integrated test with a more comprehensive unit test. We still don't test in parallel, but this is better than nothing.

Some of this would be nicer with C++26's template for. Maybe we can use that in a few years.

}
if (type == adios2::GetType<long double>()) {
return readVariable<long double>(reader, io, name, type);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why no macro magic? This feels like there must be a better solution e.g. visitor pattern, but this will work.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, I didn't really mean to leave this in, I was just searching for a neater non-macro solution, but didn't find one. Here's where template for would be really useful!

Copy link
Copy Markdown
Contributor

@bendudson bendudson left a comment

Choose a reason for hiding this comment

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

Nice! Thanks @ZedThree

@ZedThree ZedThree merged commit 4e30867 into next Nov 21, 2025
28 checks passed
@ZedThree ZedThree deleted the test-options-adios2 branch November 21, 2025 16:26
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.

2 participants