Hi is it possible to create a loop for the last step in md simulation such that when one ends the next starts.
gmx mdrun -deffnm md -nb gpu
for md, md1, md2, md3 etc?
Thank you.
Hi is it possible to create a loop for the last step in md simulation such that when one ends the next starts.
gmx mdrun -deffnm md -nb gpu
for md, md1, md2, md3 etc?
Thank you.
Hello,
Yes. Usually if you are running simulations in a Unix environment you can write a simple bash script and prepare a loop to loop over the simulations you want to run. The programming language will depend on your environment and which one do you know.
Hello
Thank you for your response. I use slurm and #!/bin/bash as the first line then I have the other lines used in slurm jobs and I add the module before giving the command gmx mdrun -deffnm md -nb gpu. Please let me know if it’s still possible to do so in a slurm job.
Thank you.
There is no general solution, it largely depends on the names of the files that you are using. For example, if you run md_1 and you have md_1.gro, md_1.xtc, md_1.tpr files etc. (that is, you run with the -deffnm flag and giving the md_1 name), and now you want to run md_2.mdp, md_3.mdp, …, md_10.mdp, then in slurm you could do a simple bash loop like this
#!/bin/bash
#### SLURM STUFF
#
#
#
#### SLURM STUFF
for ((i =2;i<11;i++))
do
j=$((${i}-1))
gmx grompp -f md_${i}.mdp -c md_${j}.gro -r md_${j}.gro -t md_${j}.cpt -p topol.top -n index.ndx -o md_${i}.tpr
gmx mdrun -v -deffnm md_${i}
done
Specifically, here the grompp pre-processing step needs to be fine-tuned by you (pointing to the right topology, the right index if you need it, the right constraint file if you need it etc.) and similarly the mdrun step may need further details depending on the amount of resources you are allocating for the job on the cluster with slurm.
However, this is a sample idea. In the future you may want to write something different and/or process things in a different way. I think - if you are not familiar with bash - that you should take some time to learn the basics of it so that you will have maximum freedom in writing your scripts.
Thank you so much I will try this.
Note that, depending on the CPU and GPU usage, it can be advantageous for throughput to run multiple simulations simultaneously using an MPI build and the mdrun -multidir option.
Hi
Thank you for your response.
The platform that I’m using do not have gromacs with MPI on the GPU. I wanted to only make a loop so that when one ends the other starts just after.