Simplify make_pairlist() call signature
[alexxy/gromacs.git] / src / gromacs / nbnxm / pairlist_tuning.cpp
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
8  *
9  * GROMACS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  *
14  * GROMACS is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with GROMACS; if not, see
21  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23  *
24  * If you want to redistribute modifications to GROMACS, please
25  * consider that scientific software is very special. Version
26  * control is crucial - bugs must be traceable. We will be happy to
27  * consider code for inclusion in the official distribution, but
28  * derived work must not be called official GROMACS. Details are found
29  * in the README & COPYING files - if they are missing, get the
30  * official version at http://www.gromacs.org.
31  *
32  * To help us fund GROMACS development, we humbly ask that you cite
33  * the research papers on the package. Check out http://www.gromacs.org.
34  */
35
36 /*! \internal \file
37  *
38  * \brief Implements functions for tuning adjustable parameters for the nbnxn non-bonded search and interaction kernels
39  *
40  * \author Berk Hess <hess@kth.se>
41  * \ingroup __module_nb_verlet
42  */
43
44 #include "gmxpre.h"
45
46 #include "pairlist_tuning.h"
47
48 #include <cassert>
49 #include <cmath>
50 #include <cstdlib>
51
52 #include <algorithm>
53 #include <string>
54
55 #include "gromacs/domdec/domdec.h"
56 #include "gromacs/hardware/cpuinfo.h"
57 #include "gromacs/math/vec.h"
58 #include "gromacs/mdlib/calc_verletbuf.h"
59 #include "gromacs/mdtypes/commrec.h"
60 #include "gromacs/mdtypes/inputrec.h"
61 #include "gromacs/mdtypes/interaction_const.h"
62 #include "gromacs/mdtypes/state.h"
63 #include "gromacs/nbnxm/nbnxm.h"
64 #include "gromacs/nbnxm/nbnxm_geometry.h"
65 #include "gromacs/pbcutil/pbc.h"
66 #include "gromacs/topology/topology.h"
67 #include "gromacs/utility/cstringutil.h"
68 #include "gromacs/utility/fatalerror.h"
69 #include "gromacs/utility/gmxassert.h"
70 #include "gromacs/utility/logger.h"
71 #include "gromacs/utility/strconvert.h"
72 #include "gromacs/utility/stringutil.h"
73
74 /*! \brief Returns if we can (heuristically) change nstlist and rlist
75  *
76  * \param [in] ir  The input parameter record
77  */
78 static bool supportsDynamicPairlistGenerationInterval(const t_inputrec &ir)
79 {
80     return
81         ir.cutoff_scheme == ecutsVERLET &&
82         EI_DYNAMICS(ir.eI) &&
83         !(EI_MD(ir.eI) && ir.etc == etcNO) &&
84         ir.verletbuf_tol > 0;
85 }
86
87 /*! \brief Cost of non-bonded kernels
88  *
89  * We determine the extra cost of the non-bonded kernels compared to
90  * a reference nstlist value of 10 (which is the default in grompp).
91  */
92 static const int    nbnxnReferenceNstlist = 10;
93 //! The values to try when switching
94 const int           nstlist_try[] = { 20, 25, 40, 50, 80, 100 };
95 //! Number of elements in the neighborsearch list trials.
96 #define NNSTL  (sizeof(nstlist_try)/sizeof(nstlist_try[0]))
97 /* Increase nstlist until the size of the pair-list increased by
98  * \p c_nbnxnListSizeFactor??? or more, but never more than
99  * \p c_nbnxnListSizeFactor??? + \p c_nbnxnListSizeFactorMargin.
100  * Since we have dynamic pair list pruning, the force kernel cost depends
101  * only very weakly on nstlist. It depends strongly on nstlistPrune.
102  * Increasing nstlist mainly affects the cost of the pair search (down due
103  * to lower frequency, up due to larger list) and the list pruning kernel.
104  * We increase nstlist conservatively with regard to kernel performance.
105  * In serial the search cost is not high and thus we don't gain much by
106  * increasing nstlist a lot. In parallel the MPI and CPU-GPU communication
107  * volume as well as the communication buffer preparation and reduction time
108  * increase quickly with rlist and thus nslist. Therefore we should avoid
109  * large nstlist, even if that also reduces the domain decomposition cost.
110  * With GPUs we perform the dynamic pruning in a rolling fashion and this
111  * overlaps with the update on the CPU, which allows even larger nstlist.
112  */
113 // CPU: pair-search is a factor ~1.5 slower than the non-bonded kernel.
114 //! Target pair-list size increase ratio for CPU
115 static const float c_nbnxnListSizeFactorCpu           = 1.25;
116 // Intel KNL: pair-search is a factor ~2-3 slower than the non-bonded kernel.
117 //! Target pair-list size increase ratio for Intel KNL
118 static const float c_nbnxnListSizeFactorIntelXeonPhi  = 1.4;
119 // GPU: pair-search is a factor 1.5-3 slower than the non-bonded kernel.
120 //! Target pair-list size increase ratio for GPU
121 static const float c_nbnxnListSizeFactorGPU           = 1.4;
122 //! Never increase the size of the pair-list more than the factor above plus this margin
123 static const float c_nbnxnListSizeFactorMargin        = 0.1;
124
125 void increaseNstlist(FILE *fp, t_commrec *cr,
126                      t_inputrec *ir, int nstlist_cmdline,
127                      const gmx_mtop_t *mtop,
128                      const matrix box,
129                      bool useOrEmulateGpuForNonbondeds,
130                      const gmx::CpuInfo &cpuinfo)
131 {
132     if (!EI_DYNAMICS(ir->eI))
133     {
134         /* Can only increase nstlist with dynamics */
135         return;
136     }
137
138     float                  listfac_ok, listfac_max;
139     int                    nstlist_orig, nstlist_prev;
140     real                   rlistWithReferenceNstlist, rlist_inc, rlist_ok, rlist_max;
141     real                   rlist_new, rlist_prev;
142     size_t                 nstlist_ind = 0;
143     gmx_bool               bBox, bDD, bCont;
144     const char            *nstl_gpu = "\nFor optimal performance with a GPU nstlist (now %d) should be larger.\nThe optimum depends on your CPU and GPU resources.\nYou might want to try several nstlist values.\n";
145     const char            *nve_err  = "Can not increase nstlist because an NVE ensemble is used";
146     const char            *vbd_err  = "Can not increase nstlist because verlet-buffer-tolerance is not set or used";
147     const char            *box_err  = "Can not increase nstlist because the box is too small";
148     const char            *dd_err   = "Can not increase nstlist because of domain decomposition limitations";
149     char                   buf[STRLEN];
150
151     if (nstlist_cmdline <= 0)
152     {
153         if (ir->nstlist == 1)
154         {
155             /* The user probably set nstlist=1 for a reason,
156              * don't mess with the settings.
157              */
158             return;
159         }
160
161         /* With a GPU and fixed nstlist suggest tuning nstlist */
162         if (fp != nullptr &&
163             useOrEmulateGpuForNonbondeds &&
164             ir->nstlist < nstlist_try[0] &&
165             !supportsDynamicPairlistGenerationInterval(*ir))
166         {
167             fprintf(fp, nstl_gpu, ir->nstlist);
168         }
169
170         nstlist_ind = 0;
171         while (nstlist_ind < NNSTL && ir->nstlist >= nstlist_try[nstlist_ind])
172         {
173             nstlist_ind++;
174         }
175         if (nstlist_ind == NNSTL)
176         {
177             /* There are no larger nstlist value to try */
178             return;
179         }
180     }
181
182     if (EI_MD(ir->eI) && ir->etc == etcNO)
183     {
184         if (MASTER(cr))
185         {
186             fprintf(stderr, "%s\n", nve_err);
187         }
188         if (fp != nullptr)
189         {
190             fprintf(fp, "%s\n", nve_err);
191         }
192
193         return;
194     }
195
196     if (ir->verletbuf_tol == 0 && useOrEmulateGpuForNonbondeds)
197     {
198         gmx_fatal(FARGS, "You are using an old tpr file with a GPU, please generate a new tpr file with an up to date version of grompp");
199     }
200
201     if (ir->verletbuf_tol < 0)
202     {
203         if (MASTER(cr))
204         {
205             fprintf(stderr, "%s\n", vbd_err);
206         }
207         if (fp != nullptr)
208         {
209             fprintf(fp, "%s\n", vbd_err);
210         }
211
212         return;
213     }
214
215     GMX_RELEASE_ASSERT(supportsDynamicPairlistGenerationInterval(*ir), "In all cases that do not support dynamic nstlist, we should have returned with an appropriate message above");
216
217     if (useOrEmulateGpuForNonbondeds)
218     {
219         listfac_ok  = c_nbnxnListSizeFactorGPU;
220     }
221     else if (cpuinfo.brandString().find("Xeon Phi") != std::string::npos)
222     {
223         listfac_ok  = c_nbnxnListSizeFactorIntelXeonPhi;
224     }
225     else
226     {
227         listfac_ok  = c_nbnxnListSizeFactorCpu;
228     }
229     listfac_max     = listfac_ok + c_nbnxnListSizeFactorMargin;
230
231     nstlist_orig    = ir->nstlist;
232     if (nstlist_cmdline > 0)
233     {
234         if (fp)
235         {
236             sprintf(buf, "Getting nstlist=%d from command line option",
237                     nstlist_cmdline);
238         }
239         ir->nstlist = nstlist_cmdline;
240     }
241
242     ListSetupType      listType  = (useOrEmulateGpuForNonbondeds ? ListSetupType::Gpu : ListSetupType::CpuSimdWhenSupported);
243     VerletbufListSetup listSetup = verletbufGetSafeListSetup(listType);
244
245     /* Allow rlist to make the list a given factor larger than the list
246      * would be with the reference value for nstlist (10).
247      */
248     nstlist_prev = ir->nstlist;
249     ir->nstlist  = nbnxnReferenceNstlist;
250     calc_verlet_buffer_size(mtop, det(box), ir, ir->nstlist, ir->nstlist - 1,
251                             -1, &listSetup,
252                             nullptr, &rlistWithReferenceNstlist);
253     ir->nstlist  = nstlist_prev;
254
255     /* Determine the pair list size increase due to zero interactions */
256     rlist_inc = nbnxn_get_rlist_effective_inc(listSetup.cluster_size_j,
257                                               mtop->natoms/det(box));
258     rlist_ok  = (rlistWithReferenceNstlist + rlist_inc)*std::cbrt(listfac_ok) - rlist_inc;
259     rlist_max = (rlistWithReferenceNstlist + rlist_inc)*std::cbrt(listfac_max) - rlist_inc;
260     if (debug)
261     {
262         fprintf(debug, "nstlist tuning: rlist_inc %.3f rlist_ok %.3f rlist_max %.3f\n",
263                 rlist_inc, rlist_ok, rlist_max);
264     }
265
266     nstlist_prev = nstlist_orig;
267     rlist_prev   = ir->rlist;
268     do
269     {
270         if (nstlist_cmdline <= 0)
271         {
272             ir->nstlist = nstlist_try[nstlist_ind];
273         }
274
275         /* Set the pair-list buffer size in ir */
276         calc_verlet_buffer_size(mtop, det(box), ir, ir->nstlist, ir->nstlist - 1, -1, &listSetup, nullptr, &rlist_new);
277
278         /* Does rlist fit in the box? */
279         bBox = (gmx::square(rlist_new) < max_cutoff2(ir->ePBC, box));
280         bDD  = TRUE;
281         if (bBox && DOMAINDECOMP(cr))
282         {
283             /* Check if rlist fits in the domain decomposition */
284             if (inputrec2nboundeddim(ir) < DIM)
285             {
286                 gmx_incons("Changing nstlist with domain decomposition and unbounded dimensions is not implemented yet");
287             }
288             t_state state_tmp;
289             copy_mat(box, state_tmp.box);
290             bDD = change_dd_cutoff(cr, state_tmp, rlist_new);
291         }
292
293         if (debug)
294         {
295             fprintf(debug, "nstlist %d rlist %.3f bBox %s bDD %s\n",
296                     ir->nstlist, rlist_new, gmx::boolToString(bBox), gmx::boolToString(bDD));
297         }
298
299         bCont = FALSE;
300
301         if (nstlist_cmdline <= 0)
302         {
303             if (bBox && bDD && rlist_new <= rlist_max)
304             {
305                 /* Increase nstlist */
306                 nstlist_prev = ir->nstlist;
307                 rlist_prev   = rlist_new;
308                 bCont        = (nstlist_ind+1 < NNSTL && rlist_new < rlist_ok);
309             }
310             else
311             {
312                 /* Stick with the previous nstlist */
313                 ir->nstlist = nstlist_prev;
314                 rlist_new   = rlist_prev;
315                 bBox        = TRUE;
316                 bDD         = TRUE;
317             }
318         }
319
320         nstlist_ind++;
321     }
322     while (bCont);
323
324     if (!bBox || !bDD)
325     {
326         gmx_warning("%s", !bBox ? box_err : dd_err);
327         if (fp != nullptr)
328         {
329             fprintf(fp, "\n%s\n", !bBox ? box_err : dd_err);
330         }
331         ir->nstlist = nstlist_orig;
332     }
333     else if (ir->nstlist != nstlist_orig || rlist_new != ir->rlist)
334     {
335         sprintf(buf, "Changing nstlist from %d to %d, rlist from %g to %g",
336                 nstlist_orig, ir->nstlist,
337                 ir->rlist, rlist_new);
338         if (MASTER(cr))
339         {
340             fprintf(stderr, "%s\n\n", buf);
341         }
342         if (fp != nullptr)
343         {
344             fprintf(fp, "%s\n\n", buf);
345         }
346         ir->rlist     = rlist_new;
347     }
348 }
349
350 /*! \brief The interval in steps at which we perform dynamic, rolling pruning on a GPU.
351  *
352  * Ideally we should auto-tune this value.
353  * Not considering overheads, 1 would be the ideal value. But 2 seems
354  * a reasonable compromise that reduces GPU kernel launch overheads and
355  * also avoids inefficiency on large GPUs when pruning small lists.
356  * Because with domain decomposition we alternate local/non-local pruning
357  * at even/odd steps, which gives a period of 2, this value currenly needs
358  * to be 2, which is indirectly asserted when the GPU pruning is dispatched
359  * during the force evaluation.
360  */
361 static const int c_nbnxnGpuRollingListPruningInterval = 2;
362
363 /*! \brief The minimum nstlist for dynamic pair list pruning.
364  *
365  * In most cases going lower than 4 will lead to a too high pruning cost.
366  * This value should be a multiple of \p c_nbnxnGpuRollingListPruningInterval
367  */
368 static const int c_nbnxnDynamicListPruningMinLifetime = 4;
369
370 /*! \brief Set the dynamic pairlist pruning parameters in \p ic
371  *
372  * \param[in]     ir          The input parameter record
373  * \param[in]     mtop        The global topology
374  * \param[in]     box         The unit cell
375  * \param[in]     useGpu      Tells if we are using a GPU for non-bondeds
376  * \param[in]     listSetup   The nbnxn pair list setup
377  * \param[in]     userSetNstlistPrune  The user set ic->nstlistPrune (using an env.var.)
378  * \param[in] ic              The nonbonded interactions constants
379  * \param[in,out] listParams  The list setup parameters
380  */
381 static void
382 setDynamicPairlistPruningParameters(const t_inputrec             *ir,
383                                     const gmx_mtop_t             *mtop,
384                                     matrix                        box,
385                                     gmx_bool                      useGpu,
386                                     const VerletbufListSetup     &listSetup,
387                                     bool                          userSetNstlistPrune,
388                                     const interaction_const_t    *ic,
389                                     NbnxnListParameters          *listParams)
390 {
391     /* When nstlistPrune was set by the user, we need to execute one loop
392      * iteration to determine rlistInner.
393      * Otherwise we compute rlistInner and increase nstlist as long as
394      * we have a pairlist buffer of length 0 (i.e. rlistInner == cutoff).
395      */
396     const real interactionCutoff = std::max(ic->rcoulomb, ic->rvdw);
397     int        tunedNstlistPrune = listParams->nstlistPrune;
398     do
399     {
400         /* Dynamic pruning on the GPU is performed on the list for
401          * the next step on the coordinates of the current step,
402          * so the list lifetime is nstlistPrune (not the usual nstlist-1).
403          */
404         int listLifetime         = tunedNstlistPrune - (useGpu ? 0 : 1);
405         listParams->nstlistPrune = tunedNstlistPrune;
406         calc_verlet_buffer_size(mtop, det(box), ir,
407                                 tunedNstlistPrune, listLifetime,
408                                 -1, &listSetup, nullptr,
409                                 &listParams->rlistInner);
410
411         /* On the GPU we apply the dynamic pruning in a rolling fashion
412          * every c_nbnxnGpuRollingListPruningInterval steps,
413          * so keep nstlistPrune a multiple of the interval.
414          */
415         tunedNstlistPrune += useGpu ? c_nbnxnGpuRollingListPruningInterval : 1;
416     }
417     while (!userSetNstlistPrune &&
418            tunedNstlistPrune < ir->nstlist &&
419            listParams->rlistInner == interactionCutoff);
420
421     if (userSetNstlistPrune)
422     {
423         listParams->useDynamicPruning = true;
424     }
425     else
426     {
427         /* Determine the pair list size increase due to zero interactions */
428         real rlistInc = nbnxn_get_rlist_effective_inc(listSetup.cluster_size_j,
429                                                       mtop->natoms/det(box));
430
431         /* Dynamic pruning is only useful when the inner list is smaller than
432          * the outer. The factor 0.99 ensures at least 3% list size reduction.
433          *
434          * With dynamic pruning on the CPU we prune after updating,
435          * so nstlistPrune=nstlist-1 would add useless extra work.
436          * With the GPU there will probably be more overhead than gain
437          * with nstlistPrune=nstlist-1, so we disable dynamic pruning.
438          * Note that in such cases the first sub-condition is likely also false.
439          */
440         listParams->useDynamicPruning =
441             (listParams->rlistInner + rlistInc < 0.99*(listParams->rlistOuter + rlistInc) &&
442              listParams->nstlistPrune < ir->nstlist - 1);
443     }
444
445     if (!listParams->useDynamicPruning)
446     {
447         /* These parameters should not be used, but set them to useful values */
448         listParams->nstlistPrune  = -1;
449         listParams->rlistInner    = listParams->rlistOuter;
450     }
451 }
452
453 /*! \brief Returns a string describing the setup of a single pair-list
454  *
455  * \param[in] listName           Short name of the list, can be ""
456  * \param[in] nstList            The list update interval in steps
457  * \param[in] nstListForSpacing  Update interval for setting the number characters for printing \p nstList
458  * \param[in] rList              List cut-off radius
459  * \param[in] interactionCutoff  The interaction cut-off, use for printing the list buffer size
460  */
461 static std::string formatListSetup(const std::string &listName,
462                                    int                nstList,
463                                    int                nstListForSpacing,
464                                    real               rList,
465                                    real               interactionCutoff)
466 {
467     std::string listSetup = "  ";
468     if (!listName.empty())
469     {
470         listSetup += listName + " list: ";
471     }
472     listSetup += "updated every ";
473     // Make the shortest int format string that fits nstListForSpacing
474     std::string nstListFormat = "%" + gmx::formatString("%zu", gmx::formatString("%d", nstListForSpacing).size()) + "d";
475     listSetup += gmx::formatString(nstListFormat.c_str(), nstList);
476     listSetup += gmx::formatString(" steps, buffer %.3f nm, rlist %.3f nm\n",
477                                    rList - interactionCutoff, rList);
478
479     return listSetup;
480 }
481
482 void setupDynamicPairlistPruning(const gmx::MDLogger       &mdlog,
483                                  const t_inputrec          *ir,
484                                  const gmx_mtop_t          *mtop,
485                                  matrix                     box,
486                                  int                        nbnxnKernelType,
487                                  const interaction_const_t *ic,
488                                  NbnxnListParameters       *listParams)
489 {
490     GMX_RELEASE_ASSERT(listParams->rlistOuter > 0, "With the nbnxn setup rlist should be > 0");
491
492     /* Initialize the parameters to no dynamic list pruning */
493     listParams->useDynamicPruning = false;
494
495     const VerletbufListSetup ls   = verletbufGetListSetup(nbnxnKernelType);
496
497     /* Currently emulation mode does not support dual pair-lists */
498     const bool useGpu             = (nbnxnKernelType == nbnxnk8x8x8_GPU);
499
500     if (supportsDynamicPairlistGenerationInterval(*ir) &&
501         getenv("GMX_DISABLE_DYNAMICPRUNING") == nullptr)
502     {
503         /* Note that nstlistPrune can have any value independently of nstlist.
504          * Actually applying rolling pruning is only useful when
505          * nstlistPrune < nstlist -1
506          */
507         char *env                 = getenv("GMX_NSTLIST_DYNAMICPRUNING");
508         bool  userSetNstlistPrune = (env != nullptr);
509
510         if (userSetNstlistPrune)
511         {
512             char *end;
513             listParams->nstlistPrune = strtol(env, &end, 10);
514             if (!end || (*end != 0) ||
515                 !(listParams->nstlistPrune > 0 && listParams->nstlistPrune < ir->nstlist))
516             {
517                 gmx_fatal(FARGS, "Invalid value passed in GMX_NSTLIST_DYNAMICPRUNING=%s, should be > 0 and < nstlist", env);
518             }
519         }
520         else
521         {
522             static_assert(c_nbnxnDynamicListPruningMinLifetime % c_nbnxnGpuRollingListPruningInterval == 0,
523                           "c_nbnxnDynamicListPruningMinLifetime sets the starting value for nstlistPrune, which should be divisible by the rolling pruning interval for efficiency reasons.");
524
525             // TODO: Use auto-tuning to determine nstlistPrune
526             listParams->nstlistPrune = c_nbnxnDynamicListPruningMinLifetime;
527         }
528
529         setDynamicPairlistPruningParameters(ir, mtop, box, useGpu, ls,
530                                             userSetNstlistPrune, ic,
531                                             listParams);
532
533         if (listParams->useDynamicPruning && useGpu)
534         {
535             /* Note that we can round down here. This makes the effective
536              * rolling pruning interval slightly shorter than nstlistTune,
537              * thus giving correct results, but a slightly lower efficiency.
538              */
539             GMX_RELEASE_ASSERT(listParams->nstlistPrune >= c_nbnxnGpuRollingListPruningInterval,
540                                ( "With dynamic list pruning on GPUs pruning frequency must be at least as large as the rolling pruning interval (" +
541                                  std::to_string(c_nbnxnGpuRollingListPruningInterval) +
542                                  ").").c_str() );
543             listParams->numRollingParts = listParams->nstlistPrune/c_nbnxnGpuRollingListPruningInterval;
544         }
545         else
546         {
547             listParams->numRollingParts = 1;
548         }
549     }
550
551     std::string mesg;
552
553     const real  interactionCutoff = std::max(ic->rcoulomb, ic->rvdw);
554     if (listParams->useDynamicPruning)
555     {
556         mesg += gmx::formatString("Using a dual %dx%d pair-list setup updated with dynamic%s pruning:\n",
557                                   ls.cluster_size_i, ls.cluster_size_j,
558                                   listParams->numRollingParts > 1 ? ", rolling" : "");
559         mesg += formatListSetup("outer", ir->nstlist, ir->nstlist, listParams->rlistOuter, interactionCutoff);
560         mesg += formatListSetup("inner", listParams->nstlistPrune, ir->nstlist, listParams->rlistInner, interactionCutoff);
561     }
562     else
563     {
564         mesg += gmx::formatString("Using a %dx%d pair-list setup:\n",
565                                   ls.cluster_size_i, ls.cluster_size_j);
566         mesg += formatListSetup("", ir->nstlist, ir->nstlist, listParams->rlistOuter, interactionCutoff);
567     }
568     if (supportsDynamicPairlistGenerationInterval(*ir))
569     {
570         VerletbufListSetup listSetup1x1 = { 1, 1 };
571         real               rlistOuter;
572         real               rlistInner;
573         calc_verlet_buffer_size(mtop, det(box), ir, ir->nstlist, ir->nstlist - 1,
574                                 -1, &listSetup1x1, nullptr, &rlistOuter);
575         if (listParams->useDynamicPruning)
576         {
577             int listLifeTime = listParams->nstlistPrune - (useGpu ? 0 : 1);
578             calc_verlet_buffer_size(mtop, det(box), ir, listParams->nstlistPrune, listLifeTime,
579                                     -1, &listSetup1x1, nullptr, &rlistInner);
580         }
581
582         mesg += gmx::formatString("At tolerance %g kJ/mol/ps per atom, equivalent classical 1x1 list would be:\n",
583                                   ir->verletbuf_tol);
584         if (listParams->useDynamicPruning)
585         {
586             mesg += formatListSetup("outer", ir->nstlist, ir->nstlist, rlistOuter, interactionCutoff);
587             mesg += formatListSetup("inner", listParams->nstlistPrune, ir->nstlist, rlistInner, interactionCutoff);
588         }
589         else
590         {
591             mesg += formatListSetup("", ir->nstlist, ir->nstlist, rlistOuter, interactionCutoff);
592         }
593     }
594
595     GMX_LOG(mdlog.info).asParagraph().appendText(mesg);
596 }