# Hamiltonian REX: different exchange probability with -nb gpu

**URL:** https://gromacs.bioexcel.eu/t/hamiltonian-rex-different-exchange-probability-with-nb-gpu/2688
**Category:** User discussions
**Tags:** mdrun
**Created:** [August 17, 2021, 6:09pm UTC](https://gromacs.bioexcel.eu/t/hamiltonian-rex-different-exchange-probability-with-nb-gpu/2688 "2021-08-17T18:09:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mandarkulkarni](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mandarkulkarni](https://gromacs.bioexcel.eu/u/mandarkulkarni)
#### Post date: [August 17, 2021, 6:09pm UTC](https://gromacs.bioexcel.eu/t/hamiltonian-rex-different-exchange-probability-with-nb-gpu/2688/1 "2021-08-17T18:09:03Z")

</div>

GROMACS version: 2019.4  
GROMACS modification: Yes (PLUMED 2.5.7 patched)

Dear all,  
I am testing the hamiltonian replica exchange for a small RNA tetraloop system (NVT condition, hydrogen mass repartition 4 fs time step). As a part of testing, I am using the same scaled topology for four replicas to check exchange probability. The test run was performed for 400 ps. However, when I use the “-nb gpu” option with mdrun, I get a slightly low exchange rate. The simulations are repeated and the results are consistent.  
Also, replex (250) is set as multiple of nstlist (25) and dynamic load balancing is also off (-dlb no).

Please, can you suggest whether using “-nb gpu” could affect energies and thus exchange probability in general?

mdrun command line:  
mpirun -np 4 gmx\_mpi mdrun -v -deffnm md -plumed plumed.dat -replex 250 -hrex -multidir dir\_0 dir\_1 dir\_2 dir\_3 -dlb no -nb gpu -nsteps 100000 \>& log

**With “-nb gpu”:**  
dir\_0/md.log:Repl average probabilities:  
dir\_0/md.log-Repl 0 1 2 3  
dir\_0/md.log-Repl .96 **.84**.97  
dir\_0/md.log-Repl number of exchanges:  
dir\_0/md.log-Repl 0 1 2 3  
dir\_0/md.log-Repl 190 **172** 192  
dir\_0/md.log-Repl average number of exchanges:  
dir\_0/md.log-Repl 0 1 2 3  
dir\_0/md.log-Repl .95 .86 .96

**without “-nb gpu”:**

…/No\_nb\_gpu/dir\_0/md.log:Repl average probabilities:  
…/No\_nb\_gpu/dir\_0/md.log-Repl 0 1 2 3  
…/No\_nb\_gpu/dir\_0/md.log-Repl .96 **.97**.97  
…/No\_nb\_gpu/dir\_0/md.log-Repl number of exchanges:  
…/No\_nb\_gpu/dir\_0/md.log-Repl 0 1 2 3  
…/No\_nb\_gpu/dir\_0/md.log-Repl 198 **192** 197  
…/No\_nb\_gpu/dir\_0/md.log-Repl average number of exchanges:  
…/No\_nb\_gpu/dir\_0/md.log-Repl 0 1 2 3  
…/No\_nb\_gpu/dir\_0/md.log-Repl .99 .96 .99

---

<div class="post-metadata">

### Author: ![alevilla](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/alevilla/32/439_2.png) [@alevilla](https://gromacs.bioexcel.eu/u/alevilla)
#### Post date: [August 18, 2021, 8:38am UTC](https://gromacs.bioexcel.eu/t/hamiltonian-rex-different-exchange-probability-with-nb-gpu/2688/2 "2021-08-18T08:38:50Z")

</div>

Hi,  
Calculating the nonbonded interaction on gpu or not should not affect the results.  
If you are running on the same machine and GROMACS is compiled accounting for gpu the non-bonded interactions are calculated on GPU with and without explicitly add the option -nb gpu).  
My guess is that the difference you observed are due too not enough sampling.  
Best regards  
Alessandra

---

<div class="post-metadata">

### Author: ![mandarkulkarni](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mandarkulkarni](https://gromacs.bioexcel.eu/u/mandarkulkarni)
#### Post date: [August 19, 2021, 1:22pm UTC](https://gromacs.bioexcel.eu/t/hamiltonian-rex-different-exchange-probability-with-nb-gpu/2688/3 "2021-08-19T13:22:05Z")

</div>

Hi Alessandra,  
Thanks for your reply. I agree that I should observe the same results.  
I observed these results by repeating these tests, so I was a bit worried.  
I will run longer simulations and will post the outcome here.

Thanks,  
Mandar Kulkarni
