Hello All
Can anyone please help me on how to restart MD simulation using python script, if it get killed in between due to power cut. The script i am using is named as md.sh and the command that i used to start MD is:
chmod +x md.sh
./md.sh
What you are showing is the execution of a shell script, which presumably contains an actual GROMACS command within; that would be the relevant information to look at. mdrun
can resume a previously stopped run by loading a checkpoint file. Just add -cpi -append
to whatever your previous command was. No Python required.
Actually sir… the script I am using, is for generating replicas… So, can I use -cpi -append along with it…
You need to provide the actual content of your script. You initially asked how to restart a simulation that got stopped. Doing so is trivial by adding the options I indicated to your mdrun
command. If you are running multiple processes or doing something else, you need to be more specific about what you are doing. Right now, we don’t have the necessary details to help you.
The content of my script is as follows:
#!/bin/bash
#################################################
# get_distances.sh
#
# Script iteratively calls gmx distance and
# assembles a series of COM distance values
# indexed by frame number, for use in
# preparing umbrella sampling windows.
#
# Written by: Justin A. Lemkul, Ph.D.
# Contact: jalemkul@vt.edu
#
#################################################
# compute distances
for (( i = 0; i<11; i++ ))
do
gmx grompp -f smd.mdp -c 0308_npt_50.gro -p 0308.top -r 0308_npt_50.gro -n 0308_index.ndx -t 0308_npt_50.cpt -o 0308_5_pull${i}.tpr
gmx mdrun -v -deffnm 0308_5_pull${i} -pf 0308_5_pullf${i}.xvg -px 0308_5_pullx${i}.xvg -nb gpu
done
gmx mdrun -v -s 0308_5_pull0.tpr -cpi 0308_5_pull1.cpt -deffnm 0308_5_pull1 -pf 0308_5_pullf1.xvg -px 0308_5_pullx1.xvg -append -nb gpu
exit
Should i add -cpi -append in this script itself??
Disregard that initial message. I was responding to your claim that you simply had a simulation stop due to a power outage. That statement was inaccurate and therefore my response is not relevant. Please make sure to always accurately and completely describe your problem to save everyone time and confusion.
See which intervals completed and simply start the next one; that is, change the initial value of i
in the for-loop and re-execute the script.
Okk sir… Thank you… I will be more specific about my questions…