max. Group

HI users,
I am using more than 32 groups in my input file resulting in error.

so i change MAX_GROUP 32 to some 100. its working… but results are not expected.

DO i need to change else where.


This has been discussed on the mailing list many times. Changing the maximum number of allowed groups would require much more significant changes to the code.

What is it you're trying to do?

Thanks for the help,

If you dont mind can you please send one of the mail where its discussed well.

Thanks a lot


There's a search function that you can use to look through the mailing list archive ( If you just search for something like "how can I have more than 32 groups?" you'll probably just find lots of e-mails giving the same answer that I just did.

There's often a way around such problems though. If you can describe what it is you're trying to do, other people on this list can make suggestions about how you might achieve it.

Afterthought: the reason is that LAMMPS using bitmasks to keep track of the group ID. You can have a look at group.cpp if you want to see more about how this process works.

Afterthought: the reason is that LAMMPS using bitmasks to keep track of the

yup, and that is the reason, why it is such a pain to change this. you
could change the code to use a "bigint" instead of a regular (32-bit)
int, but that would only bump the number of groups to 64. for more
you'd need a different mechanism. however, those (e.g. a hash table)
would come at a significant performance cost and the need to change
code in many, many parts of LAMMPS.