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

CP2K parser yields trajectory errors for finished trajectories #253

Open
ndaelman-hu opened this issue Sep 16, 2024 · 3 comments
Open

CP2K parser yields trajectory errors for finished trajectories #253

ndaelman-hu opened this issue Sep 16, 2024 · 3 comments
Labels
bug Something isn't working. It also represents a quick fix in response to a bug.

Comments

@ndaelman-hu
Copy link
Contributor

The CP2K output in the example set states of geometry optimization yields errors and warnings indicating an attempt to extract a non-existing frame. I suspect a bug in the frame counting.

Example set: https://nomad-lab.eu/prod/v1/develop/gui/user/uploads/upload/id/Arb2fKCQT_uPOUriPyWKFw

Logs:

"root":{
  "data":string"{'frame': 101}"
  "event":string"Error reading trajectory for the specific frame."
  "proc":string"Entry"
  "process":string"process_entry"
  "process_worker_id":string"ALgrZWZwSYSaMFc_Zobd4g"
  "parser":string"parsers/cp2k"
  "step":string"parsers/cp2k"
  "logger":string"nomad.processing"
  "timestamp":string"2024-09-07 13:29.50"
  "level":string"ERROR"
}
"root":{
  "data":string"{'frame': 101}"
  "event":string"Could not parse system information for the last frame. We will attempt to parse the system information from (frame + 1)."
  "proc":string"Entry"
  "process":string"process_entry"
  "process_worker_id":string"ALgrZWZwSYSaMFc_Zobd4g"
  "parser":string"parsers/cp2k"
  "step":string"parsers/cp2k"
  "logger":string"nomad.processing"
  "timestamp":string"2024-09-07 13:29.50"
  "level":string"WARNING"
}
  "root":{
  "data":string"{'frame': 102}"
  "event":string"Error reading trajectory for the specific frame."
  "proc":string"Entry"
  "process":string"process_entry"
  "process_worker_id":string"ALgrZWZwSYSaMFc_Zobd4g"
  "parser":string"parsers/cp2k"
  "step":string"parsers/cp2k"
  "logger":string"nomad.processing"
  "timestamp":string"2024-09-07 13:29.50"
  "level":string"ERROR"
}
  "root":{
  "normalizer":string"MetainfoNormalizer"
  "event":string"Energy not reported for an calculation that is part of a geometry optimization"
  "proc":string"Entry"
  "process":string"process_entry"
  "process_worker_id":string"ALgrZWZwSYSaMFc_Zobd4g"
  "parser":string"parsers/cp2k"
  "step":string"MetainfoNormalizer"
  "logger":string"nomad.processing"
  "timestamp":string"2024-09-07 13:29.52"
  "level":string"WARNING"
}
"root":{
  "event":string"processing error"
  "level":string"ERROR"
  "timestamp":string"2024-09-07T13:29:41.219000+00:00"
  "processing_errors":[
    0:
    string"Error reading trajectory for the specific frame."
    1:
    string"Error reading trajectory for the specific frame."
  ]
}
@ndaelman-hu ndaelman-hu added the bug Something isn't working. It also represents a quick fix in response to a bug. label Sep 16, 2024
@ndaelman-hu
Copy link
Contributor Author

A 1st, short debug attempt shows the following structure:

  • CP2KParser.parse_calculations enumerates over all extracted calculations, where frame is the running index.
  • CP2KParser.parse_system calls TrajParser.get_trajectory(frame), where frame is reinterpreted as a trajectory object.
  • TrajParser.get_trajectory simply regulates the extraction. Any kind of failure (triggered in this case) is handled by CP2KParser.parse_system`.

My impression is that the index is not properly updated.
The starting (and ending) frame receive special treatment, such as not being counted by the index.
The index in geom. opt. seems to include the regular index, though, causing an IndexError.

@ndaelman-hu
Copy link
Contributor Author

A 1st, short debug attempt shows the following structure:

* `CP2KParser.parse_calculations` enumerates over all extracted `calculations`, where `frame` is the running index.

* `CP2KParser.parse_system` calls `TrajParser.get_trajectory(frame)`, where `frame` is reinterpreted as a trajectory object.

* `TrajParser.get_trajectory` simply regulates the extraction. Any kind of failure (triggered in this case) is handled by CP2KParser.parse_system`.

My impression is that the index is not properly updated. The starting (and ending) frame receive special treatment, such as not being counted by the index. The index in geom. opt. seems to include the regular index, though, causing an IndexError.

@ladinesa or @aalbino2 could any of you, as the og patcher and a code expert respectively, verify my understanding of the indexation here?

@ndaelman-hu ndaelman-hu reopened this Sep 16, 2024
@aalbino2
Copy link

aalbino2 commented Sep 17, 2024

Hi @ndaelman-hu,

I have no access to the upload you posted above.
From the geo_opt point of view you can take a look at this published upload:
https://nomad-lab.eu/prod/v1/develop/gui/search/entries/entry/id/awW9DHiMBwa4uz8eD7hbItgrxoOJ

It show a log error saying the the .out and the trajectory file have different steps.
Two main issues are stack here:

  • the steps are counted like 43 and 44 but downloading the file you see 44 and 45, probably a 0-indexed array matter
  • the trajectory has one more step because after the geo opt completes, a new last optimized geometry snapshot is saved there.

I don't know if those bugs are already fixed in develop.
Let me try to reprocess from there, as you suggested to Pierre-Adrienne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It also represents a quick fix in response to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants