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