Gromacs  2020.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::GpuTaskAssignmentsBuilder Class Reference

#include <gromacs/taskassignment/taskassignment.h>


Builder for the GpuTaskAssignments for all ranks on this node.

This will coordinate the final stages of task assignment and reporting, and build the GpuTaskAssignments object used to configure the modules that might run tasks on GPUs.

Communicates between ranks on a node to coordinate task assignment between them onto available hardware, e.g. accelerators.

Later, this might become a loop over all registered modules relevant to the mdp inputs, to find those that have such tasks.
Later we might need the concept of computeTasksOnThisRank, from which we construct gpuTasksOnThisRank.

Currently the DD code assigns duty to ranks that can include PP work that currently can be executed on a single GPU, if present and compatible. This has to be coordinated across PP ranks on a node, with possible multiple devices or sharing devices on a node, either from the user selection, or automatically.

Public Member Functions

 GpuTaskAssignmentsBuilder ()
GpuTaskAssignments build (const std::vector< int > &gpuIdsToUse, const std::vector< int > &userGpuTaskAssignment, const gmx_hw_info_t &hardwareInfo, MPI_Comm gromacsWorldComm, const PhysicalNodeCommunicator &physicalNodeComm, TaskTarget nonbondedTarget, TaskTarget pmeTarget, TaskTarget bondedTarget, TaskTarget updateTarget, bool useGpuForNonbonded, bool useGpuForPme, bool rankHasPpTask, bool rankHasPmeTask)
 Builds a GpuTaskAssignments. More...

Member Function Documentation

GpuTaskAssignments gmx::GpuTaskAssignmentsBuilder::build ( const std::vector< int > &  gpuIdsToUse,
const std::vector< int > &  userGpuTaskAssignment,
const gmx_hw_info_t &  hardwareInfo,
MPI_Comm  gromacsWorldComm,
const PhysicalNodeCommunicator physicalNodeComm,
TaskTarget  nonbondedTarget,
TaskTarget  pmeTarget,
TaskTarget  bondedTarget,
TaskTarget  updateTarget,
bool  useGpuForNonbonded,
bool  useGpuForPme,
bool  rankHasPpTask,
bool  rankHasPmeTask 

Builds a GpuTaskAssignments.

This method reconciles

  • user mdrun command-line options,
  • the results of hardware detection
  • the duty assigned by the DD setup,
  • the requested simulation modules, and
  • the possible existence of multi-simulations

to assign the GPUs on each physical node to the tasks on the ranks of that node. It throws InconsistentInputError when a/the useful GPU task assignment is not possible.

[in]gpuIdsToUseThe compatible GPUs that the user permitted us to use.
[in]userGpuTaskAssignmentThe user-specified assignment of GPU tasks to device IDs.
[in]hardwareInfoThe detected hardware
[in]gromacsWorldCommMPI communicator for all ranks in the current GROMACS run
[in]physicalNodeCommCommunication object for this physical node.
[in]nonbondedTargetThe user's choice for mdrun -nb for where to assign short-ranged nonbonded interaction tasks.
[in]pmeTargetThe user's choice for mdrun -pme for where to assign long-ranged PME nonbonded interaction tasks.
[in]bondedTargetThe user's choice for mdrun -bonded for where to assign tasks.
[in]updateTargetThe user's choice for mdrun -update for where to assign tasks.
[in]useGpuForNonbondedWhether GPUs will be used for nonbonded interactions.
[in]useGpuForPmeWhether GPUs will be used for PME interactions.
[in]rankHasPpTaskWhether this rank has a PP task
[in]rankHasPmeTaskWhether this rank has a PME task
std::bad_allocIf out of memory. InconsistentInputError If user and/or detected inputs are inconsistent.

The documentation for this class was generated from the following files: