I’m trying to run a simulation of n copies of a protein with two rigid bodies. I noticed that when I use a high n (90, so 180 groups) the scripts stops running as I define the two groups (as group RB1 id xx:yy ww:zz…). I know the error comes from there because deleting a bunch of the xx:yy makes the input script working, but I’m not getting any log message/error message, the system just produces a blank input and doesn’t run.
Any ideas on what’s the actual problem or how to fix it?
You could begin by sharing a working example of your script, and even better if you remove all unnecessary commands to make it as easy as possible to read and understand.
What do you use the groups for? There is probably a different way to the same thing without using groups.
The number of groups is limited to 32. https://docs.lammps.org/group.html
Hi! I cannot upload the script, and it’s too big to paste it, so I removed all the charges, bonds and pair info for the example
This is now a non-working script, but removing just a bunch of elements (i.e. the following string “28678:28727 29038:29087 29398:29447 29758:29807 30118:30167 30478:30527 30838:30887 31198:31247 31558:31607 31918:31967 32278:32327”) makes it run
I’m defining only 3 groups (+ all which I use to define a group so not sure if that counts as 1). The problem comes from the number of elements inside the group, for which I couldn’t find any information about the limit.
As I said, putting less atoms in the group makes the script run again.
What is your LAMMMPS version and what platform are you running on?
There is no problem for me to run your input with the current development version (after replacing the read_restart command with some commands to create a box and a sufficient number of atoms).
I don’t understand your fix rigid commands. You are using both groups and molecule IDs to define rigid bodies. That is redundant and a single fix rigid command should do, either based on the group or the molecule IDs, and is much more efficient since fix rigid requires collective operations.
If based on molecule ID, you may want to use fix rigid/small instead. Please see the documentation for fix rigid for a detailed discussion.
I’m running 29Sept2021, with Intel-MPI. I will try with the new developmental versions.
Regarding the groups, I use them to easily define the non-rigid, on which I run the nve (and an NVT on the rigid bodies). I will look up fix rigid and try to come up with a more elegant solution.
You can always upload your files to some website (Dropbox, Google Drive, MS One Drive, etc.) and provide a link.
Please also note that inputs using restart files are difficult to test/debug since restarts are platform and version specific because they are binary files.
Try to not use I/O redirection but the “-in” flag to read your input.
The support for I/O redirection is a legacy feature inherited from the time when LAMMPS was written in Fortran (which at that time didn’t have a portable way of determining command line flags). It should have been removed a long time ago, since it needlessly complicates the code and causes all kinds of problems. Particularly with MPI this is rather nasty because the MPI library needs to replicate the stdin stream to all MPI ranks, which may sometimes be limited by buffer sizes. When reading from a file, there is no such issue since the file will be opened and read on every MPI rank locally.
You also may be suffering from a case of “premature optimization”, have you verified that recursive bisectioning and multi-cutoff neighboring (how different are your cutoffs?) and communication are actually beneficial. It is particularly strange to see those in combination with using fix rigid multiple times, which does print a warning in that case because it does affect parallelization negatively.
It was exactly that! Running it with the -in instead works. I assume it overloads the system because of what you mention. Good to know because I just recently moved to Lammps from NAMD, and I didn’t know it was a legacy way of writing.
One simple way to create groups based on indices could be to use gromacs-style index files: group2ndx command — LAMMPS documentation
This feature was originally conceived for use with the colvars library but is generic.