I want to run a simulation with two repulsive walls to keep the system finite in z while having non-periodic boundary conditions in that dimension.
Everything works fine except when offloading bonding interactions to the GPU.
I think the reason behind the problem is related to the energy groups that are created automatically. The Gromacs manual says: Energy groups wall0 and wall1 (for nwall =2) are added automatically to monitor the interaction of energy groups with each wall
However, this seems to be incompatible with running bonded interactions on the GPU, as I get the following error: Bonded interactions can not be computed on a GPU: Cannot run with multiple energy groups
Is there any way to switch off the energy groups? I am not interested in monitoring the interactions of the walls (which seems to be the purpose of generating the energy groups according to the indications of the manual), I just want the walls to have the confining effect.
Not offloading the bonded interactions to the GPU should not have a major performance impact. But this check is too restrictive. You should be able to run bondeds on the GPU with this one line change:
diff --git a/src/gromacs/listed_forces/listed_forces_gpu_impl.cpp b/src/gromacs/listed_forces/listed_forces_gpu_impl.cpp
index a7ff7c773e..fdcd4eab8d 100644
--- a/src/gromacs/listed_forces/listed_forces_gpu_impl.cpp
+++ b/src/gromacs/listed_forces/listed_forces_gpu_impl.cpp
@@ -122,7 +122,7 @@ bool inputSupportsListedForcesGpu(const t_inputrec& ir, const gmx_mtop_t& mtop,
"a dynamical integrator (md, sd, etc).");
errorReasons.appendIf(EI_MIMIC(ir.eI), "MiMiC");
errorReasons.appendIf(ir.useMts, "Cannot run with multiple time stepping");
- errorReasons.appendIf((ir.opts.ngener > 1), "Cannot run with multiple energy groups");
+ errorReasons.appendIf((ir.opts.ngener - ir.nwall > 1), "Cannot run with multiple energy groups");
errorReasons.finishContext();
if (error != nullptr)
I uploaded an MR for the 2024 release. But then I realized that an assertion fails. You can comment out this assertion to make it run. I need to find a clean fix for the MR.