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

#include <gromacs/taskassignment/include/gromacs/taskassignment/taskassignment.h>

Description

Contains the GPU task assignment for all ranks on this physical node.

This can be used to configure the modules on this rank that might run tasks on GPUs.

This assignment is made by a GpuTaskAssignmentsBuilder object.

Public Member Functions

 GpuTaskAssignments (GpuTaskAssignments &&source) noexcept=default
 Public move constructor to use with the builder.
 
void reportGpuUsage (const MDLogger &mdlog, bool printHostName, PmeRunMode pmeRunMode, const SimulationWorkload &simulationWork)
 Log a report on how GPUs are being used on the ranks of the physical node of rank 0 of the simulation. More...
 
void logPerformanceHints (const MDLogger &mdlog, size_t numAvailableDevicesOnThisNode)
 Logs to mdlog information that may help a user learn how to let mdrun make a task assignment that runs faster. More...
 
DeviceInformationinitDevice (int *deviceId) const
 Return handle to the initialized GPU to use in this rank. More...
 
bool thisRankHasPmeGpuTask () const
 Return whether this rank has a PME task running on a GPU.
 
bool thisRankHasAnyGpuTask () const
 Return whether this rank has any task running on a GPU.
 
std::vector< int > deviceIdsAssigned ()
 Get the list of unique devices that have been assigned tasks on this physical node.
 

Friends

class GpuTaskAssignmentsBuilder
 

Member Function Documentation

DeviceInformation * gmx::GpuTaskAssignments::initDevice ( int *  deviceId) const

Return handle to the initialized GPU to use in this rank.

Parameters
[out]deviceIdIndex of the assigned device.
Returns
Device information on the selected devicce. Returns nullptr if no GPU task is assigned to this rank.
void gmx::GpuTaskAssignments::logPerformanceHints ( const MDLogger mdlog,
size_t  numAvailableDevicesOnThisNode 
)

Logs to mdlog information that may help a user learn how to let mdrun make a task assignment that runs faster.

Parameters
[in]mdlogLogging object.
[in]numAvailableDevicesOnThisNodeThe number of compatible devices on this node that the user permitted us to use.
void gmx::GpuTaskAssignments::reportGpuUsage ( const MDLogger mdlog,
bool  printHostName,
PmeRunMode  pmeRunMode,
const SimulationWorkload simulationWork 
)

Log a report on how GPUs are being used on the ranks of the physical node of rank 0 of the simulation.

Todo:
It could be useful to report also whether any nodes differed, and in what way.
Parameters
[in]mdlogLogging object.
[in]printHostNamePrint the hostname in the usage information.
[in]pmeRunModeDescribes the execution of PME tasks.
[in]simulationWorkSimulation workload descriptor
Exceptions
std::bad_allocif out of memory

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