Skip to content

Store states in DataCollectors #237

@Flamefire

Description

@Flamefire

The DataCollector classes should be converted to C++ classes that can store states.

  1. Store the ID.
    Currently you must pass the id to almost(?) every write/read method. This is inconvenient and error-prone. The ID should be stored (e.g. during opening or with setters if it should be possible to change it) and removed from the write/read interface
  2. Similar with the mpiRank
    Currently some classes use the mpiRank and some use the ID for accessing data, it even seems to be mixed or nulled at some places. Better would be to honor the arguments passed in at file-opening and store it. So it would be possible to use a variable naming scheme for the files (mpiRank or ID in name)
  3. Store the (base) filename
    It might be good to store the basename of the h5 file for users to access it. It is e.g. required for openPMD attributes and doesn't cost much.
  4. Store current dataset
    Writing/reading is often done dataset-wise. So the interface should support that. A wrapper I came up with supports the usage below:

Wrapper:

 dc.setDataset("fields/foobar");
 auto writeAttribute = dc.getAttributeWriter();
 writeAttribute("foo", "bar");
 writeAttribute("idx", 5);
 writeAttribute("units", std::vector<int>(5,0));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions