# Running Gromacs in GPU vs CPU

**URL:** <https://gromacs.bioexcel.eu/t/running-gromacs-in-gpu-vs-cpu/3230>\
**Category:** User discussions\
**Tags:** mdp-parameters, mdrun, gpu\
**Created:** [December 1, 2021, 7:56am UTC](https://gromacs.bioexcel.eu/t/running-gromacs-in-gpu-vs-cpu/3230 "2021-12-01T07:56:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shantanu](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@Shantanu](https://gromacs.bioexcel.eu/u/Shantanu)\
**Post date:** [December 1, 2021, 7:56am UTC](https://gromacs.bioexcel.eu/t/running-gromacs-in-gpu-vs-cpu/3230/1 "2021-12-01T07:56:10Z")

</div>

GROMACS version:2020.6  
GROMACS modification: No

1.Why changes in rlist happen when I run the same thing in a GPU vs CPU?  
2.I have set the r-list and nst-list value in the parameters files , yet why they change. And do these changes has any impact on the results?

1. GPU

gmx mdrun -deffnm complex\_nvt -v -nt 64

Reading file complex\_nvt.tpr, VERSION 2020.2-dev-20200430-5e78835-unknown (single precision)  
Changing nstlist from 5 to 100, rlist from 1.2 to 1.346

1 GPU selected for this run.  
Mapping of GPU IDs to the 2 GPU tasks in the 1 rank on this node:  
PP:0,PME:0  
PP tasks will do (non-perturbed) short-ranged interactions on the GPU  
PP task will update and constrain coordinates on the CPU  
PME tasks will do all aspects on the GPU  
Using 1 MPI thread

Non-default thread affinity set, disabling internal thread affinity

Using 64 OpenMP threads

1. CPU

gmx mdrun -deffnm complex\_nvt -v

Reading file complex\_nvt.tpr, VERSION 2020.6 (single precision)  
Changing nstlist from 5 to 80, rlist from 1.2 to 1.322

Using 1 MPI thread

Non-default thread affinity set, disabling internal thread affinity

Using 12 OpenMP threads

These are my parameters- nvt-  
vi nvt

title = NVT  
define = -DPOSRES ; position restrain the protein  
; Run parameters  
integrator = md ; leap-frog integrator  
nsteps = 500000 ; 2 \* 500000 = 1 ns  
dt = 0.002 ; 2 fs  
; Output control  
nstxout = 100 ; save coordinates every 0.2 ps  
nstvout = 100 ; save velocities every 0.2 ps  
nstenergy = 100 ; save energies every 0.2 ps  
nstlog = 100 ; update log file every 0.2 ps  
; Bond parameters  
continuation = no ; first dynamics run  
constraint\_algorithm = lincs ; holonomic constraints  
constraints = h-bonds ; bonds involving H are constrained  
lincs\_iter = 1 ; accuracy of LINCS  
lincs\_order = 4 ; also related to accuracy  
; Neighborsearching  
ns\_type = grid ; search neighboring grid cels  
nstlist = 5 ; 10 fs  
rlist = 1.2 ; short-range neighborlist cutoff (in nm)  
rcoulomb = 1.2 ; short-range electrostatic cutoff (in nm)  
rvdw = 1.2 ; short-range van der Waals cutoff (in nm)  
cutoff-scheme = Verlet  
; Electrostatics  
coulombtype = PME ; Particle Mesh Ewald for long-range electrostatics  
pme\_order = 4 ; cubic interpolation  
fourierspacing = 0.16 ; grid spacing for FFT  
; Temperature coupling is on  
tcoupl = V-rescale ; modified Berendsen thermostat  
tc-grps = ATG4B LC3B SOL\_NA ; two coupling groups - more accurate  
tau\_t = 0.1 0.1 0.1 ; time constant, in ps  
ref\_t = 310 310 310 ; reference temperature, one for each group, in K  
; Pressure coupling is off  
pcoupl = no ; no pressure coupling in NVT  
; Periodic boundary conditions  
pbc = xyz ; 3-D PBC  
; Dispersion correction  
DispCorr = EnerPres ; account for cut-off vdW scheme  
; Velocity generation  
gen\_vel = yes ; assign velocities from Maxwell distribution  
gen\_temp = 310 ; temperature for Maxwell distribution  
gen\_seed = -1 ; generate a random seed  
; COM motion removal  
; These options remove motion of the protein/bilayer relative to the solvent/ions  
nstcomm = 1  
comm-mode = Linear  
comm-grps = ATG4B LC3B SOL\_NA

I am new to gromacs and would really appreciate the help.  
Thank You in advance!

---

<div class="post-metadata">

**Author:** ![Masrul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/masrul/32/234_2.png) [@Masrul](https://gromacs.bioexcel.eu/u/Masrul)\
**Post date:** [December 3, 2021, 6:06am UTC](https://gromacs.bioexcel.eu/t/running-gromacs-in-gpu-vs-cpu/3230/2 "2021-12-03T06:06:40Z")

</div>

nst-list determines after how many steps neighborlist gets updated, r-list is how far neighbors are looked for. So, for maintaining accuracy, when one is decreased, other has to be increased. Neighborlist update is expensive due to cpu-gpu communication, that’s why gromacs adjust nst-list/r-list for optimal performance.
