2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 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.
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.
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.
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.
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.
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.
35 /*! \libinternal \file
36 * \brief Declares force calculation workload manager.
38 * \author Mark Abraham <mark.j.abraham@gmail.com>
39 * \ingroup module_mdlib
42 #ifndef GMX_MDLIB_PPFORCEWORKLOAD_H
43 #define GMX_MDLIB_PPFORCEWORKLOAD_H
49 * \brief Data structure to map force flags to booleans that have the role of
50 * directing per-step tasks undertaken by a PP rank.
52 * Note that the contents of this class have a lifetime of a single step and
53 * are expected to be set every step.
59 //! Whether the state has changed, always set unless TPI is used.
60 bool stateChanged = false;
61 //! Whether the box might have changed
62 bool haveDynamicBox = false;
63 //! Whether neighbor searching needs to be done this step
64 bool doNeighborSearch = false;
65 //! Whether virial needs to be computed this step
66 bool computeVirial = false;
67 //! Whether energies need to be computed this step this step
68 bool computeEnergy = false;
69 //! Whether (any) forces need to be computed this step, not only energies
70 bool computeForces = false;
71 //! Whether nonbonded forces need to be computed this step
72 bool computeNonbondedForces = false;
73 //! Whether listed forces need to be computed this step
74 bool computeListedForces = false;
75 //! Whether this step DHDL needs to be computed
76 bool computeDhdl = false;
80 * \brief Manage what force calculation work is required each step.
82 * An object of this type is updated every neighbour search stage to
83 * reflect what work is required during normal MD steps, e.g. whether
84 * there are bonded interactions in this PP task.
86 * This will remove the desire for inline getters from modules that
87 * describe whether they have work to do, because that can be set up
88 * once per simulation or neighborlist lifetime and not changed
91 * \todo Add more responsibilities, including whether GPUs are in use,
92 * whether there is PME work, whether DD is active, whether NB
93 * local/nonlocal regions have work, whether forces/virial/energy are
101 //! Whether this MD step has bonded work to run on a GPU.
102 bool haveGpuBondedWork = false;
103 //! Whether this MD step has bonded work to run on he CPU.
104 bool haveCpuBondedWork = false;
105 //! Whether this MD step has restraints work to run on he CPU.
106 bool haveRestraintsWork = false;
107 //! Whether this MD step has listed forces work to run on he CPU.
108 // Note: currently this is haveCpuBondedWork | haveRestraintsWork
109 bool haveCpuListedForceWork = false;
110 //! Whether this MD step has special forces on the CPU.
111 bool haveSpecialForces = false;
114 class MdScheduleWorkload
117 //! Force schedule workload descriptor constant for an nstlist range
118 gmx::PpForceWorkload forceWork;
119 //! Force flags changing per-step
120 gmx::ForceFlags forceFlags;