Skip to content

Lammps template for MD+MC - #1149

Open
wujing81 wants to merge 4 commits into
deepmodeling:masterfrom
wujing81:wujing81
Open

Lammps template for MD+MC#1149
wujing81 wants to merge 4 commits into
deepmodeling:masterfrom
wujing81:wujing81

Conversation

@wujing81

@wujing81 wujing81 commented Mar 9, 2023

Copy link
Copy Markdown

Lammps template for MD+MC

@wanghan-iapcm
wanghan-iapcm requested a review from Vibsteamer March 9, 2023 03:01

@Vibsteamer Vibsteamer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The attatched param.json together with the template now dump-and-check in one loop_step:

  1. 50 MC snapshots from the last MD_snapshot in the last loop, many of them are repeated images as being not accepted by Metroplis criterion.
  2. then, 100 MD snapshots from the last accepted MC_snapshot.

the sampling weights (then candidates and labelds) on physical structures could be correspondingly biased,

Please make sure this is of your expectation.


# read in the potentia
pair_style deepmd ../graph.001.pb ../graph.000.pb ../graph.003.pb ../graph.002.pb out_freq ${THERMO_FREQ} out_file model_devi.out
pair_coeff

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pair_coeff
--> pair coeff * *

to be compatible with the latest version of lammps

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Changes requested. The template contains a reproducible LAMMPS syntax error and cannot run. Previously reported issues involving pair_coeff and the sampling weight of repeated MC configurations are also unresolved. The branch is old and has no checks; I recommend rebuilding this example on the current template system with a smoke test.

Note: The Codex quota is about to reset, so I am using the remaining tokens to review all open PRs in this repository.

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

run ${MC_NSTEPS}
unfix mc1

velocity all create ${TEMP_MD} ${RANDOM_SEED}"

@njzjz-bot njzjz-bot Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Blocking] The extra quote after the random seed makes LAMMPS fail immediately with Unmatched double quote in command; I reproduced this with LAMMPS 22 Jul 2025. Please change it to:

Suggested change
velocity all create ${TEMP_MD} ${RANDOM_SEED}"
velocity all create ${TEMP_MD} ${RANDOM_SEED}

The MC seed is also hard-coded to 500 and should be parameterized separately. In addition, dumping after rejected swaps produces repeated configurations, so the intended sampling weight should be documented or the frames should be deduplicated.

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review C

REQUEST_CHANGES. The added example is not runnable as written: its LAMMPS input contains an incomplete dump command and a malformed velocity command. These are direct syntax failures in the primary asset introduced by the PR.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

# output observables
thermo_style custom step temp pe ke etotal press vol lx ly lz xy xz yz
thermo ${THERMO_FREQ}
dump dpgen_dump

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a valid LAMMPS dump command: after the dump ID, LAMMPS requires at least the group, style, frequency, and output file (plus style-specific fields). The example will stop while parsing this line, before either MC or MD runs. Please provide a complete trajectory dump compatible with DP-GEN frame collection.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a2129ad by using revision-matrix placeholders consistently, completing the trajectory dump, and removing the unmatched quote. Pre-commit follow-up f759dc4 retains the fix. Validation: the MC+MD example regression test passed.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

run ${MC_NSTEPS}
unfix mc1

velocity all create ${TEMP_MD} ${RANDOM_SEED}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unmatched trailing quote becomes part of the random-seed token and makes the command invalid LAMMPS syntax.

Suggested change
velocity all create ${TEMP_MD} ${RANDOM_SEED}"
velocity all create ${TEMP_MD} ${RANDOM_SEED}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a2129ad by using revision-matrix placeholders consistently, completing the trajectory dump, and removing the unmatched quote. Pre-commit follow-up f759dc4 retains the fix. Validation: the MC+MD example regression test passed.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review A

Blocking LAMMPS syntax findings are attached inline. As committed, the example cannot reach its MC/MD loop.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@@ -0,0 +1,55 @@
variable MD_NSTEPS equal MD_NSTEPS

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The revision matrix replaces tokens such as ${MD_NSTEPS}, but these declarations use bare self-references (equal MD_NSTEPS, equal MC_NSTEPS, equal TEMP_MD, and so on). Those bare names remain after revise_by_keys and LAMMPS reports an invalid thermo keyword when the variable is evaluated. Use the same ${...} placeholders in each affected declaration (MD/MC steps, temperatures, random seed, element types, and loop count) so DP-GEN substitutes numeric values before execution.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a2129ad by using revision-matrix placeholders consistently, completing the trajectory dump, and removing the unmatched quote. Pre-commit follow-up f759dc4 retains the fix. Validation: the MC+MD example regression test passed.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

run ${MC_NSTEPS}
unfix mc1

velocity all create ${TEMP_MD} ${RANDOM_SEED}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The unmatched trailing quote makes this velocity command invalid LAMMPS syntax.

Suggested change
velocity all create ${TEMP_MD} ${RANDOM_SEED}"
velocity all create ${TEMP_MD} ${RANDOM_SEED}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a2129ad by using revision-matrix placeholders consistently, completing the trajectory dump, and removing the unmatched quote. Pre-commit follow-up f759dc4 retains the fix. Validation: the MC+MD example regression test passed.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review B

Requesting changes because the template placeholders are not substituted and a generated LAMMPS command has an unmatched quote.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Comment on lines +1 to +12
variable MD_NSTEPS equal MD_NSTEPS
variable MC_NSTEPS equal MC_NSTEPS
variable THERMO_FREQ equal 10
variable TEMP_MD equal TEMP_MD
variable TEMP_MC equal TEMP_MC
variable PRES equal press
variable TAU_T equal 0.100000
variable TAU_P equal 0.500000
variable RANDOM_SEED equal RANDOM_SEED
variable ELEMENT_TYPE_1 equal ELEMENT_TYPE_1
variable ELEMENT_TYPE_2 equal ELEMENT_TYPE_2
variable N_LOOP equal N_LOOP

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rev_mat searches for the literal ${...} keys configured in param.json, but most variables in this block omit that syntax. They remain self-referential expressions such as equal MD_NSTEPS and fail when LAMMPS evaluates them. Use the configured placeholders throughout.\n\nsuggestion\nvariable MD_NSTEPS equal ${MD_NSTEPS}\nvariable MC_NSTEPS equal ${MC_NSTEPS}\nvariable THERMO_FREQ equal 10\nvariable TEMP_MD equal ${TEMP_MD}\nvariable TEMP_MC equal ${TEMP_MC}\nvariable PRES equal ${PRES}\nvariable TAU_T equal 0.100000\nvariable TAU_P equal 0.500000\nvariable RANDOM_SEED equal ${RANDOM_SEED}\nvariable ELEMENT_TYPE_1 equal ${ELEMENT_TYPE_1}\nvariable ELEMENT_TYPE_2 equal ${ELEMENT_TYPE_2}\nvariable N_LOOP equal ${N_LOOP}\n

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a2129ad by using revision-matrix placeholders consistently, completing the trajectory dump, and removing the unmatched quote. Pre-commit follow-up f759dc4 retains the fix. Validation: the MC+MD example regression test passed.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

run ${MC_NSTEPS}
unfix mc1

velocity all create ${TEMP_MD} ${RANDOM_SEED}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing quote is unmatched, so this generated LAMMPS input cannot be parsed.\n\nsuggestion\nvelocity all create ${TEMP_MD} ${RANDOM_SEED}\n

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a2129ad by using revision-matrix placeholders consistently, completing the trajectory dump, and removing the unmatched quote. Pre-commit follow-up f759dc4 retains the fix. Validation: the MC+MD example regression test passed.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

njzjz-bot and others added 2 commits August 30, 2026 00:21
Coding-Agent: Codex
Codex-Version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning-Effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LAMMPS template findings were addressed in a2129ad and retained by pre-commit follow-up f759dc4. Placeholder substitution, dump syntax, and velocity syntax are covered by a passing regression test; pre-commit passes.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent re-review C

No blocking issues found; the LAMMPS dump and velocity commands are now syntactically complete.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent re-review B

Reviewed the parameter file and LAMMPS template against the current revision-matrix path, strict DP-GEN argument validation, model-file substitution behavior, and the regression test. I found no blocking correctness issue in the example and approve this head.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent re-review A

Approved at f759dc4. I checked the revision-matrix placeholders, LAMMPS variable expansion, atom/swap syntax, dump command, JSON structure, and regression test.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants