GMX-TUNE_PME(1)
๐ GMX-TUNE_PME ๐
okay bestie, welcome to gmx-tune_pme from the GROMACS manual (section 1, iykyk). this is the little tool that figures out how many PME ranks you should be running, and honestly? it's giving personal trainer for your mdrun. let's get into it ๐ฆ
โจ NAME โจ
gmx-tune_pme โ time mdrun as a function of PME ranks to optimize settings ๐
๐ธ SYNOPSIS ๐ธ
gmx tune_pme [-s [<.tpr>]] [-cpi [<.cpt>]] [-table [<.xvg>]]
[-tablep [<.xvg>]] [-tableb [<.xvg>]]
[-rerun [<.xtc/.trr/...>]] [-ei [<.edi>]] [-p [<.out>]]
[-err [<.log>]] [-so [<.tpr>]] [-o [<.trr/.cpt/...>]]
[-x [<.xtc/.tng>]] [-cpo [<.cpt>]]
[-c [<.gro/.g96/...>]] [-e [<.edr>]] [-g [<.log>]]
[-dhdl [<.xvg>]] [-field [<.xvg>]] [-tpi [<.xvg>]]
[-tpid [<.xvg>]] [-eo [<.xvg>]] [-px [<.xvg>]]
[-pf [<.xvg>]] [-ro [<.xvg>]] [-ra [<.log>]]
[-rs [<.log>]] [-rt [<.log>]] [-mtx [<.mtx>]]
[-swap [<.xvg>]] [-bo [<.trr/.cpt/...>]] [-bx [<.xtc>]]
[-bcpo [<.cpt>]] [-bc [<.gro/.g96/...>]] [-be [<.edr>]]
[-bg [<.log>]] [-beo [<.xvg>]] [-bdhdl [<.xvg>]]
[-bfield [<.xvg>]] [-btpi [<.xvg>]] [-btpid [<.xvg>]]
[-bdevout [<.xvg>]] [-brunav [<.xvg>]] [-bpx [<.xvg>]]
[-bpf [<.xvg>]] [-bro [<.xvg>]] [-bra [<.log>]]
[-brs [<.log>]] [-brt [<.log>]] [-bmtx [<.mtx>]]
[-bdn [<.ndx>]] [-bswap [<.xvg>]] [-xvg <enum>]
[-mdrun <string>] [-np <int>] [-npstring <enum>]
[-ntmpi <int>] [-r <int>] [-max <real>] [-min <real>]
[-npme <enum>] [-fix <int>] [-rmax <real>]
[-rmin <real>] [-[no]scalevdw] [-ntpr <int>]
[-steps <int>] [-resetstep <int>] [-nsteps <int>]
[-[no]launch] [-[no]bench] [-[no]check]
[-gpu_id <string>] [-[no]append] [-[no]cpnum]
[-deffnm <string>]
๐ DESCRIPTION ๐
so here's the vibe: for a given number -np or -ntmpi of ranks, gmx tune_pme systematically times gmx mdrun with various numbers of PME-only ranks and determines which setting is fastest. iconic behavior honestly โจ it will also test whether performance can be enhanced by shifting load from the reciprocal to the real space part of the Ewald sum. basically you just pass your .tpr file to gmx tune_pme together with other options for gmx mdrun as needed. that's it, that's the whole assignment ๐ซถ
okay but gmx tune_pme needs to call gmx mdrun, so you gotta tell it how to do that with the argument to the -mdrun parameter. depending how you have built GROMACS, values such as 'gmx mdrun', 'gmx_d mdrun', or 'gmx_mpi mdrun' might be needed. choose wisely bestie ๐
the program that runs MPI programs can be set in the environment variable MPIRUN (defaults to 'mpirun'). โ ๏ธ note that for certain MPI frameworks, you need to provide a machine- or hostfile. this can also be passed via the MPIRUN variable, e.g.
export MPIRUN="/usr/local/mpirun -machinefile hosts"
note that in such cases it is normally necessary to compile and/or run gmx tune_pme without MPI support, so that it can call the MPIRUN program. lowkey important, don't skip this part ๐ธ
before doing the actual benchmark runs, gmx tune_pme will do a quick check whether gmx mdrun works as expected with the provided parallel settings โ but only if the -check option is activated (and it is the default, so like, it's on unless you turn it off ๐). please call gmx tune_pme with the normal options you would pass to gmx mdrun and add -np for the number of ranks to perform the tests on, or -ntmpi for the number of threads. you can also add -r to repeat each test several times to get better statistics fr fr ๐
gmx tune_pme can test various real space / reciprocal space workloads for you ๐ with -ntpr you control how many extra .tpr files will be written with enlarged cutoffs and smaller Fourier grids respectively. typically, the first test (number 0) will be with the settings from the input .tpr file; the last test (number ntpr) will have the Coulomb cutoff specified by -rmax with a somewhat smaller PME grid at the same time. in this last test, the Fourier spacing is multiplied with rmax/rcoulomb. the remaining .tpr files will have equally-spaced Coulomb radii (and Fourier spacings) between these extremes. ๐
๐ก note that you can set-ntprto1if you just seek the optimal number of PME-only ranks; in that case your input.tprfile will remain unchanged. no cap.
for the benchmark runs, the default of 1000 time steps should suffice for most MD systems. the dynamic load balancing needs about 100 time steps to adapt to local load imbalances, therefore the time step counters are by default reset after 100 steps. for large systems (>1M atoms), as well as for a higher accuracy of the measurements, you should set -resetstep to a higher value. ๐ from the 'DD' load imbalance entries in the md.log output file you can tell after how many steps the load is sufficiently balanced. example call, bestie:
gmx tune_pme -np 64 -s protein.tpr -launch
after calling gmx mdrun several times, detailed performance information is available in the output file perf.out โจ note that during the benchmarks, a couple of temporary files are written (options -b*), these will be automatically deleted after each test. so don't get attached ๐ฅฒ
if you want the simulation to be started automatically with the optimized parameters, use the command line option -launch. ๐
basic support for GPU-enabled mdrun exists. ๐ฎ give a string containing the IDs of the GPUs that you wish to use in the optimization in the -gpu_id command-line argument. this works exactly like mdrun -gpu_id, does not imply a mapping, and merely declares the eligible set of GPU devices. gmx-tune_pme will construct calls to mdrun that use this set appropriately. gmx-tune_pme does not support -gputasks. ๐
โจ OPTIONS โจ
okay bestie, here's the full tea on every single flag. buckle up ๐
๐ฅ input files, the "what am I even looking at" pile
-s [<.tpr>] (topol.tpr)โ the portable xdr run input file, aka your whole simulation setup in one tidy little binary ๐-cpi [<.cpt>] (state.cpt)(optional) โ a checkpoint file, for when you're continuing instead of starting fresh-table [<.xvg>] (table.xvg)(optional) โ an xvgr/xmgr file ๐-tablep [<.xvg>] (tablep.xvg)(optional) โ another xvgr/xmgr file ๐-tableb [<.xvg>] (table.xvg)(optional) โ yep, also an xvgr/xmgr file ๐ธ-rerun [<.xtc/.trr/...>] (rerun.xtc)(optional) โ trajectory vibes, and it takes a whole rainbow of them: xtc trr cpt gro g96 pdb tng h5md ๐ฆ-ei [<.edi>] (sam.edi)(optional) โ ED sampling input, for the essential-dynamics girlies โจ
๐ค output files, the "where does it all go" pile
-p [<.out>] (perf.out)โ a generic output file, no cap-err [<.log>] (bencherr.log)โ log file, catching the errors so you don't have to ๐ญ-so [<.tpr>] (tuned.tpr)โ a portable xdr run input file โ this is the tuned one, the glow-up version ๐-o [<.trr/.cpt/...>] (traj.trr)โ full precision trajectory: trr cpt tng h5md ๐ฅ-x [<.xtc/.tng>] (traj_comp.xtc)(optional) โ compressed trajectory (tng format or portable xdr format), lil file big energy-cpo [<.cpt>] (state.cpt)(optional) โ checkpoint file-c [<.gro/.g96/...>] (confout.gro)โ structure file: gro g96 pdb brk ent esp-e [<.edr>] (ener.edr)โ energy file โก-g [<.log>] (md.log)โ log file-dhdl [<.xvg>] (dhdl.xvg)(optional) โ xvgr/xmgr file-field [<.xvg>] (field.xvg)(optional) โ xvgr/xmgr file-tpi [<.xvg>] (tpi.xvg)(optional) โ xvgr/xmgr file-tpid [<.xvg>] (tpidist.xvg)(optional) โ xvgr/xmgr file-eo [<.xvg>] (edsam.xvg)(optional) โ xvgr/xmgr file-px [<.xvg>] (pullx.xvg)(optional) โ xvgr/xmgr file-pf [<.xvg>] (pullf.xvg)(optional) โ xvgr/xmgr file-ro [<.xvg>] (rotation.xvg)(optional) โ xvgr/xmgr file-ra [<.log>] (rotangles.log)(optional) โ log file-rs [<.log>] (rotslabs.log)(optional) โ log file-rt [<.log>] (rottorque.log)(optional) โ log file-mtx [<.mtx>] (nm.mtx)(optional) โ Hessian matrix, fancy-swap [<.xvg>] (swapions.xvg)(optional) โ xvgr/xmgr file-bo [<.trr/.cpt/...>] (bench.trr)โ full precision benchmark trajectory: trr cpt tng h5md-bx [<.xtc>] (bench.xtc)โ compressed benchmark trajectory (portable xdr format): xtc-bcpo [<.cpt>] (bench.cpt)โ benchmark checkpoint file-bc [<.gro/.g96/...>] (bench.gro)โ benchmark structure file: gro g96 pdb brk ent esp-be [<.edr>] (bench.edr)โ benchmark energy file โก-bg [<.log>] (bench.log)โ benchmark log file-beo [<.xvg>] (benchedo.xvg)(optional) โ xvgr/xmgr file-bdhdl [<.xvg>] (benchdhdl.xvg)(optional) โ xvgr/xmgr file-bfield [<.xvg>] (benchfld.xvg)(optional) โ xvgr/xmgr file-btpi [<.xvg>] (benchtpi.xvg)(optional) โ xvgr/xmgr file-btpid [<.xvg>] (benchtpid.xvg)(optional) โ xvgr/xmgr file-bdevout [<.xvg>] (benchdev.xvg)(optional) โ xvgr/xmgr file-brunav [<.xvg>] (benchrnav.xvg)(optional) โ xvgr/xmgr file-bpx [<.xvg>] (benchpx.xvg)(optional) โ xvgr/xmgr file-bpf [<.xvg>] (benchpf.xvg)(optional) โ xvgr/xmgr file-bro [<.xvg>] (benchrot.xvg)(optional) โ xvgr/xmgr file-bra [<.log>] (benchrota.log)(optional) โ log file-brs [<.log>] (benchrots.log)(optional) โ log file-brt [<.log>] (benchrott.log)(optional) โ log file-bmtx [<.mtx>] (benchn.mtx)(optional) โ Hessian matrix-bdn [<.ndx>] (bench.ndx)(optional) โ index file-bswap [<.xvg>] (benchswp.xvg)(optional) โ xvgr/xmgr file
yes bestie that was a LOT of files. you ate that. ๐
๐๏ธ other options (the actually-interesting part, fr fr)
-xvg <enum> (xmgrace)โ how to format the xvg plots, your options are:xmgrace,xmgr,noneโจ-mdrun <string>โ the command line used to run a simulation, like'gmx mdrun'or'gmx_mpi mdrun'๐-np <int> (1)โ number of ranks to run the tests on. heads up: it must be> 2if you want separate PME ranks ๐ซถ-npstring <enum> (np)โ the name of the$MPIRUNoption that specifies how many ranks to use. your choices:'np', or'n'; use'none'if there's no such option. so the enum is:np,n,none-ntmpi <int> (1)โ number of MPI-threads to run the tests on โ note this turns MPI & mpirun off ๐-r <int> (2)โ repeat each test this many times ๐-max <real> (0.5)โ max fraction of PME ranks to test with-min <real> (0.25)โ min fraction of PME ranks to test with-npme <enum> (auto)โ within-minand-max, benchmark all possible values for-npme, or just a reasonable subset.autoneglects-minand-maxand just picks reasonable values around a guess for npme derived from the.tpr. your options:auto,all,subset-fix <int> (-2)โ if it's>= -1, don't vary the number of PME-only ranks at all โ just use this fixed value and only vary rcoulomb and the PME grid spacing ๐-rmax <real> (0)โ if>0, the maximal rcoulomb for-ntpr>1(rcoulomb upscaling results in fourier grid downscaling)-rmin <real> (0)โ if>0, the minimal rcoulomb for-ntpr>1-[no]scalevdw (yes)โ scale rvdw along with rcoulomb ๐ธ-ntpr <int> (0)โ number of.tprfiles to benchmark. create this many files with different rcoulomb scaling factors depending on-rminand-rmax. if< 1, it automatically chooses how many.tprfiles to test ๐ฆ-steps <int> (1000)โ take timings for this many steps in the benchmark runs-resetstep <int> (1500)โ let dlb equilibrate this many steps before timings are taken (reset cycle counters after this many steps)-nsteps <int> (-1)โ if non-negative, perform this many steps in the real run. overwritesnstepsfrom the.tpr, and add.cptsteps-[no]launch (no)โ launch the real simulation after optimization ๐-[no]bench (yes)โ run the benchmarks, or just create the input.tprfiles and dip?-[no]check (yes)โ before the benchmark runs, check whether mdrun works in parallel-gpu_id <string>โ list of unique GPU device IDs that are eligible for use ๐-[no]append (yes)โ append to previous output files when continuing from checkpoint instead of adding the simulation part number to all file names (launch only bestie, don't forget)-[no]cpnum (no)โ keep and number checkpoint files (launch only)-deffnm <string>โ set the default filenames (launch only) ๐
๐ SEE ALSO ๐
more info about GROMACS is available at <http://www.gromacs.org/> โ go look, it's giving resources โจ
๐ COPYRIGHT ๐
2026, GROMACS development team ๐
okay that's the whole page bestie, you're officially a tune_pme expert, no cap ๐ซถ this was GROMACS 2026.4, dated Oct 02, 2026 (the manual page for GMX-TUNE_PME(1)) โ now go optimize something and slay ๐
โจ
๐ฆ where this page comes from
- nixpkgs unstable: gromacs 2026.4
- ubuntu stonking: gromacs-data 2026.4-1ubuntu1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms