Gromacs  2023.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Attributes
gmx::HardwareTopology::ProcessingUnit Struct Reference

#include <gromacs/hardware/hardwaretopology.h>


Information about a single processing unit (in a core)

Gromacs now follows hwloc's nomenclature of calling the lowest-level entity in the system "processing unit", which is typically a hardware thread, while we call the (physical) grouping of many cores a package rather than socket. This avoids the confusion between "logical processor", "core", "thread", and the indices assigned by the operating system, and it resolves the situation where a single socket might host multiple chip modules.

The id of the processing unit is specific only to this hardware topology. The processing unit id typically increases continuously as you walk through packages and cores in order of their ids. In general it will be different from the processor id assigned by the operating system. To achieve better load balancing when starting fewer threads than hardware threads on SMT systems, Linux e.g. typically assigns processor ids in a round-robin fashion over all cores. In addition, the hardware topology now only contains the packages, cores, and processing units on which we are permitted to run, which in general means it will not be uniform. This also means all the resources present in the entire (physical) node will in general not be visible in the hardware topology structure, so you cannot e.g. use the number of cores in the first package to check the number of cores per package.

In practice, even hwloc appears to be a bit inconsistent, and when testing with a subset of cores the topology included empty packages, while core Ids were changed so only permitted ones were included.

Public Attributes

int id
 index of this processing unit in hardware topology
int osId
 index assigned by the operating system

The documentation for this struct was generated from the following file: