Skip to content

fix spring output bug and add a restart for multi run - #1652

Merged
brucefan1983 merged 2 commits into
brucefan1983:masterfrom
BBBuZHIDAO:add_spring_output_bug_fix
Aug 22, 2026
Merged

brucefan1983 merged 2 commits into
brucefan1983:masterfrom
BBBuZHIDAO:add_spring_output_bug_fix

Conversation

@BBBuZHIDAO

Copy link
Copy Markdown
Collaborator

Summary (Briefly summarize the purpose of this pull request)

  • Fix bug: the output file of add_spring will be overwritten when there is the same command in the other stage running.
  • Add feature: add a restart file for add_spring to store the ghost atoms' state and a keyword continue for using the ghost atoms of the last run in one run.in.
  • Note: The restart file is not intended to resume a GPUMD run, but rather to ensure that the ghost atoms in the same run.in file can be not updated with each run.

Modification (Describe the main changes made in this pull request)

Add some variables and functions in add_spring.cuh and add_spring.cu for output files and restart files.

Licensing (Please read and confirm before submitting this pull request)

By submitting this pull request, I agree that my contribution will be included in GPUMD and redistributed under the existing GPUMD license. Newly added source files follow the existing GPUMD license-header style when applicable. No external source code with incompatible licensing has been copied into this pull request.

Validation (Describe how this pull request was tested)

Validated by -DDEBUG flag.

Others

None.

@BBBuZHIDAO

Copy link
Copy Markdown
Collaborator Author

Usage

Spring-force output files are now written as:

spring_r<run_id>_c<call_id>.out

where run_id is the zero-based index of the run command and call_id is the zero-based index of the add_spring command within that run. This prevents outputs from different runs from overwriting each other.

For ghost_com and ghost_atom, the ghost state is automatically saved at the end of each run to:

spring_r<run_id>_c<call_id>.restart

The ghost state can be continued in the immediately following run with:

continue <previous_call>

For example:

add_spring ghost_com 0 2 0.00005 0 0 decouple 10 0 0 0 0 0
run 100000

add_spring ghost_com 0 2 0.00005 0 0 decouple 10 0 0 0 0 0 continue 0
run 100000

Here, continue 0 restores the ghost state of call 0 from the previous run. The continued spring must use the same ghost mode, group method, group ID, and group size. Other loading parameters such as velocity and spring constants may be changed. com_com does not support continue.

@brucefan1983
brucefan1983 marked this pull request as ready for review August 22, 2026 16:05
@brucefan1983
brucefan1983 merged commit 3422333 into brucefan1983:master Aug 22, 2026
2 of 3 checks passed
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.

2 participants