Skip to content

When running dpgen, how can I add fparam after pair_style if I provide the lammps input file myself? #1608

Closed
@lhyand

Description

@lhyand

Bug summary

During the training process, electron temperature is considered. Both numb_fparam and use_ele_temp are set to 1. The lammps input file pair_style automatically generated by dpgen contains the fparam keyword, but I want to provide the lammps input file myself. I added fparam to the pair_style in the input file I provided. I found that the fparam after pair_style in the lammps input file will be deleted during model_devi. The electron temperature is considered during dpkit training. If there is no fparam after pair_style, an error will be reported when running md. So how can I add fparam after pair_style on the premise of providing the lammps input file myself?

DP-GEN Version

0.10.6

Platform, Python Version, Remote Platform, etc

Ubuntu 20.04.5 LTS (in Bohrium)
Python 3.10.6

Input Files, Running Commands, Error Log, etc.

This is an input file that I defined myself

units metal
boundary p p p
atom_style atomic
neighbor 1.0 bin
box tilt large
if "${restart} > 0" then "read_restart dpgen.restart." else "read_data conf.lmp"
change_box all triclinic
mass 1 58.93
mass 2 51.99
mass 3 58.69
#pair_style deepmd ../graph.000.pb ../graph.001.pb ../graph.002.pb ../graph.003.pb out_freq ${THERMO_FREQ} out_file model_devi.out fparam ${TEMP}
pair_style deepmd ../graph.000.pb ../graph.001.pb ../graph.002.pb ../graph.003.pb out_freq ${THERMO_FREQ} out_file model_devi.out fparam ${TEMP}
pair_coeff * *
thermo_style custom step temp pe ke etotal press vol pxx pyy pzz pxy pxz pyz lx ly lz xy xz yz
thermo ${THERMO_FREQ}
dump 1 all custom ${DUMP_FREQ} traj/
.lammpstrj id type x y z fx fy fz
dump dpgen_dump
restart 10000 dpgen.restart
if "${restart} == 0" then "velocity all create ${TEMP} 709383"
fix 1 all ${ENSEMBLE} temp ${TEMP} ${TEMP} 0.1
fix 2 all atom/swap ${MC_FREQ} 1 9999 ${TEMP} ke yes types 1 2 semi-grand no
fix 3 all atom/swap ${MC_FREQ} 1 9999 ${TEMP} ke yes types 1 3 semi-grand no
fix 4 all atom/swap ${MC_FREQ} 1 9999 ${TEMP} ke yes types 2 3 semi-grand no
timestep 0.001000
run ${NSTEPS} upto

This is the input file used in the model_devi process, and we can see that the fparam keyword has been removed

units metal
boundary p p p
atom_style atomic
neighbor 1.0 bin
box tilt large
if "${restart} > 0" then "read_restart dpgen.restart." else "read_data conf.lmp"
change_box all triclinic
mass 1 58.93
mass 2 51.99
mass 3 58.69
#pair_style deepmd ../graph.000.pb ../graph.001.pb ../graph.002.pb ../graph.003.pb out_freq 10 out_file model_devi.out fparam 200
pair_style deepmd ../graph.000.pb ../graph.001.pb ../graph.002.pb ../graph.003.pb out_freq 10 out_file model_devi.out
pair_coeff * *
thermo_style custom step temp pe ke etotal press vol pxx pyy pzz pxy pxz pyz lx ly lz xy xz yz
thermo 10
dump 1 all custom 10 traj/
.lammpstrj id type x y z fx fy fz
dump dpgen_dump all custom 10 traj/*.lammpstrj id type x y z
restart 10000 dpgen.restart
if "${restart} == 0" then "velocity all create 200 709383"
fix 1 all nvt temp 200 200 0.1
fix 2 all atom/swap 10 1 9999 200 ke yes types 1 2 semi-grand no
fix 3 all atom/swap 10 1 9999 200 ke yes types 1 3 semi-grand no
fix 4 all atom/swap 10 1 9999 200 ke yes types 2 3 semi-grand no
timestep 0.001000
run 200 upto

The following is the error message

ERROR on proc 0: DeePMD-kit C API Error: the dim of frame parameter provided is not consistent with what the model uses (/home/conda/feedstock_root/build_artifacts/libdeepmd_1698439191117/work/source/lmp/pair_deepmd.cpp:670)
Last command: run 200 upto
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=1
:
system msg for write_line failure : Bad file descriptor

Running commands

nohup dpgen run param.json machine.json > log.run 2>&1 &

Steps to Reproduce

nohup dpgen run param.json machine.json > log.run 2>&1 &

Further Information, Files, and Links

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions