Limit number of energy groups

GROMACS version:2023-rc1
GROMACS modification: Yes
Hi,
I am rerun a simulations and I’d like to calculate the all pairwise energy interaction between all residues, e.g. 299. I have created the index accordingly but the calculations fails with:

With NxN kernels not more than 64 energy groups are supported

It runs finely using up to 63. Is this a limit or am I doing something wrong? I am using 10 cpus:

gmx mdrun -ntmpi 1 -pin on -v -ntomp 10 -deffnm rerun -rerun sim_production.xtc -nb cpu

thanks all

This is a limit. With 64 groups you already get 64^2=4096 terms in the output, which is a lot. Because of technical reasons, the code internally uses a buffer of the size ng^3 * 32. This quickly gets to too large to fit in cache. We could lower the buffer size of ng^2, but that would lead to worse performance when using only a handful of energy groups. The reason we don’t optimize for many groups is that potential energies (enthalpies) are almost never useful, as the entropy is usually equally important. In addition, there is no decomposition of the long-range PME grid term.

1 Like

Hi @hess
thanks for the explanation. I could not find the reason of that. Actually my purpose is to evaluate as a matrix the potential energy of all residues of a protein (large 299 aa) to be exploited in a ML approach. Do you have suggestion how to perform that task? I can do step-by-step, i.e. splitting in 64 aa groups (1-64, 65-127 and so on). However, I will miss the the energy between the groups, i.e. 1 with 65, 1 with 66 and so on. I can script an interactive procedure but wondering whether there is a smart to do. I find this approach Welcome to gRINN’s documentation! — gRINN 1.1.0.hf1 documentation which could be useful.
Thanks againg

But as I said, the potential energy between groups is not very meaningful, as effective interactions are governed by the free energy, and not the enthalpy. And the PME mesh contributions is not decomposed.