openPMD / openPMD/openPMD-api

Writing a field of custom type

Open
#1,098 3 comments 2 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
161
Forks
59
Avg merge
2d 22h
Merged PRs (30d)
7

Description

HI,

I am not sure what is a good pattern in the following case.

I have a large C-style array of some bitwise-copyable `struct`. A particular `struct` being used depends on build parameters and comes from a 3rd party library. So generally I don't know how this type is defined, just know the size and that it is bitwise-copyable. I would like to write this field using `storeChunk`. Do not care about interpretation, just that after reading back it is exactly same. Should I reinterpret it as `N * sizeof(MyStruct)` array of char and write like that, or is there something better?

This comes from checkpointing internal RNG states (which may come from a number of implementations) in PIConGPU.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.