# PME tuning/rcoulomb scaling

**URL:** <https://gromacs.bioexcel.eu/t/pme-tuning-rcoulomb-scaling/1840>\
**Category:** User discussions\
**Tags:** mdrun, mdrun-performance\
**Created:** [March 27, 2021, 5:13pm UTC](https://gromacs.bioexcel.eu/t/pme-tuning-rcoulomb-scaling/1840 "2021-03-27T17:13:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertc](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@robertc](https://gromacs.bioexcel.eu/u/robertc)\
**Post date:** [March 27, 2021, 5:13pm UTC](https://gromacs.bioexcel.eu/t/pme-tuning-rcoulomb-scaling/1840/1 "2021-03-27T17:13:23Z")

</div>

GROMACS version: 2019.3  
GROMACS modification: No

I’m running some simulations using rcoulomb = 1.1 nm and coulombtype = PME, and when I start mdrun I get the messages as shown below. This isn’t always exactly the same, however the PME tuning always occurs. Can anyone explain what is happening here, including:

- does the increase in rcoulomb mean that the potential shape has changed?
- what does “xxx M-cycles” mean?

I’ve trawled through the whole GROMACS documentation, and I’ve found some explanations, but they’re not very clear to me.

Is the only option to avoid this tuning, and keep rcoulomb to the specified value to use _mdrun -tunepme no_? Would I get different behaviour if I use _mdrun -tunepme no_ vs letting the PME tuning take place automatically?

Thanks,

Robert

_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_  
_PME tasks will do all aspects on the GPU_  
_starting mdrun ‘POS’_  
_5000 steps, 125.0 ps._  
_step 100: timed with pme grid 48 108 72, coulomb cutoff 1.100: 24.6 M-cycles_  
_step 200: timed with pme grid 44 100 64, coulomb cutoff 1.163: 20.1 M-cycles_  
_step 300: timed with pme grid 36 84 56, coulomb cutoff 1.381: 19.6 M-cycles_  
_step 400: timed with pme grid 32 80 48, coulomb cutoff 1.554: 19.7 M-cycles_  
_step 500: timed with pme grid 28 72 42, coulomb cutoff 1.776: 19.5 M-cycles_  
_step 500: the maximum allowed grid scaling limits the PME load balancing to a coulomb cut-off of 1.812_  
_step 600: timed with pme grid 28 64 42, coulomb cutoff 1.812: 19.6 M-cycles_  
_step 700: timed with pme grid 28 72 42, coulomb cutoff 1.776: 25.4 M-cycles_  
_step 800: timed with pme grid 32 72 44, coulomb cutoff 1.691: 19.5 M-cycles_  
_step 900: timed with pme grid 32 72 48, coulomb cutoff 1.611: 24.7 M-cycles_  
_step 1000: timed with pme grid 32 80 48, coulomb cutoff 1.554: 19.2 M-cycles_  
_step 1100: timed with pme grid 36 80 52, coulomb cutoff 1.450: 23.4 M-cycles_  
_step 1200: timed with pme grid 36 84 52, coulomb cutoff 1.431: 22.1 M-cycles_  
_step 1300: timed with pme grid 36 84 56, coulomb cutoff 1.381: 20.1 M-cycles_  
_step 1400: timed with pme grid 40 96 56, coulomb cutoff 1.329: 19.5 M-cycles_  
_step 1500: timed with pme grid 40 96 60, coulomb cutoff 1.243: 19.9 M-cycles_  
_step 1600: timed with pme grid 42 96 64, coulomb cutoff 1.208: 19.7 M-cycles_  
_step 1700: timed with pme grid 42 100 64, coulomb cutoff 1.184: 19.7 M-cycles_  
_step 1800: timed with pme grid 44 100 64, coulomb cutoff 1.163: 20.4 M-cycles_  
_step 1900: timed with pme grid 44 104 72, coulomb cutoff 1.130: 22.0 M-cycles_  
_step 2000: timed with pme grid 48 104 72, coulomb cutoff 1.115: 22.7 M-cycles_  
_step 2100: timed with pme grid 28 64 42, coulomb cutoff 1.812: 21.8 M-cycles_  
_step 2200: timed with pme grid 28 72 42, coulomb cutoff 1.776: 21.5 M-cycles_  
_step 2300: timed with pme grid 32 72 44, coulomb cutoff 1.691: 22.0 M-cycles_  
_step 2400: timed with pme grid 32 80 48, coulomb cutoff 1.554: 20.8 M-cycles_  
_step 2500: timed with pme grid 36 84 56, coulomb cutoff 1.381: 20.2 M-cycles_  
_step 2600: timed with pme grid 40 96 56, coulomb cutoff 1.329: 20.3 M-cycles_  
_step 2700: timed with pme grid 40 96 60, coulomb cutoff 1.243: 21.8 M-cycles_  
_step 2800: timed with pme grid 42 96 64, coulomb cutoff 1.208: 21.1 M-cycles_  
_step 2900: timed with pme grid 42 100 64, coulomb cutoff 1.184: 21.7 M-cycles_  
_step 3000: timed with pme grid 44 100 64, coulomb cutoff 1.163: 21.1 M-cycles_  
_optimal pme grid 32 80 48, coulomb cutoff 1.554_

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [March 28, 2021, 4:18pm UTC](https://gromacs.bioexcel.eu/t/pme-tuning-rcoulomb-scaling/1840/2 "2021-03-28T16:18:21Z")

</div>

Hello,

the messages show Gromacs’ attempt to optimize the PME parameters for the PME calculation to run as fast as possible for the current system.

> [@robertc](#):
>
> \* does the increase in rcoulomb mean that the potential shape has changed?

No, the electrostatics are calculated completely up to the cutoff and the PME method will calculate the complete full-range potential starting from it so the interaction is the same (within an error margin).

> [@robertc](#):
>
> \* what does “xxx M-cycles” mean?

It’s a measure of how expensive the tested settings were. The optimization tries different grids and cutoffs with the intent to minimize this value. Once the optimized settings are found the simulation will use them for the rest of the simulation.

> [@robertc](#):
>
> Is the only option to avoid this tuning, and keep rcoulomb to the specified value to use _mdrun -tunepme no_ ? Would I get different behaviour if I use _mdrun -tunepme no_ vs letting the PME tuning take place automatically?

Using `-notunepme` is, as far as I know, the only way to turn it off. Since the PME settings are not optimized the simulation will likely run slower than it would otherwise. You can run a benchmark over ~20,000 steps with and without `-notunepme` and see whether this makes a big difference for you (just remember to only measure the time after the optimization is complete – you can set this point with `-resetstep` or `-resethway`, which starts the measurement at the halfpoint, so at 10,000 for a 20,000 step simulation).

Regards,  
Petter

---

<div class="post-metadata">

**Author:** ![robertc](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@robertc](https://gromacs.bioexcel.eu/u/robertc)\
**Post date:** [March 29, 2021, 7:28am UTC](https://gromacs.bioexcel.eu/t/pme-tuning-rcoulomb-scaling/1840/3 "2021-03-29T07:28:44Z")

</div>

Many thanks for your reply Petter, much appreciated.

Best regards,

Robert
