Skip to content

[Feature Request]: Better handling of parsed trajectory in VASP calculations #872

@gpetretto

Description

@gpetretto

Problem

The current calculation model used for MD simulations in atomate2 relies on the store_trajectory option in the Calculation model.
I think that there are some problems associated with the current handling of the trajectory. Those related to emmet concern the amount of data that is stored. In fact, for each frame of the Trajectory object the whole IonicStep is stored as well

frame_properties=[
IonicStep(**x).model_dump() for x in vasprun.ionic_steps
],

Considering that this feature is used to store the output of (potentially long) MD simulation, this has some issues:

  1. each ionic step contains the Structure of the step, so each Structure is essentially stored twice in the Trajectory. It seems that the structure stored in the IonicStep does not include any additional property, so it is entirely redundant.
  2. for each step all the SCF steps are also stored as well, which amount to a considerable amount of data being stored in the DB
  3. Some additional information that is only available for MD simulation is not considered. In particular I am referring to the temperature, that would be interesting to have for post-processing analysis.

The first two points are not blocking issues, but when storing the output of long simulations they will probably have a big impact on the size required for the stored data. Combined, they will probably require roughly 3x the space required if only the structure and the final properties would be stored for each step.

The parsing of large MD trajectory may also be demanding in terms of resources and in general I believe that this could be optionally handled by extracting the data from the new vasp hd5 output file, rather than from the vasprun.xml. So this issue might be linked to the one I opened in atomate2: materialsproject/atomate2#515

Also tagging @utf and @mjwen as this may impact the MD flow in atomate2.

Proposed Solution

I am aware of the fact that if the trajectory is stored its content covers also the one of the ionic_steps in the CalculationOutput model. But I think that it would be reasonable to have the following changes

  • Remove the Structure from the frame properties to avoid redundancy. This should be easy to do and I don't see any downside. The structure attribute is even optional in IonicStep
  • I don't see a strict need for the electronic steps to be present in a long MD simulation, but there are probably cases where this might be needed. I would thus propose to have the store_trajectory attribute as a multi valued flag, that would allow to store the full IonicStep (except for the Structure) or a subset of the data.
    To preserve backward compatibility this could be defined as
    store_trajectory: bool | Literal["partial"] = False,
    Where the bool values have the same meaning as the current option, while the partial value removes the electronic steps from the dictionary. I would make this the default for the atomate2 MD worflows.

Concerning the temperature, this could be retrieved from the OSZICAR and is already available in the Oszicar object in pymatgen. This would require the parsing of an additional object, but, as far as I can see, the values are not present in the vasprun.xml.
I am not sure if this would better fit in the frame_properties of the trajectory, or as an attribute of the model on its own.

If these suggestions are fine I can open a PR with their implementation. Otherwise, do you have other suggestions on how to modify the current model?

Alternatives

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions