Gromacs
2024.3
|
#include <gromacs/hardware/hardwaretopology.h>
Hardware topology information about the entire machine.
The machine structure is a tree with top-down information about all packages, cores, and processing units in the system. For example, an operating system logical processor index can be found as machine.packages[0].cores[2].processingUnits[1].osId. In some cases you might need the opposite lookup, i.e. the processing unit Id on the topology from the OS-assigned Id. This is present in the map osIdToPuId, provided we have sufficient support level.
It can happen that our process is only allowed to run on a subset of processors, e.g. because we are running in a container or because some cores are reserved for management, which complicates core detection a bit. In this case, the hardware topology will only list the PUs on which we are allowed to run, meaning it might look quite unbalanced.
First, remember that you must consider the supportLevel before using data in this class.
Public Attributes | |
std::vector< LogicalProcessor > | logicalProcessors |
Logical processing unit info, indexed by PU Ids in vector. | |
std::map< int, int > | osIdToPuId |
Map from OS to topology processing unit ids. | |
std::vector< Package > | packages |
All the packages in the system. | |
std::vector< Cache > | caches |
Caches in increasing level order. | |
Numa | numa |
Structure with all numa information. | |
std::vector< Device > | devices |
Devices on PCI bus. | |