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

Store states in DataCollectors #237

Open
Flamefire opened this issue Jun 13, 2016 · 1 comment
Open

Store states in DataCollectors #237

Flamefire opened this issue Jun 13, 2016 · 1 comment
Labels
Milestone

Comments

@Flamefire
Copy link
Contributor

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));
@ax3l ax3l added the feature label Jun 13, 2016
@ax3l ax3l added this to the Version 2.0 milestone Jun 13, 2016
@ax3l
Copy link
Member

ax3l commented Jun 13, 2016

possible to be done as a high-level interface in #163

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

No branches or pull requests

2 participants