Gromacs  2024.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
hardwaretopology.cpp File Reference
#include "gmxpre.h"
#include "hardwaretopology.h"
#include "config.h"
#include <cstdio>
#include <algorithm>
#include <array>
#include <fstream>
#include <iterator>
#include <limits>
#include <sstream>
#include <string>
#include <string_view>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <sys/types.h>
#include "gromacs/hardware/cpuinfo.h"
#include "gromacs/utility/gmxassert.h"
+ Include dependency graph for hardwaretopology.cpp:

Description

Implements gmx::HardwareTopology.

Author
Erik Lindahl erik..nosp@m.lind.nosp@m.ahl@g.nosp@m.mail.nosp@m..com

Functions

void gmx::anonymous_namespace{hardwaretopology.cpp}::translateCpuInfoLogicalProcessorsToMachine (const std::vector< CpuInfo::LogicalProcessor > &logicalProcessors, HardwareTopology::Machine *machine)
 Utlility function to renumber and translate low-level APIC info to topology. More...
 
HardwareTopology::SupportLevel gmx::anonymous_namespace{hardwaretopology.cpp}::parseCpuInfo (HardwareTopology::Machine *machine)
 Initialize machine data from basic information in cpuinfo. More...
 
int gmx::anonymous_namespace{hardwaretopology.cpp}::detectLogicalProcessorCount ()
 Try to detect the number of logical processors. More...
 
std::vector< int > gmx::anonymous_namespace{hardwaretopology.cpp}::parseCpuString (const std::string &cpuString)
 Parse cpu list (integers) from string separated by commas and ranges. More...
 
HardwareTopology::SupportLevel gmx::anonymous_namespace{hardwaretopology.cpp}::parseSysFsCpuTopology (HardwareTopology::Machine *machine, const std::string &root="", const std::vector< int > &allowedCpus={})
 Attempt to read basic topology from Linux sysfs interface. More...
 
std::string gmx::anonymous_namespace{hardwaretopology.cpp}::findCgroupPath (const std::vector< std::string > &mountPoints, const std::vector< std::string > &subGroups, const std::string &root)
 Find the active cgroup path for the current process. More...
 
float gmx::anonymous_namespace{hardwaretopology.cpp}::parseCgroup1CpuLimit (const std::vector< std::string > &mountPoints, const std::string &root="")
 Parse cpu limits from cgroup version 1 file system on Linux. More...
 
float gmx::anonymous_namespace{hardwaretopology.cpp}::parseCgroup2CpuLimit (const std::vector< std::string > &mountPoints, const std::string &root="")
 Parse cpu limits from cgroup version 2 file system on Linux. More...
 
float gmx::anonymous_namespace{hardwaretopology.cpp}::detectCpuLimit (const std::string &root="")
 
int gmx::anonymous_namespace{hardwaretopology.cpp}::setMaxThreads (float cpuLimit, int topologyCpus, int systemCpus)