robinzyb / cp2kdata

cp2k postprocessing tools
https://robinzyb.github.io/cp2kdata/
GNU Lesser General Public License v3.0
52 stars 18 forks source link

A problem about reading cp2k data #27

Closed WeJear closed 9 months ago

WeJear commented 9 months ago

When I was reading the file, an error occurred. I tried rerunning cp2k molecular dynamics, but the error still occurred. Can you help me check what the reason is?

--- You are parsing data using package Cp2kData ---
Parsing Energies from water-dp/water-300K-1.ener
Parsing Structures from water-dp/water-300K-pos-1.xyz
Parsing Froces from water-dp/water-300K-nvt.force-frc-1.xyz
Parsing Stress from the CP2K output/log file: water-dp/md.log
Parsing Cells Information from water-dp/md.log
Atom names are fake chemical symbols as you set in cp2k input.
--- You are parsing data using package Cp2kData ---
Traceback (most recent call last):
  File "/home/xwj/materials/water/water-deepmd/water-dp.py", line 16, in <module>
    data = dpdata.LabeledSystem(cp2kmd_dir, cp2k_output_name=cp2kmd_output_name, fmt="cp2kdata/md")
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 183, in __init__
    self.from_fmt(
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 220, in from_fmt
    return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 1120, in from_fmt_obj
    self.check_data()
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 207, in check_data
    dd.check(self)
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/data_type.py", line 112, in check
    raise DataError(
dpdata.data_type.DataError: Shape of coords is (5404, 687, 3), but expected (5405, 687, 3)

I've looked at other files and they contain 5404 data, but why does it show that it expects 5405 data.

The following is the inp file of cp2k. water.zip

Below is the complete file, which I put on my Google Cloud Drive. https://drive.google.com/file/d/1lc9H1od_g-j335F1BqCi-ysP7EjV0evg/view?usp=drive_link

WeJear commented 9 months ago

When I was reading the file, an error occurred. I tried rerunning cp2k molecular dynamics, but the error still occurred. Can you help me check what the reason is?

--- You are parsing data using package Cp2kData ---
Parsing Energies from water-dp/water-300K-1.ener
Parsing Structures from water-dp/water-300K-pos-1.xyz
Parsing Froces from water-dp/water-300K-nvt.force-frc-1.xyz
Parsing Stress from the CP2K output/log file: water-dp/md.log
Parsing Cells Information from water-dp/md.log
Atom names are fake chemical symbols as you set in cp2k input.
--- You are parsing data using package Cp2kData ---
Traceback (most recent call last):
  File "/home/xwj/materials/water/water-deepmd/water-dp.py", line 16, in <module>
    data = dpdata.LabeledSystem(cp2kmd_dir, cp2k_output_name=cp2kmd_output_name, fmt="cp2kdata/md")
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 183, in __init__
    self.from_fmt(
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 220, in from_fmt
    return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 1120, in from_fmt_obj
    self.check_data()
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 207, in check_data
    dd.check(self)
  File "/home/xwj/miniconda3/envs/deepmd/lib/python3.10/site-packages/dpdata/data_type.py", line 112, in check
    raise DataError(
dpdata.data_type.DataError: Shape of coords is (5404, 687, 3), but expected (5405, 687, 3)

I've looked at other files and they contain 5404 data, but why does it show that it expects 5405 data.

The following is the inp file of cp2k. water.zip

Below is the complete file, which I put on my Google Cloud Drive. https://drive.google.com/file/d/1lc9H1od_g-j335F1BqCi-ysP7EjV0evg/view?usp=drive_link

I didn't want to close this question, I made the wrong choice, but I can't recover

robinzyb commented 9 months ago

this means the number of structures and the number of energies are not matched each other

robinzyb commented 9 months ago

could you upload the -1.ener file only?

WeJear commented 9 months ago

could you upload the -1.ener file only?

This file is too big. I give a link which contains this file.

WeJear commented 9 months ago

could you upload the -1.ener file only?

I'm sorry I made a mistake. In fact, this file is not big. water-300K-1.zip

robinzyb commented 9 months ago

you have to grant me access to the Gdrive

WeJear commented 9 months ago

you have to grant me access to the Gdrive

I have grant you. Sorry about it.

robinzyb commented 9 months ago

For some reasons, the number of energy are one more than the number of structures. I found it is because cp2k is terminated by force . You can move the -1.ener out of the directory, then cp2kdata will parse energies from -pos- files.

For future usage. I strongly recommend you or your colleague add WALLTIME under the GLOBAL section in cp2k input. The WALLTIME should be slightly less than the end time of job mananger. This can help cp2k flush complete information.

WeJear commented 9 months ago

For some reasons, the number of energy are one more than the number of structures. I found it is because cp2k is terminated by force . You can move the -1.ener out of the directory, then cp2kdata will parse energies from -pos- files.

For future usage. I strongly recommend you or your colleague add WALLTIME under the GLOBAL section in cp2k input. The WALLTIME should be slightly less than the end time of job mananger. This can help cp2k flush complete information.

ok i will try it thank you very much

WeJear commented 9 months ago

For some reasons, the number of energy are one more than the number of structures. I found it is because cp2k is terminated by force . You can move the -1.ener out of the directory, then cp2kdata will parse energies from -pos- files.

For future usage. I strongly recommend you or your colleague add WALLTIME under the GLOBAL section in cp2k input. The WALLTIME should be slightly less than the end time of job mananger. This can help cp2k flush complete information.

I tried your suggestions but still got the same error. Do I still need to remove some files?

WeJear commented 9 months ago

For some reasons, the number of energy are one more than the number of structures. I found it is because cp2k is terminated by force . You can move the -1.ener out of the directory, then cp2kdata will parse energies from -pos- files.

For future usage. I strongly recommend you or your colleague add WALLTIME under the GLOBAL section in cp2k input. The WALLTIME should be slightly less than the end time of job mananger. This can help cp2k flush complete information.

I tried your suggestions but still got the same error. Do I still need to remove some files?

I found the solution to the problem. I just need to delete the last frame of data in the .log file, or add a frame of data to .ener file, pos.xyz file and frc.xyz file.

robinzyb commented 9 months ago

good. Just add wall time before next calculation to avoid such problem